Skip to content

Commit 120d1ce

Browse files
committed
Update to reflect upstream changes to the SOAP-lib
1 parent a4f4cfa commit 120d1ce

12 files changed

Lines changed: 116 additions & 183 deletions

phpstan-baseline.neon

Lines changed: 77 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,209 +3,244 @@ parameters:
33
-
44
message: "#^Call to static method addSign\\(\\) on an unknown class SimpleSAML\\\\Module\\\\saml\\\\Message\\.$#"
55
count: 1
6-
path: src/SAML2/Binding/HTTPArtifact.php
6+
path: src/Binding/HTTPArtifact.php
77

88
-
99
message: "#^Call to static method getInstance\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
1010
count: 2
11-
path: src/SAML2/Binding/HTTPArtifact.php
11+
path: src/Binding/HTTPArtifact.php
1212

1313
-
1414
message: "#^Call to static method getInstance\\(\\) on an unknown class SimpleSAML\\\\Store\\\\StoreFactory\\.$#"
1515
count: 1
16-
path: src/SAML2/Binding/HTTPArtifact.php
16+
path: src/Binding/HTTPArtifact.php
1717

1818
-
1919
message: "#^Call to static method getMetadataHandler\\(\\) on an unknown class SimpleSAML\\\\Metadata\\\\MetaDataStorageHandler\\.$#"
2020
count: 1
21-
path: src/SAML2/Binding/HTTPArtifact.php
21+
path: src/Binding/HTTPArtifact.php
2222

2323
-
2424
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\HTTP not found\\.$#"
2525
count: 1
26-
path: src/SAML2/Binding/HTTPArtifact.php
26+
path: src/Binding/HTTPArtifact.php
2727

2828
-
2929
message: "#^Parameter \\$key of method SimpleSAML\\\\SAML2\\\\Binding\\\\HTTPArtifact\\:\\:validateSignature\\(\\) has invalid type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
3030
count: 1
31-
path: src/SAML2/Binding/HTTPArtifact.php
31+
path: src/Binding/HTTPArtifact.php
3232

3333
-
3434
message: "#^Parameter \\$sp of method SimpleSAML\\\\SAML2\\\\Binding\\\\HTTPArtifact\\:\\:setSPMetadata\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
3535
count: 1
36-
path: src/SAML2/Binding/HTTPArtifact.php
36+
path: src/Binding/HTTPArtifact.php
3737

3838
-
3939
message: "#^Property SimpleSAML\\\\SAML2\\\\Binding\\\\HTTPArtifact\\:\\:\\$spMetadata has unknown class SimpleSAML\\\\Configuration as its type\\.$#"
4040
count: 1
41-
path: src/SAML2/Binding/HTTPArtifact.php
41+
path: src/Binding/HTTPArtifact.php
4242

4343
-
4444
message: "#^Access to constant AES128_CBC on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
4545
count: 1
46-
path: src/SAML2/Certificate/PrivateKeyLoader.php
46+
path: src/Certificate/PrivateKeyLoader.php
4747

4848
-
4949
message: "#^Access to constant RSA_1_5 on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
5050
count: 1
51-
path: src/SAML2/Certificate/PrivateKeyLoader.php
51+
path: src/Certificate/PrivateKeyLoader.php
5252

5353
-
5454
message: "#^Instantiated class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey not found\\.$#"
5555
count: 2
56-
path: src/SAML2/Certificate/PrivateKeyLoader.php
56+
path: src/Certificate/PrivateKeyLoader.php
5757

5858
-
5959
message: "#^Method SimpleSAML\\\\SAML2\\\\Certificate\\\\PrivateKeyLoader\\:\\:convertPrivateKeyToRsaKey\\(\\) has invalid return type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
6060
count: 1
61-
path: src/SAML2/Certificate/PrivateKeyLoader.php
61+
path: src/Certificate/PrivateKeyLoader.php
6262

6363
-
6464
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:convertToIdentityProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
6565
count: 1
66-
path: src/SAML2/Configuration/SimpleSAMLConverter.php
66+
path: src/Configuration/SimpleSAMLConverter.php
6767

