Skip to content

Commit b02c543

Browse files
committed
Bump the version of the SAML2 library.
Now we are finally using the 2.x branch of the SAML2 library, which was also migrated to use namespaces. Even though the library provides an autoloader that allows loading the classes with the old names using class aliasing, we need to do the migration in one commit (at least for most part of it). This is due to the way SimpleSAMLphp checks data types, using inheritance to check objects agains abstract or more general classes. Even though class aliasing works, there's no way to replicate those relationships, and type checks that use the old class names will fail because the aliases are virtually new classes that don't inherit from others.
1 parent 09b3041 commit b02c543

39 files changed

Lines changed: 359 additions & 345 deletions

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
},
2828
"require": {
2929
"php": ">=5.3",
30-
"simplesamlphp/saml2": "~1.9",
31-
"robrichards/xmlseclibs": "~1.4.1",
30+
"simplesamlphp/saml2": "~2.0",
31+
"robrichards/xmlseclibs": "~2.0",
3232
"whitehat101/apr1-md5": "~1.0",
3333
"twig/twig": "~1.0"
3434
},

composer.lock

Lines changed: 23 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/SimpleSAML/Bindings/Shib13/Artifact.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private static function extractResponse($soapResponse) {
7575
assert('is_string($soapResponse)');
7676

7777
try {
78-
$doc = SAML2_DOMDocumentFactory::fromString($soapResponse);
78+
$doc = \SAML2\DOMDocumentFactory::fromString($soapResponse);
7979
} catch(\Exception $e) {
8080
throw new SimpleSAML_Error_Exception('Error parsing SAML 1 artifact response.');
8181
}
@@ -102,7 +102,7 @@ private static function extractResponse($soapResponse) {
102102
* Save the <saml1p:Response> element. Note that we need to import it
103103
* into a new document, in order to preserve namespace declarations.
104104
*/
105-
$newDoc = SAML2_DOMDocumentFactory::create();
105+
$newDoc = \SAML2\DOMDocumentFactory::create();
106106
$newDoc->appendChild($newDoc->importNode($responseElement, TRUE));
107107
$responseXML = $newDoc->saveXML();
108108

lib/SimpleSAML/Bindings/Shib13/HTTPPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function sendResponse(
5858
$privatekey = SimpleSAML\Utils\Crypto::loadPrivateKey($idpmd, true);
5959
$publickey = SimpleSAML\Utils\Crypto::loadPublicKey($idpmd, true);
6060

61-
$responsedom = SAML2_DOMDocumentFactory::fromString(str_replace("\r", "", $response));
61+
$responsedom = \SAML2\DOMDocumentFactory::fromString(str_replace("\r", "", $response));
6262

6363
$responseroot = $responsedom->getElementsByTagName('Response')->item(0);
6464
$firstassertionroot = $responsedom->getElementsByTagName('Assertion')->item(0);

lib/SimpleSAML/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,11 +1071,11 @@ private function getDefaultBinding($endpointType)
10711071
case 'saml20-idp-remote:SingleSignOnService':
10721072
case 'saml20-idp-remote:SingleLogoutService':
10731073
case 'saml20-sp-remote:SingleLogoutService':
1074-
return SAML2_Const::BINDING_HTTP_REDIRECT;
1074+
return \SAML2\Constants::BINDING_HTTP_REDIRECT;
10751075
case 'saml20-sp-remote:AssertionConsumerService':
1076-
return SAML2_Const::BINDING_HTTP_POST;
1076+
return \SAML2\Constants::BINDING_HTTP_POST;
10771077
case 'saml20-idp-remote:ArtifactResolutionService':
1078-
return SAML2_Const::BINDING_SOAP;
1078+
return \SAML2\Constants::BINDING_SOAP;
10791079
case 'shib13-idp-remote:SingleSignOnService':
10801080
return 'urn:mace:shibboleth:1.0:profiles:AuthnRequest';
10811081
case 'shib13-sp-remote:AssertionConsumerService':

lib/SimpleSAML/Metadata/MetaDataStorageHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,21 @@ public function getGenerated($property, $set)
102102

103103
if ($set == 'saml20-sp-hosted') {
104104
if ($property === 'SingleLogoutServiceBinding') {
105-
return SAML2_Const::BINDING_HTTP_REDIRECT;
105+
return \SAML2\Constants::BINDING_HTTP_REDIRECT;
106106
}
107107
} elseif ($set == 'saml20-idp-hosted') {
108108
switch ($property) {
109109
case 'SingleSignOnService':
110110
return $baseurl.'saml2/idp/SSOService.php';
111111

112112
case 'SingleSignOnServiceBinding':
113-
return SAML2_Const::BINDING_HTTP_REDIRECT;
113+
return \SAML2\Constants::BINDING_HTTP_REDIRECT;
114114

115115
case 'SingleLogoutService':
116116
return $baseurl.'saml2/idp/SingleLogoutService.php';
117117

118118
case 'SingleLogoutServiceBinding':
119-
return SAML2_Const::BINDING_HTTP_REDIRECT;
119+
return \SAML2\Constants::BINDING_HTTP_REDIRECT;
120120
}
121121
} elseif ($set == 'shib13-idp-hosted') {
122122
if ($property === 'SingleSignOnService') {

0 commit comments

Comments
 (0)