Skip to content

Commit

Permalink
Add assertion to ensure binding matches idpdisco-specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Oct 18, 2023
1 parent 0e47e15 commit af61761
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SAML2/XML/idpdisc/DiscoveryResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Constants as C;
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
use SimpleSAML\SAML2\XML\md\AbstractIndexedEndpointType;

/**
Expand Down Expand Up @@ -48,10 +49,11 @@ public function __construct(
array $attributes = [],
array $children = [],
) {
Assert::same($binding, C::BINDING_IDPDISC, ProtocolViolationException::class);
Assert::null(
$unused,
'The \'ResponseLocation\' attribute must be omitted for idpdisc:DiscoveryResponse.',
);
parent::__construct($index, $binding, $location, $isDefault, null, $attributes, $children);
parent::__construct($index, C::BINDING_IDPDISC, $location, $isDefault, null, $attributes, $children);
}
}

0 comments on commit af61761

Please sign in to comment.