Skip to content

Commit 7f2d386

Browse files
authored
Merge branch 'master' into feature/xsd-types
2 parents 3a0abe2 + 616ba16 commit 7f2d386

File tree

12 files changed

+79
-15
lines changed

12 files changed

+79
-15
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: [ubuntu-latest]
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323

2424
- name: Lint markdown files
2525
uses: nosborn/github-action-markdown-cli@v3

.github/workflows/interoperability.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
git config --global core.autocrlf false
4848
git config --global core.eol lf
4949
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v5
5151

5252
- name: Cache composer dependencies
5353
uses: actions/cache@v4

.github/workflows/php.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
php-version: ['8.1', '8.2', '8.3', '8.4']
2323

24-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.9.2
24+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.0
2525
with:
2626
php-version: ${{ matrix.php-version }}
2727

@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232

33-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.9.2
33+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.0
3434
with:
3535
enable_eslinter: false
3636
enable_jsonlinter: true
@@ -69,7 +69,7 @@ jobs:
6969
git config --global core.autocrlf false
7070
git config --global core.eol lf
7171
72-
- uses: actions/checkout@v4
72+
- uses: actions/checkout@v5
7373

7474
- name: Get composer cache directory
7575
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
@@ -131,7 +131,7 @@ jobs:
131131
git config --global core.autocrlf false
132132
git config --global core.eol lf
133133
134-
- uses: actions/checkout@v4
134+
- uses: actions/checkout@v5
135135

136136
- name: Get composer cache directory
137137
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
@@ -168,7 +168,7 @@ jobs:
168168
- name: Setup problem matchers for PHP
169169
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
170170

171-
- uses: actions/checkout@v4
171+
- uses: actions/checkout@v5
172172

173173
- name: Get composer cache directory
174174
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
@@ -220,7 +220,7 @@ jobs:
220220
- name: Setup problem matchers for PHP
221221
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
222222

223-
- uses: actions/checkout@v4
223+
- uses: actions/checkout@v5
224224

225225
- name: Get composer cache directory
226226
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
@@ -249,9 +249,9 @@ jobs:
249249
runs-on: [ubuntu-latest]
250250
needs: [unit-tests-linux]
251251
steps:
252-
- uses: actions/checkout@v4
252+
- uses: actions/checkout@v5
253253

254-
- uses: actions/download-artifact@v4
254+
- uses: actions/download-artifact@v5
255255
with:
256256
name: coverage-data
257257
path: ${{ github.workspace }}/build

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"beste/clock": "~3.0.0",
4242
"mockery/mockery": "~1.6.12",
4343
"simplesamlphp/simplesamlphp-test-framework": "~1.9.3"
44+
"simplesamlphp/simplesamlphp-test-framework": "~1.9.2"
4445
},
4546
"suggest": {
4647
"ext-soap": "*"

src/Constants.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ class Constants extends \SimpleSAML\XMLSecurity\Constants
3636
*/
3737
public const ATTR_SUBJECT_ID = 'urn:oasis:names:tc:SAML:attribute:subject-id';
3838

39+
/**
40+
* Subject signal attribute
41+
*/
42+
public const PROFILE_SUBJECT_ID_REQ = 'urn:oasis:names:tc:SAML:profiles:subject-id:req';
43+
3944
/**
4045
* The URN for the Holder-of-Key Web Browser SSO Profile binding
4146
*/

src/XML/SignedElementTrait.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use SimpleSAML\SAML2\Assert\Assert;
88
use SimpleSAML\SAML2\Compat\ContainerSingleton;
9+
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
910
use SimpleSAML\XMLSecurity\Exception\ReferenceValidationFailedException;
1011
use SimpleSAML\XMLSecurity\XML\ds\Signature;
1112
use SimpleSAML\XMLSecurity\XML\SignedElementTrait as BaseSignedElementTrait;
@@ -45,6 +46,18 @@ protected function setSignature(Signature $signature): void
4546
ReferenceValidationFailedException::class,
4647
);
4748

49+
/**
50+
* E91: Disallow <ds:Object> element in signatures
51+
*
52+
* The <ds:Object> element is not defined for use with SAML signatures, and SHOULD NOT be present.
53+
*/
54+
55+
Assert::isEmpty(
56+
$signature->getObjects(),
57+
ProtocolViolationException::class,
58+
'The <ds:Object> element is not defined for use with SAML signatures, and SHOULD NOT be present.',
59+
);
60+
4861
$this->signature = $signature;
4962
}
5063

src/XML/md/SPSSODescriptor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ public function __construct(
9595
'All md:AttributeConsumingService endpoints must be an instance of AttributeConsumingService.',
9696
);
9797

98-
// test that only one ACS is marked as default
98+
/**
99+
* E87: test that only one ACS is marked as default
100+
*/
99101
Assert::maxCount(
100102
array_filter(
101103
$attributeConsumingService,
@@ -104,7 +106,7 @@ function (AttributeConsumingService $acs) {
104106
},
105107
),
106108
1,
107-
'Only one md:AttributeConsumingService can be set as default.',
109+
'At most one <AttributeConsumingService> element can have the attribute isDefault set to true.',
108110
);
109111
}
110112

src/XML/subjectid/SignalEnum.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SimpleSAML\SAML2\XML\subjectid;
6+
7+
enum SignalEnum: string
8+
{
9+
/**
10+
* The value MUST be one of the following, signaling the corresponding requirement:
11+
*/
12+
13+
/**
14+
* The relying party requires the standard identifier Attribute defined in Section 3.3.
15+
*
16+
* - subject-id
17+
*/
18+
case SUBJECT_ID = 'subject-id';
19+
20+
/**
21+
* The relying party requires the pair-wise identifier Attribute defined in Section 3.4.
22+
*
23+
* - pairwise-id
24+
*/
25+
case PAIRWISE_ID = 'pairwise-id';
26+
27+
/**
28+
* The relying party does not require any subject identifier and is designed to operate without a
29+
* specific user identity (e.g., with authorization based on non-identifying data).
30+
*
31+
* - none
32+
*/
33+
case NONE = 'none';
34+
35+
/**
36+
* The relying party will accept any of the identifier Attributes defined in this profile but requires at least one.
37+
*
38+
* - any
39+
*/
40+
case ANY = 'any';
41+
}

tests/SAML2/XML/ElementRegistryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class ElementRegistryTest extends TestCase
2323
*/
2424
public function testElementRegistry(): void
2525
{
26-
$elementRegistry = dirname(__FILE__, 4) . '/src/XML/element.registry.php';
26+
$elementRegistry = dirname(__FILE__, 4) . '/classes/element.registry.php';
2727
$namespaces = include($elementRegistry);
2828

2929
foreach ($namespaces as $namespaceURI => $elements) {

0 commit comments

Comments
 (0)