6868
-
6969
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:convertToServiceProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
7070
count: 1
71-
path: src/SAML2/Configuration/SimpleSAMLConverter.php
71+
path: src/Configuration/SimpleSAMLConverter.php
7272

7373
-
7474
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:enrichForDecryptionProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
7575
count: 1
76-
path: src/SAML2/Configuration/SimpleSAMLConverter.php
76+
path: src/Configuration/SimpleSAMLConverter.php
7777

7878
-
7979
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:enrichForIdentityProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
8080
count: 1
81-
path: src/SAML2/Configuration/SimpleSAMLConverter.php
81+
path: src/Configuration/SimpleSAMLConverter.php
8282

8383
-
8484
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:enrichForServiceProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
8585
count: 1
86-
path: src/SAML2/Configuration/SimpleSAMLConverter.php
86+
path: src/Configuration/SimpleSAMLConverter.php
8787

8888
-
8989
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:pluckConfiguration\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
9090
count: 1
91-
path: src/SAML2/Configuration/SimpleSAMLConverter.php
91+
path: src/Configuration/SimpleSAMLConverter.php
92+
93+
-
94+
message: "#^Call to static method fromXML\\(\\) on an unknown class SimpleSAML\\\\SOAP11\\\\XML\\\\env\\\\Envelope\\.$#"
95+
count: 1
96+
path: src/SOAPClient.php
97+
98+
-
99+
message: "#^Call to static method fromXML\\(\\) on an unknown class SimpleSAML\\\\SOAP11\\\\XML\\\\env\\\\Fault\\.$#"
100+
count: 1
101+
path: src/SOAPClient.php
102+
103+
-
104+
message: "#^Call to static method getXPath\\(\\) on an unknown class SimpleSAML\\\\SOAP11\\\\Utils\\\\XPath\\.$#"
105+
count: 1
106+
path: src/SOAPClient.php
107+
108+
-
109+
message: "#^Call to static method xpQuery\\(\\) on an unknown class SimpleSAML\\\\SOAP11\\\\Utils\\\\XPath\\.$#"
110+
count: 1
111+
path: src/SOAPClient.php
112+
113+
-
114+
message: "#^Instantiated class SimpleSAML\\\\SOAP11\\\\XML\\\\env\\\\Body not found\\.$#"
115+
count: 1
116+
path: src/SOAPClient.php
117+
118+
-
119+
message: "#^Instantiated class SimpleSAML\\\\SOAP11\\\\XML\\\\env\\\\Envelope not found\\.$#"
120+
count: 1
121+
path: src/SOAPClient.php
92122

93123
-
94124
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\Config not found\\.$#"
95125
count: 1
96-
path: src/SAML2/SOAPClient.php
126+
path: src/SOAPClient.php
97127

98128
-
99129
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\Crypto not found\\.$#"
100130
count: 1
101-
path: src/SAML2/SOAPClient.php
131+
path: src/SOAPClient.php
132+
133+
-
134+
message: "#^Method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:getSOAPFault\\(\\) has invalid return type SimpleSAML\\\\SOAP11\\\\XML\\\\env\\\\Fault\\.$#"
135+
count: 1
136+
path: src/SOAPClient.php
102137

103138
-
104139
message: "#^Parameter \\$dstMetadata of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:send\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
105140
count: 1
106-
path: src/SAML2/SOAPClient.php
141+
path: src/SOAPClient.php
107142

108143
-
109144
message: "#^Parameter \\$key of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:validateSSL\\(\\) has invalid type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
110145
count: 1
111-
path: src/SAML2/SOAPClient.php
146+
path: src/SOAPClient.php
112147

113148
-
114149
message: "#^Parameter \\$srcMetadata of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:send\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
115150
count: 1
116-
path: src/SAML2/SOAPClient.php
151+
path: src/SOAPClient.php
117152

118153
-
119154
message: "#^Unsafe usage of new static\\(\\)\\.$#"
120155
count: 2
121-
path: src/SAML2/XML/md/AbstractEndpointType.php
156+
path: src/XML/md/AbstractEndpointType.php
122157

123158
-
124159
message: "#^Unsafe usage of new static\\(\\)\\.$#"
125160
count: 2
126-
path: src/SAML2/XML/md/AbstractIndexedEndpointType.php
161+
path: src/XML/md/AbstractIndexedEndpointType.php
127162

