Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to PSR-2 #53

Closed
wants to merge 14 commits into from
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build/
/cache.properties
/composer.lock
/composer.phar
/vendor/
build
cache.properties
composer.phar
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Usage
composer require simplesamlphp/saml2
```

* Provide the required external dependencies by extending and implementing the ```SAML2_Compat_AbstractContainer```
* Provide the required external dependencies by extending and implementing the ```SAML2\Compat\AbstractContainer```
then injecting it in the ContainerSingleton (see example below).

* **Make sure you've read the security section below**
Expand All @@ -45,24 +45,24 @@ Example:

// Implement the Container interface (out of scope for example)
require 'container.php';
SAML2_Compat_ContainerSingleton::setContainer($container);
SAML2\Compat\ContainerSingleton::setContainer($container);

// Set up an AuthnRequest
$request = new SAML2_AuthnRequest();
$request = new SAML2\AuthnRequest();
$request->setId($container->generateId());
$request->setIssuer('https://sp.example.edu');
$request->setDestination('https://idp.example.edu');

// Send it off using the HTTP-Redirect binding
$binding = new SAML2_HTTPRedirect();
$binding = new SAML2\HTTPRedirect();
$binding->send($request);
```

Security
--------
* Should you need to create a DOMDocument instance, use the `SAML2_DOMDocumentFactory` to create DOMDocuments from
either a string (`SAML2_DOMDocumentFactory::fromString($theXmlAsString)`), a file (`SAML2_DOMDocumentFactory::fromFile($pathToTheFile)`)
or just a new instance (`SAML2_DOMDocumentFactory::create()`). This in order to protect yourself against the
* Should you need to create a DOMDocument instance, use the `SAML2\DOMDocumentFactory` to create DOMDocuments from
either a string (`SAML2\DOMDocumentFactory::fromString($theXmlAsString)`), a file (`SAML2\DOMDocumentFactory::fromFile($pathToTheFile)`)
or just a new instance (`SAML2\DOMDocumentFactory::create()`). This in order to protect yourself against the
[XXE Processing Vulnerability](https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing), as well as
[XML Entity Expansion](http://phpsecurity.readthedocs.org/en/latest/Injection-Attacks.html#defenses-against-xml-entity-expansion) attacks

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ext-openssl": "*",
"ext-dom": "*",

"robrichards/xmlseclibs": "^1.3",
"robrichards/xmlseclibs": "^2.0",
"psr/log": "~1.0"
},
"require-dev": {
Expand All @@ -27,12 +27,12 @@
},
"autoload": {
"psr-0": {
"SAML2_": "src/"
"SAML2\\": "src/"
}
},
"autoload-dev": {
"psr-0": {
"SAML2_": "tests/"
"SAML2\\": "tests/"
}
}
}
Loading