Skip to content

Commit 6d0b2cf

Browse files
committed
Upgrade xml-ws libraries
1 parent e4d5ae2 commit 6d0b2cf

File tree

7 files changed

+248
-263
lines changed

7 files changed

+248
-263
lines changed

src/Controller/Adfs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use SimpleSAML\Module\adfs\IdP\PassiveIdP;
1616
use SimpleSAML\Module\adfs\MetadataExchange;
1717
use SimpleSAML\Session;
18-
use SimpleSAML\SOAP\XML\env_200305\Envelope;
18+
use SimpleSAML\SOAP12\XML\Envelope;
1919
use SimpleSAML\Utils;
2020
use SimpleSAML\XML\DOMDocumentFactory;
2121
use Symfony\Component\HttpFoundation\Request;

src/IdP/ADFS.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,36 @@
2929
use SimpleSAML\SAML11\XML\saml\Subject;
3030
use SimpleSAML\SAML11\XML\saml\SubjectConfirmation;
3131
use SimpleSAML\SAML2\Constants as SAML2_C;
32-
use SimpleSAML\SOAP\Constants as SOAP_C;
33-
use SimpleSAML\SOAP\XML\env_200305\Body;
34-
use SimpleSAML\SOAP\XML\env_200305\Envelope;
35-
use SimpleSAML\SOAP\XML\env_200305\Header;
32+
use SimpleSAML\SOAP12\Constants as SOAP_C;
33+
use SimpleSAML\SOAP12\XML\Body;
34+
use SimpleSAML\SOAP12\XML\Envelope;
35+
use SimpleSAML\SOAP12\XML\Header;
3636
use SimpleSAML\Utils;
37-
use SimpleSAML\WSSecurity\XML\wsa_200508\Action;
38-
use SimpleSAML\WSSecurity\XML\wsa_200508\Address;
39-
use SimpleSAML\WSSecurity\XML\wsa_200508\EndpointReference;
40-
use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID;
41-
use SimpleSAML\WSSecurity\XML\wsa_200508\RelatesTo;
42-
use SimpleSAML\WSSecurity\XML\wsa_200508\To;
43-
use SimpleSAML\WSSecurity\XML\wsp\AppliesTo;
44-
use SimpleSAML\WSSecurity\XML\wsse\KeyIdentifier;
45-
use SimpleSAML\WSSecurity\XML\wsse\Password;
46-
use SimpleSAML\WSSecurity\XML\wsse\Security;
47-
use SimpleSAML\WSSecurity\XML\wsse\SecurityTokenReference;
48-
use SimpleSAML\WSSecurity\XML\wsse\UsernameToken;
49-
use SimpleSAML\WSSecurity\XML\wst_200502\KeyType;
50-
use SimpleSAML\WSSecurity\XML\wst_200502\Lifetime;
51-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestedAttachedReference;
52-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestedSecurityToken;
53-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestedUnattachedReference;
54-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityToken;
55-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityTokenResponse;
56-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestType;
57-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestTypeEnum;
58-
use SimpleSAML\WSSecurity\XML\wst_200502\TokenType;
59-
use SimpleSAML\WSSecurity\XML\wsu\Created;
60-
use SimpleSAML\WSSecurity\XML\wsu\Expires;
61-
use SimpleSAML\WSSecurity\XML\wsu\Timestamp;
37+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\Action;
38+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\Address;
39+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\EndpointReference;
40+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\MessageID;
41+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\RelatesTo;
42+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\To;
43+
use SimpleSAML\WebServices\Policy\XML\wsp_200409\AppliesTo;
44+
use SimpleSAML\WebServices\Security\XML\wsse\KeyIdentifier;
45+
use SimpleSAML\WebServices\Security\XML\wsse\Password;
46+
use SimpleSAML\WebServices\Security\XML\wsse\Security;
47+
use SimpleSAML\WebServices\Security\XML\wsse\SecurityTokenReference;
48+
use SimpleSAML\WebServices\Security\XML\wsse\UsernameToken;
49+
use SimpleSAML\WebServices\Security\XML\wsu\Created;
50+
use SimpleSAML\WebServices\Security\XML\wsu\Expires;
51+
use SimpleSAML\WebServices\Security\XML\wsu\Timestamp;
52+
use SimpleSAML\WebServices\Trust\XML\wst_200502\KeyType;
53+
use SimpleSAML\WebServices\Trust\XML\wst_200502\Lifetime;
54+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestedAttachedReference;
55+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestedSecurityToken;
56+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestedUnattachedReference;
57+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestSecurityToken;
58+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestSecurityTokenResponse;
59+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestType;
60+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestTypeEnum;
61+
use SimpleSAML\WebServices\Trust\XML\wst_200502\TokenType;
6262
use SimpleSAML\XHTML\Template;
6363
use SimpleSAML\XML\Attribute as XMLAttribute;
6464
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmFactory;

