Skip to content

Commit 1f2ab6c

Browse files
committed
Normalize documents
1 parent 27d1597 commit 1f2ab6c

23 files changed

Lines changed: 196 additions & 183 deletions

.gitattributes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ codecov.yml export-ignore
99
phpcs.xml export-ignore
1010
phpunit.xml export-ignore
1111
phpunit-interoperability.xml export-ignore
12-
phpstan.xml export-ignore
13-
phpstan-dev.xml export-ignore
12+
phpstan-baseline.neon export-ignore
13+
phpstan-baseline-dev.neon export-ignore
14+
phpstan.neon export-ignore
15+
phpstan-dev.neon export-ignore
1416
README-DEV.md export-ignore
1517
UPGRADING.md export-ignore

.github/workflows/php.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ jobs:
151151

152152
quality:
153153
name: Quality control
154+
needs: [unit-tests-linux]
154155
runs-on: [ubuntu-latest]
155156

156157
steps:
@@ -205,7 +206,9 @@ jobs:
205206
206207
security:
207208
name: Security checks
209+
needs: [unit-tests-linux]
208210
runs-on: [ubuntu-latest]
211+
209212
steps:
210213
- name: Setup PHP, with composer and extensions
211214
# https://github.com/shivammathur/setup-php

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"psr/clock": "~1.0.0",
1919
"psr/log": "~3.0.0",
2020
"simplesamlphp/assert": "~1.9.0",
21-
"simplesamlphp/xml-common": "~2.0.3",
22-
"simplesamlphp/xml-security": "~2.0.3"
21+
"simplesamlphp/xml-common": "~2.1.1",
22+
"simplesamlphp/xml-security": "~2.0.5"
2323
},
2424
"require-dev": {
2525
"beste/clock": "~3.0.0",

src/SAML11/XML/saml/AbstractCondition.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,16 @@ public static function fromXML(DOMElement $xml): static
104104
public function toXML(?DOMElement $parent = null): DOMElement
105105
{
106106
$e = $this->instantiateParentElement($parent);
107-
108-
if (!$e->lookupPrefix($this->getXsiType()->getNamespaceURI()->getValue())) {
107+
// if (!$e->lookupPrefix($this->getXsiType()->getNamespaceURI()->getValue())) {
109108
$e->setAttributeNS(
110109
'http://www.w3.org/2000/xmlns/',
111110
'xmlns:' . static::getXsiTypePrefix(),
112111
strval(static::getXsiTypeNamespaceURI()),
113112
);
114-
}
113+
// }
114+
echo $e->ownerDocument->saveXML($e->ownerDocument);
115+
// $xmlns = new XMLAttribute('http://www.w3.org/2000/xmlns/', 'xmlns', static::getXsiTypePrefix(), strval(static::getXsiTypeNamespaceURI()));
116+
// $xmlns->toXML($e);
115117

116118
$type = new XMLAttribute(C_XSI::NS_XSI, 'xsi', 'type', $this->getXsiType());
117119
$type->toXML($e);

src/SAML11/XML/saml/Conditions.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@
1515
final class Conditions extends AbstractConditionsType implements SchemaValidatableElementInterface
1616
{
1717
use SchemaValidatableElementTrait;
18+
19+
/**
20+
* This element doesn't allow arbitrary namespace-declarations and therefore cannot be normalized
21+
* @var bool
22+
*/
23+
final public const NORMALIZATION = false;
1824
}

tests/resources/xml/saml_Advice.xml

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

tests/resources/xml/saml_Assertion.xml

Lines changed: 57 additions & 57 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" AttributeName="TheName" AttributeNamespace="https://example.org/">
1+
<saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" AttributeName="TheName" AttributeNamespace="https://example.org/">
22
<saml:AttributeValue>FirstValue</saml:AttributeValue>
33
<saml:AttributeValue>SecondValue</saml:AttributeValue>
4-
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:integer">3</saml:AttributeValue>
5-
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:dateTime">2024-04-04T04:44:44Z</saml:AttributeValue>
4+
<saml:AttributeValue xsi:type="xs:integer">3</saml:AttributeValue>
5+
<saml:AttributeValue xsi:type="xs:dateTime">2024-04-04T04:44:44Z</saml:AttributeValue>
66
</saml:Attribute>

tests/resources/xml/saml_AttributeStatement.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
1+
<saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ssp="urn:x-simplesamlphp:namespace">
22
<saml:Subject>
33
<saml:NameIdentifier NameQualifier="TheNameQualifier" Format="urn:the:format">TheNameIDValue</saml:NameIdentifier>
44
<saml:SubjectConfirmation>
55
<saml:ConfirmationMethod>_Test1</saml:ConfirmationMethod>
66
<saml:ConfirmationMethod>_Test2</saml:ConfirmationMethod>
7-
<saml:SubjectConfirmationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:integer">2</saml:SubjectConfirmationData>
8-
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="AttributeStatementID">
7+
<saml:SubjectConfirmationData xsi:type="xs:integer">2</saml:SubjectConfirmationData>
8+
<ds:KeyInfo Id="AttributeStatementID">
99
<ds:KeyName>testkey</ds:KeyName>
1010
<ds:X509Data>
1111
<ds:X509Certificate>M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Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>
14+
<ssp:Chunk>some</ssp:Chunk>
1515
</ds:KeyInfo>
1616
</saml:SubjectConfirmation>
1717
</saml:Subject>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<saml:AuthenticationStatement xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" AuthenticationInstant="2023-01-24T09:42:26Z">
1+
<saml:AuthenticationStatement xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ssp="urn:x-simplesamlphp:namespace" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" AuthenticationInstant="2023-01-24T09:42:26Z">
22
<saml:Subject>
33
<saml:NameIdentifier NameQualifier="TheNameQualifier" Format="urn:the:format">TheNameIDValue</saml:NameIdentifier>
44
<saml:SubjectConfirmation>
55
<saml:ConfirmationMethod>_Test1</saml:ConfirmationMethod>
66
<saml:ConfirmationMethod>_Test2</saml:ConfirmationMethod>
7-
<saml:SubjectConfirmationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:integer">2</saml:SubjectConfirmationData>
8-
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="AuthenticationStatementID">
7+
<saml:SubjectConfirmationData xsi:type="xs:integer">2</saml:SubjectConfirmationData>
8+
<ds:KeyInfo Id="AuthenticationStatementID">
99
<ds:KeyName>testkey</ds:KeyName>
1010
<ds:X509Data>
1111
<ds:X509Certificate>MIICxDCCAi2gAwIBAgIUZ9QDx+SBFHednUWDFGm9tyVKrgQwDQYJKoZIhvcNAQELBQAwczElMCMGA1UEAwwcc2VsZnNpZ25lZC5zaW1wbGVzYW1scGhwLm9yZzEZMBcGA1UECgwQU2ltcGxlU0FNTHBocCBIUTERMA8GA1UEBwwISG9ub2x1bHUxDzANBgNVBAgMBkhhd2FpaTELMAkGA1UEBhMCVVMwIBcNMjIxMjAzMTAzNTQwWhgPMjEyMjExMDkxMDM1NDBaMHMxJTAjBgNVBAMMHHNlbGZzaWduZWQuc2ltcGxlc2FtbHBocC5vcmcxGTAXBgNVBAoMEFNpbXBsZVNBTUxwaHAgSFExETAPBgNVBAcMCEhvbm9sdWx1MQ8wDQYDVQQIDAZIYXdhaWkxCzAJBgNVBAYTAlVTMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDessdFRVDTMQQW3Na81B1CjJV1tmY3nopoIhZrkbDxLa+pv7jGDRcYreyu1DoQxEs06V2nHLoyOPhqJXSFivqtUwVYhR6NYgbNI6RRSsIJCweH0YOdlHna7gULPcLX0Bfbi4odStaFwG9yzDySwSEPtsKxm5pENPjNVGh+jJ+H/QIDAQABo1MwUTAdBgNVHQ4EFgQUvV75t8EoQo2fVa0E9otdtIGK5X0wHwYDVR0jBBgwFoAUvV75t8EoQo2fVa0E9otdtIGK5X0wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQANQUeiwPJXkWMXuaDHToEBKcezYGqGEYnGUi9LMjeb+Kln7X8nn5iknlz4k77rWCbSwLPC/WDr0ySYQA+HagaeUaFpoiYFJKS6uFlK1HYWnM3W4PUiGHg1/xeZlMO44wTwybXVo0y9KMhchfB5XNbDdoJcqWYvi6xtmZZNRbxUyw==</ds:X509Certificate>
1212
<ds:X509SubjectName>/CN=selfsigned.simplesamlphp.org/O=SimpleSAMLphp HQ/L=Honolulu/ST=Hawaii/C=US</ds:X509SubjectName>
1313
</ds:X509Data>
14-
<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>
14+
<ssp:Chunk>some</ssp:Chunk>
1515
</ds:KeyInfo>
1616
</saml:SubjectConfirmation>
1717
</saml:Subject>
1818
<saml:SubjectLocality IPAddress="127.0.0.1" DNSAddress="simplesamlphp.org" />
19-
<saml:AuthorityBinding xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" AuthorityKind="samlp:AttributeQuery" Location="urn:x-simplesamlphp:location" Binding="urn:x-simplesamlphp:binding" />
19+
<saml:AuthorityBinding AuthorityKind="samlp:AttributeQuery" Location="urn:x-simplesamlphp:location" Binding="urn:x-simplesamlphp:binding" />
2020
</saml:AuthenticationStatement>

0 commit comments

Comments
 (0)