File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,6 +237,11 @@ public function getTrustMarks(): ?TrustMarksClaimBag
237237 throw new EntityStatementException ('Invalid Trust Marks claim. ' );
238238 }
239239
240+ // It MUST NOT be present in Subordinate Statements.
241+ if (!$ this ->isConfiguration ()) {
242+ throw new EntityStatementException ('Trust Marks claim encountered in configuration statement. ' );
243+ }
244+
240245 $ trustMarkClaimBag = $ this ->claimFactory ->forFederation ()->buildTrustMarksClaimBag ();
241246
242247 while (is_array ($ trustMarkClaimData = array_pop ($ trustMarksClaims ))) {
Original file line number Diff line number Diff line change @@ -216,8 +216,9 @@ public function testIsNotConfiguration(): void
216216 $ this ->signatureMock ->method ('getProtectedHeader ' )->willReturn ($ this ->sampleHeader );
217217 $ payload = $ this ->validPayload ;
218218 $ payload ['iss ' ] = 'something-else ' ;
219- // Authority hints should not be present if not configuration.
219+ // Authority hints, trust marks should not be present if not configuration.
220220 unset($ payload ['authority_hints ' ]);
221+ unset($ payload ['trust_marks ' ]);
221222 $ this ->jsonHelperMock ->method ('decode ' )->willReturn ($ payload );
222223
223224 $ this ->assertFalse ($ this ->sut ()->isConfiguration ());
@@ -525,6 +526,7 @@ public function testCanGetMetadataPolicyClaim(): void
525526 $ payload = $ this ->validPayload ;
526527 $ payload ['sub ' ] = 'something-else ' ;
527528 unset($ payload ['authority_hints ' ]);
529+ unset($ payload ['trust_marks ' ]);
528530 $ payload ['metadata_policy ' ] = [
529531 'openid_relying_party ' => [
530532 'contacts ' => [
You can’t perform that action at this time.
0 commit comments