File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed
Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,14 @@ Consumer Services.
162162
163163has ' url' => (isa => Uri, is => ' ro' , required => 1, coerce => 1);
164164
165- has ' id' => (isa => XsdID, is => ' ro' , builder => ' _build_id' );
166- has ' issuer' => (isa => ' Str' , is => ' ro' , required => 1);
165+ has ' _id' => (
166+ isa => XsdID,
167+ is => ' ro' ,
168+ builder => ' _build_id' ,
169+ init_arg => ' id'
170+ );
171+
172+ has ' issuer' => (isa => ' Str' , is => ' ro' , required => 1);
167173
168174has ' cert' => (isa => ' Str' , is => ' ro' , required => 1, predicate => ' has_cert' );
169175has ' key' => (isa => ' Str' , is => ' ro' , required => 1);
@@ -298,6 +304,14 @@ sub _build_id {
298304 return Net::SAML2::Util::generate_id();
299305}
300306
307+ sub id {
308+ my $self = shift ;
309+ Net::SAML2::Util::deprecation_warning
310+ " id() has been renamed to issuer()" ;
311+ return $self -> issuer;
312+ }
313+
314+
301315sub _build_encryption_key_text {
302316 my ($self ) = @_ ;
303317
@@ -590,7 +604,7 @@ sub generate_metadata {
590604 $md ,
591605 {
592606 entityID => $self -> issuer,
593- ID => $self -> id ,
607+ ID => $self -> _id ,
594608 },
595609 $x -> SPSSODescriptor(
596610 $md ,
Original file line number Diff line number Diff line change @@ -490,4 +490,18 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
490490 is($child [1]-> getAttribute(' isRequired' ), ' 1' , " .. and requiredness" );
491491}
492492
493+ {
494+ my $sp = net_saml2_sp();
495+
496+ my @warns ;
497+ local $SIG {__WARN__ } = sub { push (@warns , shift ); };
498+ my $id = $sp -> id;
499+ is($id , $sp -> issuer, " id is still the issuer" );
500+ cmp_deeply(
501+ \@warns ,
502+ [" NET::SAML2 deprecation warning: id() has been renamed to issuer()\n " ],
503+ " We have our deprecation warning"
504+ );
505+ }
506+
493507done_testing;
You can’t perform that action at this time.
0 commit comments