src/IdP/MetadataBuilder.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use SimpleSAML\Configuration;
1212
use SimpleSAML\Logger;
1313
use SimpleSAML\Module;
14+
use SimpleSAML\SAML2\Constants as C_SAML2;
1415
use SimpleSAML\SAML2\Exception\ArrayValidationException;
1516
use SimpleSAML\SAML2\XML\md\AbstractMetadataDocument;
1617
use SimpleSAML\SAML2\XML\md\ContactPerson;
@@ -26,15 +27,17 @@
2627
use SimpleSAML\SAML2\XML\saml\AttributeValue;
2728
use SimpleSAML\SAML2\XML\shibmd\Scope;
2829
use SimpleSAML\Utils;
29-
use SimpleSAML\WSSecurity\Constants as C;
30-
use SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint;
31-
use SimpleSAML\WSSecurity\XML\fed\SecurityTokenServiceEndpoint;
32-
use SimpleSAML\WSSecurity\XML\fed\SecurityTokenServiceType;
33-
use SimpleSAML\WSSecurity\XML\fed\TokenType;
34-
use SimpleSAML\WSSecurity\XML\fed\TokenTypesOffered;
35-
use SimpleSAML\WSSecurity\XML\wsa_200508\Address;
36-
use SimpleSAML\WSSecurity\XML\wsa_200508\EndpointReference;
30+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\Address;
31+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\EndpointReference;
32+
use SimpleSAML\WebServices\Federation\Constants as C_FED;
33+
use SimpleSAML\WebServices\Federation\XML\fed\PassiveRequestorEndpoint;
34+
use SimpleSAML\WebServices\Federation\XML\fed\SecurityTokenServiceEndpoint;
35+
use SimpleSAML\WebServices\Federation\XML\fed\SecurityTokenServiceType;
36+
use SimpleSAML\WebServices\Federation\XML\fed\TokenType;
37+
use SimpleSAML\WebServices\Federation\XML\fed\TokenTypesOffered;
38+
use SimpleSAML\WebServices\Trust\Constants as C_TRUST;
3739
use SimpleSAML\XML\Chunk;
40+
use SimpleSAML\XMLSecurity\Constants as C_XMLSEC;
3841
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmFactory;
3942
use SimpleSAML\XMLSecurity\Key\PrivateKey;
4043
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
@@ -110,7 +113,7 @@ protected function signDocument(AbstractMetadataDocument $document): AbstractMet
110113
/** @var array<mixed> $keyArray */
111114
$keyArray = $cryptoUtils->loadPrivateKey($this->config, true, 'metadata.sign.');
112115
$certArray = $cryptoUtils->loadPublicKey($this->config, false, 'metadata.sign.');
113-
$algo = $this->config->getOptionalString('metadata.sign.algorithm', C::SIG_RSA_SHA256);
116+
$algo = $this->config->getOptionalString('metadata.sign.algorithm', C_XMLSEC::SIG_RSA_SHA256);
114117

115118
$key = PrivateKey::fromFile($keyArray['PEM'], $keyArray['password'] ?? '');
116119
$signer = (new SignatureAlgorithmFactory())->getAlgorithm($algo, $key);
@@ -124,7 +127,7 @@ protected function signDocument(AbstractMetadataDocument $document): AbstractMet
124127
]);
125128
}
126129