128163
-
129164
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor\\)\\:\\:XSI_TYPE_NAME\\.$#"
130165
count: 2
131-
path: src/SAML2/XML/md/AbstractRoleDescriptor.php
166+
path: src/XML/md/AbstractRoleDescriptor.php
132167

133168
-
134169
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
135170
count: 2
136-
path: src/SAML2/XML/md/AbstractRoleDescriptor.php
171+
path: src/XML/md/AbstractRoleDescriptor.php
137172

138173
-
139174
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
140175
count: 2
141-
path: src/SAML2/XML/md/AbstractRoleDescriptor.php
176+
path: src/XML/md/AbstractRoleDescriptor.php
142177

143178
-
144179
message: "#^Call to an undefined static method SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractSignedMdElement\\:\\:getXsiTypeNamespaceURI\\(\\)\\.$#"
145180
count: 1
146-
path: src/SAML2/XML/md/AbstractSignedMdElement.php
181+
path: src/XML/md/AbstractSignedMdElement.php
147182

148183
-
149184
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractBaseID\\)\\:\\:XSI_TYPE_NAME\\.$#"
150185
count: 2
151-
path: src/SAML2/XML/saml/AbstractBaseID.php
186+
path: src/XML/saml/AbstractBaseID.php
152187

153188
-
154189
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractBaseID\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
155190
count: 2
156-
path: src/SAML2/XML/saml/AbstractBaseID.php
191+
path: src/XML/saml/AbstractBaseID.php
157192

158193
-
159194
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractBaseID\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
160195
count: 2
161-
path: src/SAML2/XML/saml/AbstractBaseID.php
196+
path: src/XML/saml/AbstractBaseID.php
162197

163198
-
164199
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractCondition\\)\\:\\:XSI_TYPE_NAME\\.$#"
165200
count: 2
166-
path: src/SAML2/XML/saml/AbstractCondition.php
201+
path: src/XML/saml/AbstractCondition.php
167202

168203
-
169204
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractCondition\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
170205
count: 2
171-
path: src/SAML2/XML/saml/AbstractCondition.php
206+
path: src/XML/saml/AbstractCondition.php
172207

173208
-
174209
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractCondition\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
175210
count: 2
176-
path: src/SAML2/XML/saml/AbstractCondition.php
211+
path: src/XML/saml/AbstractCondition.php
177212

178213
-
179214
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractStatement\\)\\:\\:XSI_TYPE_NAME\\.$#"
180215
count: 2
181-
path: src/SAML2/XML/saml/AbstractStatement.php
216+
path: src/XML/saml/AbstractStatement.php
182217

183218
-
184219
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractStatement\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
185220
count: 2
186-
path: src/SAML2/XML/saml/AbstractStatement.php
221+
path: src/XML/saml/AbstractStatement.php
187222

188223
-
189224
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractStatement\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
190225
count: 2
191-
path: src/SAML2/XML/saml/AbstractStatement.php
226+
path: src/XML/saml/AbstractStatement.php
192227

193228
-
194229
message: "#^Unsafe usage of new static\\(\\)\\.$#"
195230
count: 1
196-
path: src/SAML2/XML/saml/Attribute.php
231+
path: src/XML/saml/Attribute.php
197232

198233
-
199234
message: "#^Unsafe usage of new static\\(\\)\\.$#"
200235
count: 1
201-
path: src/SAML2/XML/saml/EncryptedAttribute.php
236+
path: src/XML/saml/EncryptedAttribute.php
202237

203238
-
204239
message: "#^Unsafe usage of new static\\(\\)\\.$#"
205240
count: 1
206-
path: src/SAML2/XML/saml/EncryptedID.php
241+
path: src/XML/saml/EncryptedID.php
207242

208243
-
209244
message: "#^Unsafe usage of new static\\(\\)\\.$#"
210245
count: 1
211-
path: src/SAML2/XML/saml/NameIDType.php
246+
path: src/XML/saml/NameIDType.php

