diff --git a/lib/Net/SAML2/Object/Response.pm b/lib/Net/SAML2/Object/Response.pm index 259f0dc..177d6c6 100644 --- a/lib/Net/SAML2/Object/Response.pm +++ b/lib/Net/SAML2/Object/Response.pm @@ -38,9 +38,9 @@ the status is successful you can grab an assertion and continue your flow. warn "Got a response but isn't successful"; my $status = $response->status; - my $sub_status = $response->sub_status; + my $substatus = $response->substatus; - warn "We got a $status back with the following sub status $sub_status"; + warn "We got a $status back with the following sub status $substatus"; } else { $response->to_assertion( @@ -57,7 +57,7 @@ the status is successful you can grab an assertion and continue your flow. Returns the status of the response -=head2 sub_status +=head2 substatus Returns the sub status of the response @@ -80,11 +80,11 @@ has status => ( required => 1, ); -has sub_status => ( +has substatus => ( is => 'ro', isa => 'Str', required => 0, - predicate => 'has_sub_status', + predicate => 'has_substatus', ); has assertions => ( @@ -134,7 +134,7 @@ sub new_from_xml { return $self->new( dom => $xml, status => $status, - $substatus ? ( sub_status => $substatus) : (), + $substatus ? ( substatus => $substatus) : (), issuer => $xpath->findvalue('saml:Issuer', $response), id => $response->getAttribute('ID'), in_response_to => $response->getAttribute('InResponseTo'), diff --git a/lib/Net/SAML2/Protocol/Assertion.pm b/lib/Net/SAML2/Protocol/Assertion.pm index 59d62f6..5a09b1b 100644 --- a/lib/Net/SAML2/Protocol/Assertion.pm +++ b/lib/Net/SAML2/Protocol/Assertion.pm @@ -212,10 +212,10 @@ sub new_from_xml { my $status_node = $nodeset->get_node(1); my $status = $status_node->getAttribute('Value'); - my $sub_status; + my $substatus; if (my $s = first { $_->isa('XML::LibXML::Element') } $status_node->childNodes) { - $sub_status = $s->getAttribute('Value'); + $substatus = $s->getAttribute('Value'); } my $self = $class->new( @@ -231,7 +231,7 @@ sub new_from_xml { xpath => $xpath, in_response_to => $xpath->findvalue('//saml:Subject/saml:SubjectConfirmation/saml:SubjectConfirmationData/@InResponseTo'), response_status => $status, - $sub_status ? (response_substatus => $sub_status) : (), + $substatus ? (response_substatus => $substatus) : (), $authnstatement ? (authnstatement => $authnstatement) : (), ); diff --git a/lib/Net/SAML2/Protocol/LogoutResponse.pm b/lib/Net/SAML2/Protocol/LogoutResponse.pm index cdc9ef8..6841a0f 100644 --- a/lib/Net/SAML2/Protocol/LogoutResponse.pm +++ b/lib/Net/SAML2/Protocol/LogoutResponse.pm @@ -47,7 +47,7 @@ IdP's identity URI Response status (required) -=item B +=item B The sub status @@ -60,7 +60,7 @@ Request ID we're responding to (required); =cut has 'status' => (isa => 'Str', is => 'ro', required => 1); -has 'sub_status' => (isa => 'Str', is => 'ro', required => 0); +has 'substatus' => (isa => 'Str', is => 'ro', required => 0); has '+in_response_to' => (required => 1); # Remove response_to/substatus after 6 months from now (april 18th 2024) @@ -75,11 +75,6 @@ around BUILDARGS => sub { "Please use in_response_to instead of response_to"); } - if (my $s = delete $args{substatus}) { - $args{sub_status} = $s; - deprecation_warning( - "Please use in_response_to instead of response_to"); - } return $self->$orig(%args); }; @@ -95,18 +90,6 @@ sub response_to { return $self->in_response_to; } -=head2 substatus() - -Deprecated use B - -=cut - -sub substatus { - my $self = shift; - deprecation_warning("Please use sub_status instead of substatus"); - return $self->sub_status; -} - =head2 new_from_xml( ... ) Create a LogoutResponse object from the given XML. @@ -139,7 +122,7 @@ sub new_from_xml { session => $xpath->findvalue('/samlp:LogoutResponse/samlp:SessionIndex'), issuer => $xpath->findvalue('/samlp:LogoutResponse/saml:Issuer'), status => $xpath->findvalue('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode/@Value'), - sub_status => $xpath->findvalue('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode/samlp:StatusCode/@Value'), + substatus => $xpath->findvalue('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode/samlp:StatusCode/@Value'), ); return $self; diff --git a/t/29-response.t b/t/29-response.t index 9fe77d8..5916a61 100644 --- a/t/29-response.t +++ b/t/29-response.t @@ -18,7 +18,7 @@ sub get_object { ok(!$response->has_assertions, "We don't have an assertion"); ok(!$response->success, "Unsuccessful response"); is($response->status, STATUS_RESPONDER(), "... because its a status:Responder"); - is($response->sub_status, STATUS_AUTH_FAILED(), "... and substatus is also correct"); + is($response->substatus, STATUS_AUTH_FAILED(), "... and substatus is also correct"); }