127-
$document->sign($signer, C::C14N_EXCLUSIVE_WITHOUT_COMMENTS, $keyInfo);
130+
$document->sign($signer, C_XMLSEC::C14N_EXCLUSIVE_WITHOUT_COMMENTS, $keyInfo);
128131
return $document;
129132
}
130133

@@ -197,7 +200,7 @@ public function getSecurityTokenService(): SecurityTokenServiceType
197200
$defaultEndpoint = Module::getModuleURL('adfs') . '/idp/prp.php';
198201

199202
return new SecurityTokenServiceType(
200-
protocolSupportEnumeration: [C::NS_TRUST_200512, C::NS_TRUST_200502, C::NS_FED],
203+
protocolSupportEnumeration: [C_TRUST::NS_TRUST_200512, C_TRUST::NS_TRUST_200502, C_FED::NS_FED],
201204
keyDescriptors: $this->getKeyDescriptor(),
202205
tokenTypesOffered: new TokenTypesOffered([new TokenType('urn:oasis:names:tc:SAML:1.0:assertion')]),
203206
securityTokenServiceEndpoint: [
@@ -299,13 +302,13 @@ private function getExtensions(): ?Extensions
299302
if (preg_match('/^\{(.*?)\}(.*)$/', $attributeName, $matches)) {
300303
$attr[] = new Attribute(
301304
name: $matches[2],
302-
nameFormat: $matches[1] === C::NAMEFORMAT_UNSPECIFIED ? null : $matches[1],
305+
nameFormat: $matches[1] === C_SAML2::NAMEFORMAT_UNSPECIFIED ? null : $matches[1],
303306
attributeValue: $attrValues,
304307
);
305308
} else {
306309
$attr[] = new Attribute(
307310
name: $attributeName,
308-
nameFormat: C::NAMEFORMAT_UNSPECIFIED,
311+
nameFormat: C_SAML2::NAMEFORMAT_UNSPECIFIED,
309312
attributeValue: $attrValues,
310313
);
311314
}

src/MetadataExchange.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
use SimpleSAML\WSDL\XML\wsdl\PortType;
2424
use SimpleSAML\WSDL\XML\wsdl\PortTypeOperation;
2525
use SimpleSAML\WSDL\XML\wsdl\Service;
26-
use SimpleSAML\WSSecurity\Constants as C;
27-
use SimpleSAML\WSSecurity\XML\wsa_200508\Address;
28-
use SimpleSAML\WSSecurity\XML\wsa_200508\EndpointReference;
29-
use SimpleSAML\WSSecurity\XML\wsp\PolicyReference;
30-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityToken as RequestSecurityToken2005;
31-
use SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityTokenResponse as RequestSecurityTokenResponse2005;
32-
//use SimpleSAML\WSSecurity\XML\wst_200512\RequestSecurityToken as RequestSecurityToken13;
33-
//use SimpleSAML\WSSecurity\XML\wst_200512\RequestSecurityTokenResponseCollection as \
26+
use SimpleSAML\WebServices\Addressing\Constants as C;
27+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\Address;
28+
use SimpleSAML\WebServices\Addressing\XML\wsa_200508\EndpointReference;
29+
use SimpleSAML\WebServices\Addressing\XML\wsp_200409\PolicyReference;
30+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestSecurityToken as RequestSecurityToken2005;
31+
use SimpleSAML\WebServices\Trust\XML\wst_200502\RequestSecurityTokenResponse as RequestSecurityTokenResponse2005;
32+
//use SimpleSAML\WebServices\Trust\XML\wst_200512\RequestSecurityToken as RequestSecurityToken13;
33+
//use SimpleSAML\WebServices\Trust\XML\wst_200512\RequestSecurityTokenResponseCollection as \
3434
//RequestSecurityTokenResponseCollection13;
3535
use SimpleSAML\XML\Attribute as XMLAttribute;
3636

0 commit comments

Comments
 (0)