|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace SimpleSAML\WSSecurity\XML\fed; |
|
6
|
|
|
|
|
7
|
|
|
use DateTimeImmutable; |
|
8
|
|
|
use DOMElement; |
|
9
|
|
|
use SimpleSAML\Assert\Assert; |
|
10
|
|
|
use SimpleSAML\SAML2\XML\md\Extensions; |
|
11
|
|
|
use SimpleSAML\SAML2\XML\md\Organization; |
|
12
|
|
|
use SimpleSAML\XML\Exception\MissingElementException; |
|
13
|
|
|
use SimpleSAML\XML\Exception\SchemaViolationException; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* A SecurityTokenServiceType |
|
17
|
|
|
* |
|
18
|
|
|
* @package simplesamlphp/ws-security |
|
19
|
|
|
*/ |
|
20
|
|
|
abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescriptorType |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* SecurityTokenServiceType constructor. |
|
24
|
|
|
* |
|
25
|
|
|
* @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. |
|
26
|
|
|
* @param string|null $ID The ID for this document. Defaults to null. |
|
27
|
|
|
* @param \DateTimeImmutable|null $validUntil Unix time of validity for this document. Defaults to null. |
|
28
|
|
|
* @param string|null $cacheDuration Maximum time this document can be cached. Defaults to null. |
|
29
|
|
|
* @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. |
|
30
|
|
|
* @param string|null $errorURL An URI where to redirect users for support. Defaults to null. |
|
31
|
|
|
* @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptors An array of KeyDescriptor elements. |
|
32
|
|
|
* Defaults to an empty array. |
|
33
|
|
|
* @param \SimpleSAML\SAML2\XML\md\Organization|null $organization |
|
34
|
|
|
* The organization running this entity. Defaults to null. |
|
35
|
|
|
* @param \SimpleSAML\SAML2\XML\md\ContactPerson[] $contacts An array of contacts for this entity. |
|
36
|
|
|
* Defaults to an empty array. |
|
37
|
|
|
* @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes |
|
|
|
|
|
|
38
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\LogicalServiceNamesOffered|null $logicalServiceNamesOffered |
|
39
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\TokenTypesOffered|null $tokenTypesOffered |
|
40
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\ClaimDialectsOffered|null $claimDialectsOffered |
|
41
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesOffered|null $claimTypesOffered |
|
42
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesRequested|null $claimTypesRequested |
|
43
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\AutomaticPseudonyms|null $automaticPseudonyms |
|
44
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes |
|
45
|
|
|
* @param string|null $serviceDisplayName |
|
46
|
|
|
* @param string|null $serviceDescription |
|
47
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\SecurityTokenServiceEndpoint[] $securityTokenServiceEndpoint |
|
48
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutSubscriptionEndpoint[] $singleSignOutSubscriptionEndpoint |
|
49
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint |
|
50
|
|
|
* @param \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] $passiveRequestorEndpoint |
|
51
|
|
|
*/ |
|
52
|
|
|
final public function __construct( |
|
53
|
|
|
array $protocolSupportEnumeration, |
|
54
|
|
|
?string $ID = null, |
|
55
|
|
|
?DateTimeImmutable $validUntil = null, |
|
56
|
|
|
?string $cacheDuration = null, |
|
57
|
|
|
?Extensions $extensions = null, |
|
58
|
|
|
?string $errorURL = null, |
|
59
|
|
|
array $keyDescriptors = [], |
|
60
|
|
|
?Organization $organization = null, |
|
61
|
|
|
array $contacts = [], |
|
62
|
|
|
array $namespacedAttributes = [], |
|
63
|
|
|
?LogicalServiceNamesOffered $logicalServiceNamesOffered = null, |
|
64
|
|
|
?TokenTypesOffered $tokenTypesOffered = null, |
|
65
|
|
|
?ClaimDialectsOffered $claimDialectsOffered = null, |
|
66
|
|
|
?ClaimTypesOffered $claimTypesOffered = null, |
|
67
|
|
|
?ClaimTypesRequested $claimTypesRequested = null, |
|
68
|
|
|
?AutomaticPseudonyms $automaticPseudonyms = null, |
|
69
|
|
|
?TargetScopes $targetScopes = null, |
|
70
|
|
|
?string $serviceDisplayName = null, |
|
71
|
|
|
?string $serviceDescription = null, |
|
72
|
|
|
protected array $securityTokenServiceEndpoint = [], |
|
73
|
|
|
protected array $singleSignOutSubscriptionEndpoint = [], |
|
74
|
|
|
protected array $singleSignOutNotificationEndpoint = [], |
|
75
|
|
|
protected array $passiveRequestorEndpoint = [], |
|
76
|
|
|
) { |
|
77
|
|
|
Assert::minCount($securityTokenServiceEndpoint, 1, MissingElementException::class); |
|
78
|
|
|
Assert::allIsInstanceOf( |
|
79
|
|
|
$securityTokenServiceEndpoint, |
|
80
|
|
|
SecurityTokenServiceEndpoint::class, |
|
81
|
|
|
SchemaViolationException::class, |
|
82
|
|
|
); |
|
83
|
|
|
Assert::allIsInstanceOf( |
|
84
|
|
|
$singleSignOutSubscriptionEndpoint, |
|
85
|
|
|
SingleSignOutSubscriptionEndpoint::class, |
|
86
|
|
|
SchemaViolationException::class, |
|
87
|
|
|
); |
|
88
|
|
|
Assert::allIsInstanceOf( |
|
89
|
|
|
$singleSignOutNotificationEndpoint, |
|
90
|
|
|
SingleSignOutNotificationEndpoint::class, |
|
91
|
|
|
SchemaViolationException::class, |
|
92
|
|
|
); |
|
93
|
|
|
Assert::allIsInstanceOf( |
|
94
|
|
|
$passiveRequestorEndpoint, |
|
95
|
|
|
PassiveRequestorEndpoint::class, |
|
96
|
|
|
SchemaViolationException::class, |
|
97
|
|
|
); |
|
98
|
|
|
|
|
99
|
|
|
parent::__construct( |
|
100
|
|
|
static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME, |
|
|
|
|
|
|
101
|
|
|
$protocolSupportEnumeration, |
|
102
|
|
|
$ID, |
|
103
|
|
|
$validUntil, |
|
104
|
|
|
$cacheDuration, |
|
105
|
|
|
$extensions, |
|
106
|
|
|
$errorURL, |
|
107
|
|
|
$keyDescriptors, |
|
108
|
|
|
$organization, |
|
109
|
|
|
$contacts, |
|
110
|
|
|
$namespacedAttributes, |
|
111
|
|
|
$logicalServiceNamesOffered, |
|
112
|
|
|
$tokenTypesOffered, |
|
113
|
|
|
$claimDialectsOffered, |
|
114
|
|
|
$claimTypesOffered, |
|
115
|
|
|
$claimTypesRequested, |
|
116
|
|
|
$automaticPseudonyms, |
|
117
|
|
|
$targetScopes, |
|
118
|
|
|
$serviceDisplayName, |
|
119
|
|
|
$serviceDescription, |
|
120
|
|
|
); |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* Collect the value of the securityTokenServiceEndpoint-property |
|
126
|
|
|
* |
|
127
|
|
|
* @return \SimpleSAML\WSSecurity\XML\fed\SecurityTokenServiceEndpoint[] |
|
128
|
|
|
*/ |
|
129
|
|
|
public function getSecurityTokenServiceEndpoint(): array |
|
130
|
|
|
{ |
|
131
|
|
|
return $this->securityTokenServiceEndpoint; |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* Collect the value of the singleSignOutSubscriptionEndpoint-property |
|
137
|
|
|
* |
|
138
|
|
|
* @return \SimpleSAML\WSSecurity\XML\fed\SingleSignOutSubscriptionEndpoint[] |
|
139
|
|
|
*/ |
|
140
|
|
|
public function getSingleSignOutSubscriptionEndpoint(): array |
|
141
|
|
|
{ |
|
142
|
|
|
return $this->singleSignOutSubscriptionEndpoint; |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* Collect the value of the singleSignOutNotificationtionEndpoint-property |
|
148
|
|
|
* |
|
149
|
|
|
* @return \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] |
|
150
|
|
|
*/ |
|
151
|
|
|
public function getSingleSignOutNotificationEndpoint(): array |
|
152
|
|
|
{ |
|
153
|
|
|
return $this->singleSignOutNotificationEndpoint; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* Collect the value of the passiveRequestorEndpoint-property |
|
159
|
|
|
* |
|
160
|
|
|
* @return \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] |
|
161
|
|
|
*/ |
|
162
|
|
|
public function getPassiveRequestorEndpoint(): array |
|
163
|
|
|
{ |
|
164
|
|
|
return $this->passiveRequestorEndpoint; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* Convert this element to XML. |
|
170
|
|
|
* |
|
171
|
|
|
* @param \DOMElement|null $parent The element we should append this element to. |
|
172
|
|
|
* @return \DOMElement |
|
173
|
|
|
*/ |
|
174
|
|
|
public function toUnsignedXML(?DOMElement $parent = null): DOMElement |
|
175
|
|
|
{ |
|
176
|
|
|
$e = parent::toUnsignedXML($parent); |
|
177
|
|
|
|
|
178
|
|
|
foreach ($this->getSecurityTokenServiceEndpoint() as $stse) { |
|
179
|
|
|
$stse->toXML($e); |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
foreach ($this->getSingleSignOutSubscriptionEndpoint() as $ssose) { |
|
183
|
|
|
$ssose->toXML($e); |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
foreach ($this->getSingleSignOutNotificationEndpoint() as $ssone) { |
|
187
|
|
|
$ssone->toXML($e); |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
foreach ($this->getPassiveRequestorEndpoint() as $pre) { |
|
191
|
|
|
$pre->toXML($e); |
|
192
|
|
|
} |
|
193
|
|
|
|
|
194
|
|
|
return $e; |
|
195
|
|
|
} |
|
196
|
|
|
} |
|
197
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths