Skip to content

Commit 027d300

Browse files
committed
fixup! Implement new API for ACS/SLO data in metadata
Signed-off-by: Wesley Schwengle <wesley@opndev.io>
1 parent d81549a commit 027d300

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lib/Net/SAML2/SP.pm

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ has 'org_display_name' => (isa => 'Str', is => 'ro', required => 1);
153153
has 'org_contact' => (isa => 'Str', is => 'ro', required => 1);
154154
has 'org_url' => (isa => 'Str', is => 'ro', required => 0);
155155

156+
# These are no longer in use, but are not removed by the off change that
157+
# someone that extended us or added a role to us with these params.
158+
has 'slo_url_soap' => (isa => 'Str', is => 'ro', required => 0);
159+
has 'slo_url_post' => (isa => 'Str', is => 'ro', required => 0);
160+
has 'slo_url_redirect' => (isa => 'Str', is => 'ro', required => 0);
161+
has 'acs_url_post' => (isa => 'Str', is => 'ro', required => 0);
162+
has 'acs_url_artifact' => (isa => 'Str', is => 'ro', required => 0);
163+
156164
has '_cert_text' => (isa => 'Str', is => 'ro', init_arg => undef, builder => '_build_cert_text', lazy => 1);
157165

158166
has 'authnreq_signed' => (isa => 'Bool', is => 'ro', required => 0, default => 1);
@@ -172,7 +180,7 @@ around BUILDARGS => sub {
172180
if (!$args{single_logout_service}) {
173181
#warn "Deprecation warning, please upgrade your code to use ..";
174182
my @slo;
175-
if (my $slo = delete $args{slo_url_soap}) {
183+
if (my $slo = $args{slo_url_soap}) {
176184
push(
177185
@slo,
178186
{
@@ -181,7 +189,7 @@ around BUILDARGS => sub {
181189
}
182190
);
183191
}
184-
if (my $slo = delete $args{slo_url_redirect}) {
192+
if (my $slo = $args{slo_url_redirect}) {
185193
push(
186194
@slo,
187195
{
@@ -190,7 +198,7 @@ around BUILDARGS => sub {
190198
}
191199
);
192200
}
193-
if (my $slo = delete $args{slo_url_post}) {
201+
if (my $slo = $args{slo_url_post}) {
194202
push(
195203
@slo,
196204
{
@@ -219,7 +227,7 @@ around BUILDARGS => sub {
219227
}
220228
);
221229
}
222-
if (my $acs = delete $args{acs_url_artifact}) {
230+
if (my $acs = $args{acs_url_artifact}) {
223231
push(
224232
@acs,
225233
{
@@ -459,7 +467,7 @@ sub generate_metadata {
459467
'urn:oasis:names:tc:SAML:2.0:protocol',
460468
},
461469

462-
$self->_generate_keydescriptors($x),
470+
$self->_generate_key_descriptors($x),
463471

464472
$self->_generate_single_logout_service($x),
465473

@@ -490,7 +498,7 @@ sub generate_metadata {
490498
);
491499
}
492500

493-
sub _generate_keydescriptors {
501+
sub _generate_key_descriptors {
494502
my $self = shift;
495503
my $x = shift;
496504

@@ -523,13 +531,7 @@ sub _generate_keydescriptors {
523531
sub _generate_single_logout_service {
524532
my $self = shift;
525533
my $x = shift;
526-
527-
my @slo;
528-
foreach (@{ $self->single_logout_service }) {
529-
push(@slo, $x->SingleLogoutService($md, $_));
530-
}
531-
return @slo;
532-
534+
return map { $x->SingleLogoutService($md, $_) } @{ $self->single_logout_service };
533535
}
534536

535537
sub _generate_assertion_consumer_service {
@@ -560,7 +562,7 @@ Returns the metadata XML document for this SP.
560562
=cut
561563

562564
sub metadata {
563-
my ($self) = @_;
565+
my $self = shift;
564566

565567
my $metadata = $self->generate_metadata();
566568
return $metadata unless $self->sign_metadata;

0 commit comments

Comments
 (0)