src/Binding/SOAP.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
1717
use SimpleSAML\SAML2\XML\samlp\MessageFactory;
1818
use SimpleSAML\SAML2\XML\samlp\Response as SAML2_Response;
19-
use SimpleSAML\SOAP11\Utils\XPath;
20-
use SimpleSAML\SOAP11\XML\env\Body;
21-
use SimpleSAML\SOAP11\XML\env\Envelope;
22-
use SimpleSAML\SOAP11\XML\env\Header;
19+
use SimpleSAML\SOAP\Utils\XPath;
20+
use SimpleSAML\SOAP\XML\env_200106\Body;
21+
use SimpleSAML\SOAP\XML\env_200106\Envelope;
22+
use SimpleSAML\SOAP\XML\env_200106\Header;
2323
use SimpleSAML\XML\DOMDocumentFactory;
2424

2525
use function file_get_contents;
@@ -100,7 +100,7 @@ public function receive(/** @scrutinizer ignore-unused */ServerRequestInterface
100100

101101
$xpCache = XPath::getXPath($document->documentElement);
102102
/** @var \DOMElement[] $results */
103-
$results = XPath::xpQuery($xml, '/env:Envelope/env:Body/*[1]', $xpCache);
103+
$results = XPath::xpQuery($xml, '/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]', $xpCache);
104104

105105
return MessageFactory::fromXML($results[0]);
106106
}

src/XML/alg/DigestMethod.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use DOMElement;
88
use SimpleSAML\Assert\Assert;
99
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
10-
use SimpleSAML\XML\Chunk;
1110
use SimpleSAML\XML\Exception\InvalidDOMElementException;
1211
use SimpleSAML\XML\ExtendableElementTrait;
1312
use SimpleSAML\XML\XsNamespace as NS;
@@ -68,18 +67,10 @@ public static function fromXML(DOMElement $xml): static
6867
Assert::same($xml->localName, 'DigestMethod', InvalidDOMElementException::class);
6968
Assert::same($xml->namespaceURI, DigestMethod::NS, InvalidDOMElementException::class);
7069

71-
$Algorithm = self::getAttribute($xml, 'Algorithm');
72-
73-
$elements = [];
74-
foreach ($xml->childNodes as $element) {
75-
if (!($element instanceof DOMElement)) {
76-
continue;
77-
}
78-
79-
$elements[] = new Chunk($element);
80-
}
81-
82-
return new static($Algorithm, $elements);
70+
return new static(
71+
self::getAttribute($xml, 'Algorithm'),
72+
self::getChildElementsFromXML($xml),
73+
);
8374
}
8475

8576

src/XML/alg/SigningMethod.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use DOMElement;
88
use SimpleSAML\Assert\Assert;
99
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
10-
use SimpleSAML\XML\Chunk;
1110
use SimpleSAML\XML\Exception\InvalidDOMElementException;
1211
use SimpleSAML\XML\ExtendableElementTrait;
1312
use SimpleSAML\XML\XsNamespace as NS;
@@ -99,20 +98,12 @@ public static function fromXML(DOMElement $xml): static
9998
Assert::same($xml->localName, 'SigningMethod', InvalidDOMElementException::class);
10099
Assert::same($xml->namespaceURI, SigningMethod::NS, InvalidDOMElementException::class);
101100

102-
$Algorithm = self::getAttribute($xml, 'Algorithm');
103-
$MinKeySize = self::getOptionalIntegerAttribute($xml, 'MinKeySize', null);
104-
$MaxKeySize = self::getOptionalIntegerAttribute($xml, 'MaxKeySize', null);
105-
106-
$elements = [];
107-
foreach ($xml->childNodes as $element) {
108-
if (!($element instanceof DOMElement)) {
109-
continue;
110-
}
111-
112-
$elements[] = new Chunk($element);
113-
}
114-
115-
return new static($Algorithm, $MinKeySize, $MaxKeySize, $elements);
101+
return new static(
102+
self::getAttribute($xml, 'Algorithm'),
103+
self::getOptionalIntegerAttribute($xml, 'MinKeySize', null),
104+
self::getOptionalIntegerAttribute($xml, 'MaxKeySize', null),
105+
self::getChildElementsFromXML($xml),
106+
);
116107
}
117108

118109

0 commit comments

Comments
 (0)