Skip to content

Commit a6b2764

Browse files
committed
Back to the two failures that were there before
The presence of a "Default binding" on the below page would seem to indicate that if the binding is not present in the Array of arrays then it will be set to the default: https://github.com/simplesamlphp/simplesamlphp/blob/simplesamlphp-2.2/docs/simplesamlphp-metadata-endpoints.md The test suite was expecting to be able to do this, though it was also using the old direct single string representation. It probably makes sense if we are moving to on the the array of arrays syntax to either not show a default on the simplesamlphp-metadata-endpoints page or to use the default if the binding is not explicitly supplied.
1 parent c57f61f commit a6b2764

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/SimpleSAML/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ public function getEndpoints(string $endpointType): array
12301230
}
12311231

12321232
if (!array_key_exists('Binding', $ep)) {
1233-
throw new Exception($iloc . ': Missing Binding.');
1233+
$ep['Binding'] = $this->getDefaultBinding($endpointType);
12341234
}
12351235
if (!is_string($ep['Binding'])) {
12361236
throw new Exception($iloc . ': Binding must be a string.');

tests/src/SimpleSAML/ConfigurationTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,10 @@ public function testGetDefaultEndpoint(): void
827827
'ArtifactResolutionService' =>
828828
[[
829829
'Location' => 'https://example.com/ars',
830-
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP',
831830
]],
832831
'SingleSignOnService' =>
833832
[[
834833
'Location' => 'https://example.com/sso',
835-
'Binding' => Constants::BINDING_HTTP_REDIRECT,
836834
]],
837835
'SingleLogoutService' => [[
838836
'Location' => 'https://example.com/slo',
@@ -890,7 +888,7 @@ public function testGetDefaultEndpoint(): void
890888
$a['metadata-set'] = 'foo';
891889
$c = Configuration::loadFromArray($a);
892890
try {
893-
$c->getDefaultEndpoint('SingleSignOnService');
891+
$v = $c->getDefaultEndpoint('SingleSignOnService');
894892
$this->fail('No valid metadata set specified.');
895893
} catch (Exception $e) {
896894
$this->assertStringStartsWith('Missing default binding for', $e->getMessage());

0 commit comments

Comments
 (0)