Skip to content

Commit 9543a32

Browse files
committed
Fix metadata generation for indexed endpoints with isDefault set (#2439)
* Fix metadata generation for indexed endpoints with isDefault set * Add note to docs
1 parent 486b534 commit 9543a32

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

docs/simplesamlphp-changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ See the [upgrade notes](https://simplesamlphp.org/docs/stable/simplesamlphp-upgr
99

1010
Released TBD
1111

12+
* Fixed a bug where metadata-endpoints with isDefault set would not yield the expected metadata (#2439)
1213
* Downgrade simplesamlphp/composer-module-installer to 1.3.x to keep things working with older (OS-supplied)
1314
versions of composer
1415
* Fixed one more PHP 8.4 deprecation notice

docs/simplesamlphp-metadata-endpoints.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Endpoint | Indexed | Default binding
1212
`SingleLogoutService` | N | HTTP-Redirect
1313
`SingleSignOnService` | N | HTTP-Redirect
1414

15+
Note that `isDefault` is only available for indexed endpoints.
16+
1517
The various endpoints can be specified in the following format:
1618

1719
'AssertionConsumerService' => [

src/SimpleSAML/Metadata/SAMLBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ private static function createEndpoints(array $endpoints, bool $indexed): array
347347
foreach ($endpoints as &$ep) {
348348
if ($indexed) {
349349
$t = new IndexedEndpointType();
350+
351+
if (isset($ep['isDefault'])) {
352+
$t->setIsDefault($ep['isDefault']);
353+
}
354+
350355
if (!isset($ep['index'])) {
351356
// Find the maximum index
352357
$maxIndex = -1;

0 commit comments

Comments
 (0)