Skip to content

Commit

Permalink
Assert the validness of generate_sp_desciptor_id
Browse files Browse the repository at this point in the history
In cases where a consumer may override this option we don't assert the
value. This could cause potential issues.

Signed-off-by: Wesley Schwengle <waterkip@cpan.org>
  • Loading branch information
waterkip committed Feb 13, 2024
1 parent b8a297a commit 0def45a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Net/SAML2/SP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use Net::SAML2::Protocol::LogoutRequest;
use Net::SAML2::Util ();
use URN::OASIS::SAML2 qw(:bindings :urn);
use XML::Generator;
use Net::SAML2::Types qw(XsdID);

# ABSTRACT: SAML Service Provider object

Expand Down Expand Up @@ -569,11 +570,14 @@ sub generate_metadata {
$error_uri = $self->url . $self->error_url;
}

my $id = $self->generate_sp_desciptor_id();
XsdID->assert_valid($id);

return $x->xml( $x->EntityDescriptor(
$md,
{
entityID => $self->id,
ID => $self->generate_sp_desciptor_id(),
ID => $id,
},
$x->SPSSODescriptor(
$md,
Expand Down

0 comments on commit 0def45a

Please sign in to comment.