Skip to content

Commit 796e0de

Browse files
committed
Ensure that trust_mark_owners claim is not possible in subordinate statements
1 parent ff3d2d6 commit 796e0de

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/src/Federation/EntityStatementTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,26 @@ public function testTrustMarkOwnersIsBuildUsingFactoryOptional(): void
380380
}
381381

382382

383+
public function testTrustMarkOwnersClaimIsAllowedInConfigurationStatementOnly(): void
384+
{
385+
$this->validPayload['trust_mark_owners'] = [
386+
'trustMarkType' => [
387+
'sub' => 'subject',
388+
'jwks' => ['keys' => [['key' => 'value']]],
389+
],
390+
];
391+
$this->validPayload['iss'] = 'something-else';
392+
393+
$this->expectException(JwsException::class);
394+
$this->expectExceptionMessage('non-configuration');
395+
396+
$this->signatureMock->method('getProtectedHeader')->willReturn($this->sampleHeader);
397+
$this->jsonHelperMock->method('decode')->willReturn($this->validPayload);
398+
399+
$this->sut()->getTrustMarkOwners();
400+
}
401+
402+
383403
public function testTrustMarkIssuersIsBuildUsingFactoryOptional(): void
384404
{
385405
$this->validPayload['trust_mark_issuers'] = [

0 commit comments

Comments
 (0)