From 9a8262b1b99320ad26c794c815966f51d4c5f9d1 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 2 Jun 2025 23:55:40 +0200 Subject: [PATCH 01/34] Migrate to xsd-types --- composer.json | 9 +-- resources/schemas/ws-authorization.xsd | 16 ++--- .../auth/AbstractAdditionalContextType.php | 3 +- src/XML/auth/AbstractClaimType.php | 63 +++++++++-------- .../AbstractConstrainedSingleValueType.php | 3 +- src/XML/auth/AbstractConstrainedValueType.php | 18 ++--- src/XML/auth/AbstractContextItemType.php | 36 +++++----- src/XML/auth/AbstractDescriptionType.php | 17 +++-- src/XML/auth/AbstractDisplayNameType.php | 17 +++-- src/XML/auth/AbstractDisplayValueType.php | 17 +++-- src/XML/auth/AbstractEncryptedValueType.php | 24 ++++--- src/XML/auth/AbstractStructuredValueType.php | 3 +- src/XML/auth/Value.php | 15 ++--- .../fed/AbstractApplicationServiceType.php | 32 ++++----- src/XML/fed/AbstractAssertionType.php | 3 +- .../fed/AbstractAttributeExtensibleString.php | 17 +++-- .../fed/AbstractAttributeExtensibleURI.php | 16 +++-- src/XML/fed/AbstractAttributeServiceType.php | 33 +++++---- src/XML/fed/AbstractClaimDialectType.php | 20 +++--- .../fed/AbstractClaimDialectsOfferedType.php | 4 +- src/XML/fed/AbstractClaimTypesOfferedType.php | 4 +- .../fed/AbstractClaimTypesRequestedType.php | 4 +- src/XML/fed/AbstractClientPseudonymType.php | 6 +- src/XML/fed/AbstractEndpointType.php | 3 +- .../fed/AbstractFederationMetadataType.php | 3 +- src/XML/fed/AbstractFederationType.php | 21 +++--- src/XML/fed/AbstractFilterPseudonymsType.php | 6 +- src/XML/fed/AbstractFreshnessType.php | 59 ++++++---------- src/XML/fed/AbstractIssuerNameType.php | 18 +++-- ...AbstractLogicalServiceNamesOfferedType.php | 4 +- src/XML/fed/AbstractProofTokenType.php | 6 +- src/XML/fed/AbstractPseudonymBasisType.php | 8 +-- src/XML/fed/AbstractPseudonymServiceType.php | 32 ++++----- src/XML/fed/AbstractPseudonymType.php | 6 +- src/XML/fed/AbstractReferenceDigestType.php | 17 +++-- src/XML/fed/AbstractReferenceTokenType.php | 7 +- src/XML/fed/AbstractRelativeToType.php | 3 +- src/XML/fed/AbstractRequestProofTokenType.php | 3 +- src/XML/fed/AbstractRequestPseudonymType.php | 30 +++++---- .../fed/AbstractSecurityTokenServiceType.php | 34 +++++----- src/XML/fed/AbstractSecurityTokenType.php | 7 +- src/XML/fed/AbstractSignOutBasisType.php | 6 +- src/XML/fed/AbstractSignOutType.php | 22 +++--- src/XML/fed/AbstractTokenType.php | 21 +++--- src/XML/fed/AbstractTokenTypesOfferedType.php | 7 +- .../fed/AbstractWebServiceDescriptorType.php | 43 ++++++------ src/XML/fed/AutomaticPseudonyms.php | 50 ++------------ src/XML/fed/Realm.php | 15 ++--- src/XML/fed/SecurityTokenServiceType.php | 23 +++---- .../wsa_200508/AbstractAttributedURIType.php | 16 +++-- .../XML/auth/AdditionalContextTest.php | 35 +++++----- tests/WSSecurity/XML/auth/ClaimTypeTest.php | 54 +++++++-------- .../XML/auth/ConstrainedManyValueTest.php | 25 ++++--- .../XML/auth/ConstrainedSingleValueTest.php | 35 +++++----- .../XML/auth/ConstrainedValueTest.php | 39 ++++++----- tests/WSSecurity/XML/auth/ContextItemTest.php | 25 +++---- tests/WSSecurity/XML/auth/DescriptionTest.php | 15 ++--- tests/WSSecurity/XML/auth/DisplayNameTest.php | 15 ++--- .../WSSecurity/XML/auth/DisplayValueTest.php | 15 ++--- .../XML/auth/EncryptedValueTest.php | 44 ++++++------ .../XML/auth/StructuredValueTest.php | 14 ++-- .../XML/auth/ValueGreaterThanOrEqualTest.php | 20 +++--- .../XML/auth/ValueGreaterThanTest.php | 20 +++--- .../WSSecurity/XML/auth/ValueInRangenTest.php | 31 +++++---- .../XML/auth/ValueLessThanOrEqualTest.php | 21 +++--- .../WSSecurity/XML/auth/ValueLessThanTest.php | 20 +++--- .../XML/auth/ValueLowerBoundTest.php | 18 +++-- .../ValueOneOfWithStructuredValuesTest.php | 22 +++--- .../XML/auth/ValueOneOfWithValuesTest.php | 18 ++--- tests/WSSecurity/XML/auth/ValueTest.php | 9 ++- .../XML/auth/ValueUpperBoundTest.php | 20 +++--- .../XML/fed/ReferenceDigestTest.php | 15 +++-- tests/WSSecurity/XML/fed/ReferenceEPRTest.php | 33 ++++----- .../XML/fed/ReferenceToken11Test.php | 17 ++--- .../WSSecurity/XML/fed/ReferenceTokenTest.php | 67 ++++++++++--------- .../WSSecurity/XML/fed/ReferenceTypeTest.php | 21 +++--- .../XML/fed/RequestPseudonymTest.php | 21 +++--- 77 files changed, 715 insertions(+), 824 deletions(-) diff --git a/composer.json b/composer.json index bb03b0a5..04140c9c 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,11 @@ "ext-dom": "*", "ext-spl": "*", - "simplesamlphp/assert": "~1.8.1", - "simplesamlphp/saml2": "^5@dev", - "simplesamlphp/xml-security": "~1.13.0", - "simplesamlphp/xml-common": "~1.25.0" + "simplesamlphp/assert": "~1.9.2", + "simplesamlphp/saml2": "dev-feature/xsd-types", + "simplesamlphp/xml-common": "dev-feature/xsd-types", + "simplesamlphp/xml-security": "dev-feature/xsd-types", + "simplesamlphp/xml-soap": "dev-feature/xsd-types" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "~1.9.2" diff --git a/resources/schemas/ws-authorization.xsd b/resources/schemas/ws-authorization.xsd index f83faaa9..8766e3b2 100644 --- a/resources/schemas/ws-authorization.xsd +++ b/resources/schemas/ws-authorization.xsd @@ -45,8 +45,8 @@ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - + + @@ -57,16 +57,16 @@ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - + - - + + - - - + + + diff --git a/src/XML/auth/AbstractAdditionalContextType.php b/src/XML/auth/AbstractAdditionalContextType.php index 92eec23c..5eb371b0 100644 --- a/src/XML/auth/AbstractAdditionalContextType.php +++ b/src/XML/auth/AbstractAdditionalContextType.php @@ -8,8 +8,7 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\auth\ContextItem; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/auth/AbstractClaimType.php b/src/XML/auth/AbstractClaimType.php index 998ee119..9884fc87 100644 --- a/src/XML/auth/AbstractClaimType.php +++ b/src/XML/auth/AbstractClaimType.php @@ -6,23 +6,25 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\WSSecurity\XML\auth\ConstrainedValue; -use SimpleSAML\WSSecurity\XML\auth\Description; -use SimpleSAML\WSSecurity\XML\auth\DisplayName; -use SimpleSAML\WSSecurity\XML\auth\DisplayValue; -use SimpleSAML\WSSecurity\XML\auth\EncryptedValue; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\{ + ConstrainedValue, + Description, + DisplayName, + DisplayValue, + EncryptedValue, + StructuredValue, + Value, +}; use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, TooManyElementsException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; +use SimpleSAML\XML\Type\{AnyURIValue, BooleanValue}; use SimpleSAML\XML\XsNamespace as NS; use function array_filter; use function array_merge; use function array_pop; +use function var_export; /** * Class defining the ClaimType element @@ -32,16 +34,20 @@ abstract class AbstractClaimType extends AbstractAuthElement { use ExtendableAttributesTrait; + use ExtendableElementTrait; /** The namespace-attribute for the xs:anyAttribute */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** The namespace-attribute for the xs:any element */ + public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + /** * AbstractClaimType constructor * - * @param string $uri - * @param bool|null $optional + * @param \SimpleSAML\XML\Type\AnyURIValue $uri + * @param \SimpleSAML\XML\Type\BooleanValue|null $optional * @param \SimpleSAML\WSSecurity\XML\auth\DisplayName|null $displayName * @param \SimpleSAML\WSSecurity\XML\auth\Description|null $description * @param \SimpleSAML\WSSecurity\XML\auth\DisplayValue|null $displayValue @@ -56,15 +62,14 @@ abstract class AbstractClaimType extends AbstractAuthElement * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected string $uri, - protected ?bool $optional = null, + protected AnyURIValue $uri, + protected ?BooleanValue $optional = null, protected ?DisplayName $displayName = null, protected ?Description $description = null, protected ?DisplayValue $displayValue = null, protected null|Value|EncryptedValue|StructuredValue|ConstrainedValue|SerializableElementInterface $value = null, array $namespacedAttributes = [], ) { - Assert::validURI($uri); if ( !($value === null || $value instanceof Value || @@ -133,9 +138,9 @@ public function getDescription(): ?Description /** * Get the value of the uri property. * - * @return string + * @return \SimpleSAML\XML\Type\AnyURIValue */ - public function getURI(): string + public function getURI(): AnyURIValue { return $this->uri; } @@ -144,9 +149,9 @@ public function getURI(): string /** * Get the value of the optional property. * - * @return bool|null + * @return \SimpleSAML\XML\Type\BooleanValue|null */ - public function getOptional(): ?bool + public function getOptional(): ?BooleanValue { return $this->optional; } @@ -179,15 +184,7 @@ public static function fromXML(DOMElement $xml): static $structuredValue = StructuredValue::getChildrenOfClass($xml); $encryptedValue = EncryptedValue::getChildrenOfClass($xml); $constrainedValue = ConstrainedValue::getChildrenOfClass($xml); - - $otherValue = []; - foreach ($xml->childNodes as $child) { - if (!($child instanceof DOMElement)) { - continue; - } elseif ($child->namespaceURI !== static::NS) { - $otherValue[] = new Chunk($child); - } - } + $otherValue = self::getChildElementsFromXML($xml); $value = array_filter(array_merge( $simpleValue, @@ -199,8 +196,8 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($value, 1, TooManyElementsException::class); return new static( - self::getAttribute($xml, 'Uri'), - self::getOptionalBooleanAttribute($xml, 'Optional', null), + self::getAttribute($xml, 'Uri', AnyURIValue::class), + self::getOptionalAttribute($xml, 'Optional', BooleanValue::class, null), array_pop($displayName), array_pop($description), array_pop($displayValue), @@ -220,9 +217,9 @@ public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->setAttribute('Uri', $this->getURI()); + $e->setAttribute('Uri', $this->getURI()->getValue()); if ($this->getOptional() !== null) { - $e->setAttribute('Optional', $this->getOptional() ? 'true' : 'false'); + $e->setAttribute('Optional', var_export($this->getOptional()->toBoolean(), true)); } $this->getDisplayName()?->toXML($e); diff --git a/src/XML/auth/AbstractConstrainedSingleValueType.php b/src/XML/auth/AbstractConstrainedSingleValueType.php index eb4af4b9..73ef02f6 100644 --- a/src/XML/auth/AbstractConstrainedSingleValueType.php +++ b/src/XML/auth/AbstractConstrainedSingleValueType.php @@ -6,8 +6,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, TooManyElementsException}; use function array_pop; diff --git a/src/XML/auth/AbstractConstrainedValueType.php b/src/XML/auth/AbstractConstrainedValueType.php index a2939ca9..25fcb85c 100644 --- a/src/XML/auth/AbstractConstrainedValueType.php +++ b/src/XML/auth/AbstractConstrainedValueType.php @@ -6,15 +6,15 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, TooManyElementsException}; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Type\BooleanValue; use SimpleSAML\XML\XsNamespace as NS; use function array_filter; use function array_merge; use function array_pop; +use function var_export; /** * Class defining the ConstrainedValueType element @@ -41,12 +41,12 @@ abstract class AbstractConstrainedValueType extends AbstractAuthElement * \SimpleSAML\WSSecurity\XML\auth\ValueOneOf * ) $value * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param bool|null $assertConstraint + * @param \SimpleSAML\XML\Type\BooleanValue|null $assertConstraint */ final public function __construct( protected ValueLessThan|ValueLessThanOrEqual|ValueGreaterThan|ValueGreaterThanOrEqual|ValueInRangen|ValueOneOf $value, array $children = [], - protected ?bool $assertConstraint = null, + protected ?BooleanValue $assertConstraint = null, ) { $this->setElements($children); } @@ -73,9 +73,9 @@ public function getValue(): ValueLessThan|ValueLessThanOrEqual|ValueGreaterThan| /** * Get the value of the assertConstraint property. * - * @return bool|null + * @return \SimpleSAML\XML\Type\BooleanValue|null */ - public function getAssertConstraint(): ?bool + public function getAssertConstraint(): ?BooleanValue { return $this->assertConstraint; } @@ -116,7 +116,7 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($value), self::getChildElementsFromXML($xml), - self::getOptionalBooleanAttribute($xml, 'AssertConstraint', null), + self::getOptionalAttribute($xml, 'AssertConstraint', BooleanValue::class, null), ); } @@ -132,7 +132,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getAssertConstraint() !== null) { - $e->setAttribute('AssertConstraint', $this->getAssertConstraint() ? 'true' : 'false'); + $e->setAttribute('AssertConstraint', var_export($this->getAssertConstraint()->toBoolean(), true)); } $this->getValue()->toXML($e); diff --git a/src/XML/auth/AbstractContextItemType.php b/src/XML/auth/AbstractContextItemType.php index eac4f84a..86c143d6 100644 --- a/src/XML/auth/AbstractContextItemType.php +++ b/src/XML/auth/AbstractContextItemType.php @@ -6,12 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\Exception\TooManyElementsException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException, TooManyElementsException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; +use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\XsNamespace as NS; use function array_pop; @@ -36,22 +33,19 @@ abstract class AbstractContextItemType extends AbstractAuthElement /** * AbstractContextItemType constructor * - * @param string $Name - * @param string|null $Scope + * @param \SimpleSAML\XML\Type\AnyURIValue $Name + * @param \SimpleSAML\XML\Type\AnyURIValue|null $Scope * @param \SimpleSAML\WSSecurity\XML\auth\Value|null $value * @param \SimpleSAML\XML\SerializableElementInterface|null $child * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected string $Name, - protected ?string $Scope = null, + protected AnyURIValue $Name, + protected ?AnyURIValue $Scope = null, protected ?Value $value = null, ?SerializableElementInterface $child = null, array $namespacedAttributes = [], ) { - Assert::validURI($Name); - Assert::nullOrValidURI($Scope); - // One of both must exist, they can't be both null Assert::inArray(null, [$value, $child], SchemaViolationException::class); Assert::notSame($value, $child, SchemaViolationException::class); @@ -77,9 +71,9 @@ public function getValue(): ?Value /** * Get the value of the Name property. * - * @return string + * @return \SimpleSAML\XML\Type\AnyURIValue */ - public function getName(): string + public function getName(): AnyURIValue { return $this->Name; } @@ -88,9 +82,9 @@ public function getName(): string /** * Get the value of the Scope property. * - * @return string|null + * @return \SimpleSAML\XML\Type\AnyURIValue|null */ - public function getScope(): ?string + public function getScope(): ?AnyURIValue { return $this->Scope; } @@ -117,8 +111,8 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($children, 1, TooManyElementsException::class); return new static( - self::getAttribute($xml, 'Name'), - self::getOptionalAttribute($xml, 'Scope'), + self::getAttribute($xml, 'Name', AnyURIValue::class), + self::getOptionalAttribute($xml, 'Scope', AnyURIValue::class, null), array_pop($value), array_pop($children), self::getAttributesNSFromXML($xml), @@ -136,9 +130,9 @@ public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->setAttribute('Name', $this->getName()); + $e->setAttribute('Name', $this->getName()->getValue()); if ($this->getScope() !== null) { - $e->setAttribute('Scope', $this->getScope()); + $e->setAttribute('Scope', $this->getScope()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/auth/AbstractDescriptionType.php b/src/XML/auth/AbstractDescriptionType.php index 624228d1..49606ce1 100644 --- a/src/XML/auth/AbstractDescriptionType.php +++ b/src/XML/auth/AbstractDescriptionType.php @@ -7,8 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; +use SimpleSAML\XML\Type\StringValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -19,7 +19,10 @@ abstract class AbstractDescriptionType extends AbstractAuthElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -28,10 +31,10 @@ abstract class AbstractDescriptionType extends AbstractAuthElement /** * AbstractDescriptionType constructor. * - * @param string $value The value string. + * @param \SimpleSAML\XML\Type\StringValue $value The value string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(StringValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -52,7 +55,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(StringValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -65,7 +68,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/auth/AbstractDisplayNameType.php b/src/XML/auth/AbstractDisplayNameType.php index 28bdb85a..1c119efb 100644 --- a/src/XML/auth/AbstractDisplayNameType.php +++ b/src/XML/auth/AbstractDisplayNameType.php @@ -7,8 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; +use SimpleSAML\XML\Type\StringValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -19,7 +19,10 @@ abstract class AbstractDisplayNameType extends AbstractAuthElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -28,10 +31,10 @@ abstract class AbstractDisplayNameType extends AbstractAuthElement /** * AbstractDisplayNameType constructor. * - * @param string $value The value string. + * @param \SimpleSAML\XML\Type\StringValue $value The value string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(StringValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -52,7 +55,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(StringValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -65,7 +68,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/auth/AbstractDisplayValueType.php b/src/XML/auth/AbstractDisplayValueType.php index 77118adf..caae2361 100644 --- a/src/XML/auth/AbstractDisplayValueType.php +++ b/src/XML/auth/AbstractDisplayValueType.php @@ -7,8 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; +use SimpleSAML\XML\Type\StringValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -19,7 +19,10 @@ abstract class AbstractDisplayValueType extends AbstractAuthElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -28,10 +31,10 @@ abstract class AbstractDisplayValueType extends AbstractAuthElement /** * AbstractDisplayValueType constructor. * - * @param string $value The value string. + * @param \SimpleSAML\XML\Type\StringValue $value The value string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(StringValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -52,7 +55,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(StringValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -65,7 +68,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/auth/AbstractEncryptedValueType.php b/src/XML/auth/AbstractEncryptedValueType.php index caaa1b73..f6b646f8 100644 --- a/src/XML/auth/AbstractEncryptedValueType.php +++ b/src/XML/auth/AbstractEncryptedValueType.php @@ -6,10 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XML\Exception\{ + InvalidDOMElementException, + MissingElementException, + SchemaViolationException, + TooManyElementsException, +}; +use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XMLSecurity\XML\xenc\EncryptedData; use function array_pop; @@ -25,22 +28,21 @@ abstract class AbstractEncryptedValueType extends AbstractAuthElement * AbstractEncryptedValueType constructor. * * @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedData $encryptedData - * @param string|null $descriptionCondition + * @param \SimpleSAML\XML\Type\AnyURIValue|null $descriptionCondition */ final public function __construct( protected EncryptedData $encryptedData, - protected ?string $descriptionCondition = null, + protected ?AnyURIValue $descriptionCondition = null, ) { - Assert::nullOrValidURI($descriptionCondition, SchemaViolationException::class); } /** * Get the value of the $descriptionCondition property. * - * @return string|null + * @return \SimpleSAML\XML\Type\AnyURIValue|null */ - public function getDescriptionCondition(): ?string + public function getDescriptionCondition(): ?AnyURIValue { return $this->descriptionCondition; } @@ -77,7 +79,7 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($encryptedData), - self::getOptionalAttribute($xml, 'DescriptionCondition', null), + self::getOptionalAttribute($xml, 'DescriptionCondition', AnyURIValue::class, null), ); } @@ -91,7 +93,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->setAttribute('DescriptionCondition', $this->getDescriptionCondition()); + $e->setAttribute('DescriptionCondition', $this->getDescriptionCondition()->getValue()); $this->getEncryptedData()->toXML($e); diff --git a/src/XML/auth/AbstractStructuredValueType.php b/src/XML/auth/AbstractStructuredValueType.php index fd7c93ab..386e4a4a 100644 --- a/src/XML/auth/AbstractStructuredValueType.php +++ b/src/XML/auth/AbstractStructuredValueType.php @@ -7,8 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/auth/Value.php b/src/XML/auth/Value.php index 8d7c745e..e2045200 100644 --- a/src/XML/auth/Value.php +++ b/src/XML/auth/Value.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\auth; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XML\TypedTextContentTrait; /** * Class representing WS-authorization Value. @@ -13,14 +14,8 @@ */ final class Value extends AbstractAuthElement { - use StringElementTrait; + use TypedTextContentTrait; - - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/fed/AbstractApplicationServiceType.php b/src/XML/fed/AbstractApplicationServiceType.php index e94b34a0..a3a4ca41 100644 --- a/src/XML/fed/AbstractApplicationServiceType.php +++ b/src/XML/fed/AbstractApplicationServiceType.php @@ -6,12 +6,12 @@ use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\XML\md\Extensions; -use SimpleSAML\SAML2\XML\md\Organization; +use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; +use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; +use SimpleSAML\XML\Type\{AnyURIValue, DurationValue, IDValue}; /** * A ApplicationServiceType @@ -34,11 +34,11 @@ abstract class AbstractApplicationServiceType extends AbstractWebServiceDescript * ApplicationServiceType constructor. * * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param string|null $ID The ID for this document. Defaults to null. - * @param \DateTimeImmutable|null $validUntil Unix time of validity for this document. Defaults to null. - * @param string|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\DateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param string|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -53,19 +53,19 @@ abstract class AbstractApplicationServiceType extends AbstractWebServiceDescript * @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesRequested|null $claimTypesRequested * @param \SimpleSAML\WSSecurity\XML\fed\AutomaticPseudonyms|null $automaticPseudonyms * @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes - * @param string|null $serviceDisplayName - * @param string|null $serviceDescription + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDisplayName + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDescription * @param \SimpleSAML\WSSecurity\XML\fed\ApplicationServiceEndpoint[] $applicationServiceEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] $passiveRequestorEndpoint */ final public function __construct( array $protocolSupportEnumeration, - ?string $ID = null, - ?DateTimeImmutable $validUntil = null, - ?string $cacheDuration = null, + ?IDValue $ID = null, + ?SAMLDateTimeValue $validUntil = null, + ?DurationValue $cacheDuration = null, ?Extensions $extensions = null, - ?string $errorURL = null, + ?SAMLAnyURIValue $errorURL = null, array $keyDescriptor = [], ?Organization $organization = null, array $contact = [], @@ -77,8 +77,8 @@ final public function __construct( ?ClaimTypesRequested $claimTypesRequested = null, ?AutomaticPseudonyms $automaticPseudonyms = null, ?TargetScopes $targetScopes = null, - ?string $serviceDisplayName = null, - ?string $serviceDescription = null, + ?SAMLStringValue $serviceDisplayName = null, + ?SAMLStringValue $serviceDescription = null, protected array $applicationServiceEndpoint = [], protected array $singleSignOutNotificationEndpoint = [], protected array $passiveRequestorEndpoint = [], diff --git a/src/XML/fed/AbstractAssertionType.php b/src/XML/fed/AbstractAssertionType.php index 90be0b69..b54bc60b 100644 --- a/src/XML/fed/AbstractAssertionType.php +++ b/src/XML/fed/AbstractAssertionType.php @@ -7,8 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractAttributeExtensibleString.php b/src/XML/fed/AbstractAttributeExtensibleString.php index d54cdd6f..19dea568 100644 --- a/src/XML/fed/AbstractAttributeExtensibleString.php +++ b/src/XML/fed/AbstractAttributeExtensibleString.php @@ -7,8 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; +use SimpleSAML\XML\Type\StringValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -19,17 +19,20 @@ abstract class AbstractAttributeExtensibleString extends AbstractFedElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** - * @param string $content + * @param \SimpleSAML\XML\Type\StringValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ - final public function __construct(string $content, array $namespacedAttributes = []) + final public function __construct(StringValue $content, array $namespacedAttributes = []) { $this->setContent($content); $this->setAttributesNS($namespacedAttributes); @@ -48,7 +51,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, + StringValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml), ); } @@ -63,7 +66,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/fed/AbstractAttributeExtensibleURI.php b/src/XML/fed/AbstractAttributeExtensibleURI.php index a7498fc5..be88d681 100644 --- a/src/XML/fed/AbstractAttributeExtensibleURI.php +++ b/src/XML/fed/AbstractAttributeExtensibleURI.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; /** @@ -18,18 +19,21 @@ */ abstract class AbstractAttributeExtensibleURI extends AbstractFedElement { - use URIElementTrait; + use TypedTextContentTrait; use ExtendableAttributesTrait; + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** - * @param string $content + * @param \SimpleSAML\XML\Type\AnyURIValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ - final public function __construct(string $content, array $namespacedAttributes = []) + final public function __construct(AnyURIValue $content, array $namespacedAttributes = []) { $this->setContent($content); $this->setAttributesNS($namespacedAttributes); @@ -48,7 +52,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, + AnyURIValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml), ); } @@ -63,7 +67,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/fed/AbstractAttributeServiceType.php b/src/XML/fed/AbstractAttributeServiceType.php index c3b4274a..df191b6d 100644 --- a/src/XML/fed/AbstractAttributeServiceType.php +++ b/src/XML/fed/AbstractAttributeServiceType.php @@ -4,14 +4,13 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\XML\md\Extensions; -use SimpleSAML\SAML2\XML\md\Organization; +use SimpleSAML\SAML\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; +use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; +use SimpleSAML\XML\Type\{DurationValue, IDValue}; /** * A AttributeServiceType @@ -34,11 +33,11 @@ abstract class AbstractAttributeServiceType extends AbstractWebServiceDescriptor * AttributeServiceType constructor. * * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param string|null $ID The ID for this document. Defaults to null. - * @param \DateTimeImmutable|null $validUntil Unix time of validity for this document. Defaults to null. - * @param string|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param string|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -53,18 +52,18 @@ abstract class AbstractAttributeServiceType extends AbstractWebServiceDescriptor * @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesRequested|null $claimTypesRequested * @param \SimpleSAML\WSSecurity\XML\fed\AutomaticPseudonyms|null $automaticPseudonyms * @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes - * @param string|null $serviceDisplayName - * @param string|null $serviceDescription + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDisplayName + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDescription * @param \SimpleSAML\WSSecurity\XML\fed\AttributeServiceEndpoint[] $attributeServiceEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint */ final public function __construct( array $protocolSupportEnumeration, - ?string $ID = null, - ?DateTimeImmutable $validUntil = null, - ?string $cacheDuration = null, + ?IDValue $ID = null, + ?SAMLDateTimeValue $validUntil = null, + ?DurationValue $cacheDuration = null, ?Extensions $extensions = null, - ?string $errorURL = null, + ?SAMLAnyURIValue $errorURL = null, array $keyDescriptor = [], ?Organization $organization = null, array $contact = [], @@ -76,8 +75,8 @@ final public function __construct( ?ClaimTypesRequested $claimTypesRequested = null, ?AutomaticPseudonyms $automaticPseudonyms = null, ?TargetScopes $targetScopes = null, - ?string $serviceDisplayName = null, - ?string $serviceDescription = null, + ?SAMLStringValue $serviceDisplayName = null, + ?SAMLStringValue $serviceDescription = null, protected array $attributeServiceEndpoint = [], protected array $singleSignOutNotificationEndpoint = [], ) { diff --git a/src/XML/fed/AbstractClaimDialectType.php b/src/XML/fed/AbstractClaimDialectType.php index 77f38ad5..374491fc 100644 --- a/src/XML/fed/AbstractClaimDialectType.php +++ b/src/XML/fed/AbstractClaimDialectType.php @@ -6,10 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; +use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -32,16 +31,15 @@ abstract class AbstractClaimDialectType extends AbstractFedElement /** * AbstractClaimDialectType constructor * - * @param string|null $Uri + * @param \SimpleSAML\XML\Type\AnyURIValue|null $Uri * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $Uri = null, + protected ?AnyURIValue $Uri = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($Uri, SchemaViolationException::class); // Next one is debatable since the schema allows an empty element, but that makes zero sense Assert::allNotEmpty([$Uri, $children, $namespacedAttributes]); @@ -51,9 +49,9 @@ final public function __construct( /** - * @return string|null + * @return \SimpleSAML\XML\Type\AnyURIValue|null */ - public function getUri(): ?string + public function getUri(): ?AnyURIValue { return $this->Uri; } @@ -74,7 +72,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Uri', null), + self::getOptionalAttribute($xml, 'Uri', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -92,7 +90,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getUri() !== null) { - $e->setAttribute('Uri', $this->getUri()); + $e->setAttribute('Uri', $this->getUri()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/fed/AbstractClaimDialectsOfferedType.php b/src/XML/fed/AbstractClaimDialectsOfferedType.php index 0d81f62b..6e2591ee 100644 --- a/src/XML/fed/AbstractClaimDialectsOfferedType.php +++ b/src/XML/fed/AbstractClaimDialectsOfferedType.php @@ -7,9 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\fed\ClaimDialect; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\XsNamespace as NS; diff --git a/src/XML/fed/AbstractClaimTypesOfferedType.php b/src/XML/fed/AbstractClaimTypesOfferedType.php index 76222811..a5130473 100644 --- a/src/XML/fed/AbstractClaimTypesOfferedType.php +++ b/src/XML/fed/AbstractClaimTypesOfferedType.php @@ -7,9 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\auth\ClaimType; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\XsNamespace as NS; diff --git a/src/XML/fed/AbstractClaimTypesRequestedType.php b/src/XML/fed/AbstractClaimTypesRequestedType.php index 36ae5a75..890ee536 100644 --- a/src/XML/fed/AbstractClaimTypesRequestedType.php +++ b/src/XML/fed/AbstractClaimTypesRequestedType.php @@ -7,9 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\auth\ClaimType; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\XsNamespace as NS; diff --git a/src/XML/fed/AbstractClientPseudonymType.php b/src/XML/fed/AbstractClientPseudonymType.php index 252e35cb..c5853293 100644 --- a/src/XML/fed/AbstractClientPseudonymType.php +++ b/src/XML/fed/AbstractClientPseudonymType.php @@ -6,10 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; use function array_pop; diff --git a/src/XML/fed/AbstractEndpointType.php b/src/XML/fed/AbstractEndpointType.php index 119158ef..4d2f945d 100644 --- a/src/XML/fed/AbstractEndpointType.php +++ b/src/XML/fed/AbstractEndpointType.php @@ -7,8 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsa_200508\EndpointReference; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException}; /** * An EndpointType diff --git a/src/XML/fed/AbstractFederationMetadataType.php b/src/XML/fed/AbstractFederationMetadataType.php index 90a1d27f..dec182ef 100644 --- a/src/XML/fed/AbstractFederationMetadataType.php +++ b/src/XML/fed/AbstractFederationMetadataType.php @@ -7,8 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractFederationType.php b/src/XML/fed/AbstractFederationType.php index 95f3e38a..c6281d51 100644 --- a/src/XML/fed/AbstractFederationType.php +++ b/src/XML/fed/AbstractFederationType.php @@ -6,10 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; +use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -32,26 +31,24 @@ abstract class AbstractFederationType extends AbstractFedElement /** * AbstractFederationType constructor * - * @param string|null $FederationID + * @param \SimpleSAML\XML\Type\AnyURIValue|null $FederationID * @param list<\SimpleSAML\XML\SerializableElementInterface> $children * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $FederationID = null, + protected ?AnyURIValue $FederationID = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($FederationID, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XML\Type\AnyURIValue|null */ - public function getFederationID(): ?string + public function getFederationID(): ?AnyURIValue { return $this->FederationID; } @@ -85,7 +82,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'FederationID', null), + self::getOptionalAttribute($xml, 'FederationID', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +100,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getFederationID() !== null) { - $e->setAttribute('FederationID', $this->getFederationID()); + $e->setAttribute('FederationID', $this->getFederationID()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/fed/AbstractFilterPseudonymsType.php b/src/XML/fed/AbstractFilterPseudonymsType.php index 72899a71..ce67f1b5 100644 --- a/src/XML/fed/AbstractFilterPseudonymsType.php +++ b/src/XML/fed/AbstractFilterPseudonymsType.php @@ -6,10 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, TooManyElementsException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractFreshnessType.php b/src/XML/fed/AbstractFreshnessType.php index 46f72196..08cd5015 100644 --- a/src/XML/fed/AbstractFreshnessType.php +++ b/src/XML/fed/AbstractFreshnessType.php @@ -6,15 +6,14 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; +use SimpleSAML\XML\Type\{BooleanValue, UnsignedIntValue}; use SimpleSAML\XML\XsNamespace as NS; use function intval; use function sprintf; -use function strval; +use function var_export; /** * Class defining the FreshnessType element @@ -23,9 +22,12 @@ */ abstract class AbstractFreshnessType extends AbstractFedElement { - use StringElementTrait; + use TypedTextContentTrait; use ExtendableAttributesTrait; + /** @var string */ + public const TEXTCONTENT_TYPE = UnsignedIntValue::class; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -33,46 +35,24 @@ abstract class AbstractFreshnessType extends AbstractFedElement /** * AbstractFreshnessType constructor * - * @param int $content - * @param bool|null $AllowCache + * @param \SimpleSAML\XML\Type\UnsignedIntValue $content + * @param \SimpleSAML\XML\Type\BooleanValue|null $AllowCache * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - int $content, - protected ?bool $AllowCache = null, + UnsignedIntValue $content, + protected ?BooleanValue $AllowCache = null, array $namespacedAttributes = [], ) { - $this->setContent(strval($content)); + $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } /** - * Validate the content of the element. - * - * @param string $content The value to go in the XML textContent - * @throws \Exception on failure - * @return void - */ - protected function validateContent(string $content): void - { - Assert::natural( - intval($content), - sprintf( - 'The value \'%s\' of an %s:%s element must an unsigned integer.', - $content, - static::NS_PREFIX, - static::getLocalName(), - ), - SchemaViolationException::class, - ); - } - - - /** - * @return bool|null + * @return \SimpleSAML\XML\Type\BooleanValue|null */ - public function getAllowCache(): ?bool + public function getAllowCache(): ?BooleanValue { return $this->AllowCache; } @@ -91,11 +71,10 @@ public static function fromXML(DOMElement $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - Assert::integerish($xml->textContent, SchemaViolationException::class); return new static( - intval($xml->textContent), - self::getOptionalBooleanAttribute($xml, 'AllowCache', null), + UnsignedIntValue::fromString($xml->textContent), + self::getOptionalAttribute($xml, 'AllowCache', BooleanValue::class, null), self::getAttributesNSFromXML($xml), ); } @@ -110,10 +89,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = parent::instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getAllowCache() !== null) { - $e->setAttribute('AllowCache', $this->getAllowCache() ? 'true' : 'false'); + $e->setAttribute('AllowCache', var_export($this->getAllowCache()->toBoolean(), true)); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/fed/AbstractIssuerNameType.php b/src/XML/fed/AbstractIssuerNameType.php index 7e893b60..f7b1c04e 100644 --- a/src/XML/fed/AbstractIssuerNameType.php +++ b/src/XML/fed/AbstractIssuerNameType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -27,23 +27,21 @@ abstract class AbstractIssuerNameType extends AbstractFedElement /** * AbstractIssuerNameType constructor * - * @param string $Uri + * @param \SimpleSAML\XML\Type\AnyURIValue $Uri * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected string $Uri, + protected AnyURIValue $Uri, array $namespacedAttributes = [], ) { - Assert::validURI($Uri, SchemaViolationException::class); - $this->setAttributesNS($namespacedAttributes); } /** - * @return string + * @return \SimpleSAML\XML\Type\AnyURIValue */ - public function getUri(): string + public function getUri(): AnyURIValue { return $this->Uri; } @@ -64,7 +62,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getAttribute($xml, 'Uri'), + self::getAttribute($xml, 'Uri', AnyURIValue::class), self::getAttributesNSFromXML($xml), ); } @@ -79,7 +77,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = parent::instantiateParentElement($parent); - $e->setAttribute('Uri', $this->getUri()); + $e->setAttribute('Uri', $this->getUri()->getValue()); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php index 99e1833d..3726bab7 100644 --- a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php +++ b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php @@ -7,9 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\fed\IssuerName; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\XsNamespace as NS; diff --git a/src/XML/fed/AbstractProofTokenType.php b/src/XML/fed/AbstractProofTokenType.php index ae5ef5ad..65df0434 100644 --- a/src/XML/fed/AbstractProofTokenType.php +++ b/src/XML/fed/AbstractProofTokenType.php @@ -6,10 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\SerializableElementInterface; use SimpleSAML\XML\XsNamespace as NS; diff --git a/src/XML/fed/AbstractPseudonymBasisType.php b/src/XML/fed/AbstractPseudonymBasisType.php index 816c9d0f..202498f7 100644 --- a/src/XML/fed/AbstractPseudonymBasisType.php +++ b/src/XML/fed/AbstractPseudonymBasisType.php @@ -6,12 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, TooManyElementsException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; use SimpleSAML\XML\XsNamespace as NS; use function array_pop; diff --git a/src/XML/fed/AbstractPseudonymServiceType.php b/src/XML/fed/AbstractPseudonymServiceType.php index b2cc1344..181aff39 100644 --- a/src/XML/fed/AbstractPseudonymServiceType.php +++ b/src/XML/fed/AbstractPseudonymServiceType.php @@ -6,12 +6,12 @@ use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\XML\md\Extensions; -use SimpleSAML\SAML2\XML\md\Organization; +use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; +use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; +use SimpleSAML\XML\Type\{DurationValue, IDValue}; /** * A PseudonymServiceType @@ -34,11 +34,11 @@ abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptor * PseudonymServiceType constructor. * * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param string|null $ID The ID for this document. Defaults to null. - * @param \DateTimeImmutable|null $validUntil Unix time of validity for this document. Defaults to null. - * @param string|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param string|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -53,18 +53,18 @@ abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptor * @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesRequested|null $claimTypesRequested * @param \SimpleSAML\WSSecurity\XML\fed\AutomaticPseudonyms|null $automaticPseudonyms * @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes - * @param string|null $serviceDisplayName - * @param string|null $serviceDescription + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDisplayName + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDescription * @param \SimpleSAML\WSSecurity\XML\fed\PseudonymServiceEndpoint[] $pseudonymServiceEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint */ final public function __construct( array $protocolSupportEnumeration, - ?string $ID = null, - ?DateTimeImmutable $validUntil = null, - ?string $cacheDuration = null, + ?IDValue $ID = null, + ?SAMLDateTimeValue $validUntil = null, + ?DurationValue $cacheDuration = null, ?Extensions $extensions = null, - ?string $errorURL = null, + ?SAMLAnyURIValue $errorURL = null, array $keyDescriptor = [], ?Organization $organization = null, array $contact = [], @@ -76,8 +76,8 @@ final public function __construct( ?ClaimTypesRequested $claimTypesRequested = null, ?AutomaticPseudonyms $automaticPseudonyms = null, ?TargetScopes $targetScopes = null, - ?string $serviceDisplayName = null, - ?string $serviceDescription = null, + ?SAMLStringValue $serviceDisplayName = null, + ?SAMLStringValue $serviceDescription = null, protected array $pseudonymServiceEndpoint = [], protected array $singleSignOutNotificationEndpoint = [], ) { diff --git a/src/XML/fed/AbstractPseudonymType.php b/src/XML/fed/AbstractPseudonymType.php index 20955d4e..3131667d 100644 --- a/src/XML/fed/AbstractPseudonymType.php +++ b/src/XML/fed/AbstractPseudonymType.php @@ -6,10 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractReferenceDigestType.php b/src/XML/fed/AbstractReferenceDigestType.php index ba478a8d..e70aab09 100644 --- a/src/XML/fed/AbstractReferenceDigestType.php +++ b/src/XML/fed/AbstractReferenceDigestType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Base64ElementTrait; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; +use SimpleSAML\XML\Type\Base64BinaryValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -19,17 +19,20 @@ abstract class AbstractReferenceDigestType extends AbstractFedElement { use ExtendableAttributesTrait; - use Base64ElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = Base64BinaryValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** - * @param string $content + * @param \SimpleSAML\XML\Type\Base64BinaryValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ - final public function __construct(string $content, array $namespacedAttributes) + final public function __construct(Base64BinaryValue $content, array $namespacedAttributes) { $this->setContent($content); $this->setAttributesNS($namespacedAttributes); @@ -48,7 +51,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, + Base64BinaryValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml), ); } @@ -63,7 +66,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/fed/AbstractReferenceTokenType.php b/src/XML/fed/AbstractReferenceTokenType.php index 615863c7..d5b584ec 100644 --- a/src/XML/fed/AbstractReferenceTokenType.php +++ b/src/XML/fed/AbstractReferenceTokenType.php @@ -6,11 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractRelativeToType.php b/src/XML/fed/AbstractRelativeToType.php index e0d16515..b5c374e2 100644 --- a/src/XML/fed/AbstractRelativeToType.php +++ b/src/XML/fed/AbstractRelativeToType.php @@ -7,8 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractRequestProofTokenType.php b/src/XML/fed/AbstractRequestProofTokenType.php index a273d8ad..36d94bf7 100644 --- a/src/XML/fed/AbstractRequestProofTokenType.php +++ b/src/XML/fed/AbstractRequestProofTokenType.php @@ -7,8 +7,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractRequestPseudonymType.php b/src/XML/fed/AbstractRequestPseudonymType.php index 60006485..982d3374 100644 --- a/src/XML/fed/AbstractRequestPseudonymType.php +++ b/src/XML/fed/AbstractRequestPseudonymType.php @@ -7,10 +7,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; +use SimpleSAML\XML\Type\BooleanValue; use SimpleSAML\XML\XsNamespace as NS; +use function var_export; + /** * Class defining the RequestPseudonymType element * @@ -31,14 +33,14 @@ abstract class AbstractRequestPseudonymType extends AbstractFedElement /** * AbstractRequestPseudonymType constructor * - * @param bool|null $SingleUse - * @param bool|null $Lookup + * @param \SimpleSAML\XML\Type\BooleanValue|null $SingleUse + * @param \SimpleSAML\XML\Type\BooleanValue|null $Lookup * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?bool $SingleUse = null, - protected ?bool $Lookup = null, + protected ?BooleanValue $SingleUse = null, + protected ?BooleanValue $Lookup = null, array $children = [], array $namespacedAttributes = [], ) { @@ -48,18 +50,18 @@ final public function __construct( /** - * @return bool|null + * @return \SimpleSAML\XML\Type\BooleanValue|null */ - public function getSingleUse(): ?bool + public function getSingleUse(): ?BooleanValue { return $this->SingleUse; } /** - * @return bool|null + * @return \SimpleSAML\XML\Type\BooleanValue|null */ - public function getLookup(): ?bool + public function getLookup(): ?BooleanValue { return $this->Lookup; } @@ -94,8 +96,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalBooleanAttribute($xml, 'SingleUse', null), - self::getOptionalBooleanAttribute($xml, 'Lookup', null), + self::getOptionalAttribute($xml, 'SingleUse', BooleanValue::class, null), + self::getOptionalAttribute($xml, 'Lookup', BooleanValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -114,12 +116,12 @@ public function toXML(?DOMElement $parent = null): DOMElement $singleUse = $this->getSingleUse(); if ($singleUse !== null) { - $e->setAttribute('SingleUse', $singleUse ? 'true' : 'false'); + $e->setAttribute('SingleUse', var_export($singleUse->toBoolean(), true)); } $lookup = $this->getLookup(); if ($lookup !== null) { - $e->setAttribute('Lookup', $lookup ? 'true' : 'false'); + $e->setAttribute('Lookup', var_export($lookup->toBoolean(), true)); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/fed/AbstractSecurityTokenServiceType.php b/src/XML/fed/AbstractSecurityTokenServiceType.php index 95481422..e8df0d39 100644 --- a/src/XML/fed/AbstractSecurityTokenServiceType.php +++ b/src/XML/fed/AbstractSecurityTokenServiceType.php @@ -4,15 +4,13 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\XML\md\Extensions; -use SimpleSAML\SAML2\XML\md\Organization; +use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; +use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; - +use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; +use SimpleSAML\XML\Type\{DurationValue, IDValue}; /** * A SecurityTokenServiceType * @@ -34,11 +32,11 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri * SecurityTokenServiceType constructor. * * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param string|null $ID The ID for this document. Defaults to null. - * @param \DateTimeImmutable|null $validUntil Unix time of validity for this document. Defaults to null. - * @param string|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\DateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param string|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptors An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -53,8 +51,8 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri * @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesRequested|null $claimTypesRequested * @param \SimpleSAML\WSSecurity\XML\fed\AutomaticPseudonyms|null $automaticPseudonyms * @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes - * @param string|null $serviceDisplayName - * @param string|null $serviceDescription + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDisplayName + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDescription * @param \SimpleSAML\WSSecurity\XML\fed\SecurityTokenServiceEndpoint[] $securityTokenServiceEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutSubscriptionEndpoint[] $singleSignOutSubscriptionEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint @@ -62,11 +60,11 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri */ final public function __construct( array $protocolSupportEnumeration, - ?string $ID = null, - ?DateTimeImmutable $validUntil = null, - ?string $cacheDuration = null, + ?IDValue $ID = null, + ?SAMLDateTimeValue $validUntil = null, + ?DurationValue $cacheDuration = null, ?Extensions $extensions = null, - ?string $errorURL = null, + ?SAMLAnyURIValue $errorURL = null, array $keyDescriptors = [], ?Organization $organization = null, array $contacts = [], @@ -78,8 +76,8 @@ final public function __construct( ?ClaimTypesRequested $claimTypesRequested = null, ?AutomaticPseudonyms $automaticPseudonyms = null, ?TargetScopes $targetScopes = null, - ?string $serviceDisplayName = null, - ?string $serviceDescription = null, + ?SAMLStringValue $serviceDisplayName = null, + ?SAMLStringValue $serviceDescription = null, protected array $securityTokenServiceEndpoint = [], protected array $singleSignOutSubscriptionEndpoint = [], protected array $singleSignOutNotificationEndpoint = [], diff --git a/src/XML/fed/AbstractSecurityTokenType.php b/src/XML/fed/AbstractSecurityTokenType.php index 5f434392..fba0da18 100644 --- a/src/XML/fed/AbstractSecurityTokenType.php +++ b/src/XML/fed/AbstractSecurityTokenType.php @@ -6,11 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractSignOutBasisType.php b/src/XML/fed/AbstractSignOutBasisType.php index 6ec44b4b..67c0a85b 100644 --- a/src/XML/fed/AbstractSignOutBasisType.php +++ b/src/XML/fed/AbstractSignOutBasisType.php @@ -6,10 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractSignOutType.php b/src/XML/fed/AbstractSignOutType.php index 6d43496c..88f79bee 100644 --- a/src/XML/fed/AbstractSignOutType.php +++ b/src/XML/fed/AbstractSignOutType.php @@ -8,11 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, TooManyElementsException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; +use SimpleSAML\XML\Type\NCNameValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -44,19 +42,17 @@ abstract class AbstractSignOutType extends AbstractFedElement * * @param \SimpleSAML\WSSecurity\XML\fed\SignOutBasis $signOutBasis * @param \SimpleSAML\WSSecurity\XML\fed\Realm|null $realm - * @param string|null $Id + * @param \SimpleSAML\XML\Type\NCNameValue|null $Id * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected SignOutBasis $signOutBasis, protected ?Realm $realm = null, - protected ?string $Id = null, + protected ?NCNameValue $Id = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($Id); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } @@ -87,9 +83,9 @@ public function getRealm(): ?Realm /** * Collect the value of the Id-property * - * @return string|null + * @return \SimpleSAML\XML\Type\NCNameValue|null */ - public function getId(): ?string + public function getId(): ?NCNameValue { return $this->Id; } @@ -119,7 +115,9 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($signOutBasis), array_pop($realm), - $xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id') ? $xml->getAttributeNS(C::NS_SEC_UTIL, 'Id') : null, + $xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id') + ? NCNameValue::fromString($xml->getAttributeNS(C::NS_SEC_UTIL, 'Id')) + : null, self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/fed/AbstractTokenType.php b/src/XML/fed/AbstractTokenType.php index 53e5ecbc..0219802f 100644 --- a/src/XML/fed/AbstractTokenType.php +++ b/src/XML/fed/AbstractTokenType.php @@ -6,10 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; +use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\XsNamespace as NS; /** @@ -32,26 +31,24 @@ abstract class AbstractTokenType extends AbstractFedElement /** * AbstractTokenType constructor * - * @param string|null $Uri + * @param \SimpleSAML\XML\Type\AnyURIValue|null $Uri * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $Uri = null, + protected ?AnyURIValue $Uri = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($Uri, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XML\Type\AnyURIValue|null */ - public function getUri(): ?string + public function getUri(): ?AnyURIValue { return $this->Uri; } @@ -85,7 +82,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Uri', null), + self::getOptionalAttribute($xml, 'Uri', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +100,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getUri() !== null) { - $e->setAttribute('Uri', $this->getUri()); + $e->setAttribute('Uri', $this->getUri()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/fed/AbstractTokenTypesOfferedType.php b/src/XML/fed/AbstractTokenTypesOfferedType.php index 0adc1803..af12cd47 100644 --- a/src/XML/fed/AbstractTokenTypesOfferedType.php +++ b/src/XML/fed/AbstractTokenTypesOfferedType.php @@ -7,11 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\fed\TokenType; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; +use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/src/XML/fed/AbstractWebServiceDescriptorType.php b/src/XML/fed/AbstractWebServiceDescriptorType.php index 64946ab0..cb0f5635 100644 --- a/src/XML/fed/AbstractWebServiceDescriptorType.php +++ b/src/XML/fed/AbstractWebServiceDescriptorType.php @@ -4,11 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\XML\md\AbstractRoleDescriptor; -use SimpleSAML\SAML2\XML\md\Extensions; -use SimpleSAML\SAML2\XML\md\Organization; +use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; +use SimpleSAML\SAML2\XML\md\{AbstractRoleDescriptor, Extensions, Organization}; +use SimpleSAML\XML\Type\{DurationValue, IDValue}; /** * An WebServiceDescriptorType @@ -22,11 +21,11 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptor * * @param string $type The xsi-type of the element * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param string|null $ID The ID for this document. Defaults to null. - * @param \DateTimeImmutable|null $validUntil Unix time of validity for this document. Defaults to null. - * @param string|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param string|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptors An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -41,17 +40,17 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptor * @param \SimpleSAML\WSSecurity\XML\fed\ClaimTypesRequested|null $claimTypesRequested * @param \SimpleSAML\WSSecurity\XML\fed\AutomaticPseudonyms|null $automaticPseudonyms * @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes - * @param string|null $serviceDisplayName - * @param string|null $serviceDescription + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDisplayName + * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDescription */ protected function __construct( string $type, array $protocolSupportEnumeration, - ?string $ID = null, - ?DateTimeImmutable $validUntil = null, - ?string $cacheDuration = null, + ?IDValue $ID = null, + ?SAMLDateTimeValue $validUntil = null, + ?DurationValue $cacheDuration = null, ?Extensions $extensions = null, - ?string $errorURL = null, + ?SAMLAnyURIValue $errorURL = null, array $keyDescriptors = [], ?Organization $organization = null, array $contacts = [], @@ -63,8 +62,8 @@ protected function __construct( protected ?ClaimTypesRequested $claimTypesRequested = null, protected ?AutomaticPseudonyms $automaticPseudonyms = null, protected ?TargetScopes $targetScopes = null, - protected ?string $serviceDisplayName = null, - protected ?string $serviceDescription = null, + protected ?SAMLStringValue $serviceDisplayName = null, + protected ?SAMLStringValue $serviceDescription = null, ) { parent::__construct( $type, @@ -162,9 +161,9 @@ public function getTargetScopes(): ?TargetScopes /** * Collect the value of the serviceDisplayName-property * - * @return string|null + * @return \SimpleSAML\SAML2\Type\SAMLStringValue|null */ - public function getServiceDisplayName(): ?string + public function getServiceDisplayName(): ?SAMLStringValue { return $this->serviceDisplayName; } @@ -173,9 +172,9 @@ public function getServiceDisplayName(): ?string /** * Collect the value of the serviceDescription-property * - * @return string|null + * @return \SimpleSAML\SAML2\Type\SAMLStringValue|null */ - public function getServiceDescription(): ?string + public function getServiceDescription(): ?SAMLStringValue { return $this->serviceDescription; } @@ -201,12 +200,12 @@ public function toUnsignedXML(?DOMElement $parent = null): DOMElement $serviceDisplayName = $this->getServiceDisplayName(); if ($serviceDisplayName !== null) { - $e->setAttribute('ServiceDisplayName', $serviceDisplayName); + $e->setAttribute('ServiceDisplayName', $serviceDisplayName->getValue()); } $serviceDescription = $this->getServiceDescription(); if ($serviceDescription !== null) { - $e->setAttribute('ServiceDescription', $serviceDescription); + $e->setAttribute('ServiceDescription', $serviceDescription->getValue()); } return $e; diff --git a/src/XML/fed/AutomaticPseudonyms.php b/src/XML/fed/AutomaticPseudonyms.php index ca6fe420..753757cd 100644 --- a/src/XML/fed/AutomaticPseudonyms.php +++ b/src/XML/fed/AutomaticPseudonyms.php @@ -4,14 +4,9 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\StringElementTrait; - -use function in_array; -use function sprintf; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XML\Type\BooleanValue; /** * A AutomaticPseudonyms element @@ -21,43 +16,8 @@ final class AutomaticPseudonyms extends AbstractFedElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use StringElementTrait; - - - /** - * @param bool $content - */ - public function __construct(bool $content) - { - $this->setContent($content ? 'true' : 'false'); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - Assert::oneOf( - $xml->textContent, - ['0', '1', 'false', 'true'], - sprintf( - 'The value \'%s\' of an %s:%s element must be a boolean.', - $xml->textContent, - static::NS_PREFIX, - static::getLocalName(), - ), - ); + use TypedTextContentTrait; - return new static(in_array($xml->textContent, ['1', 'true'], true)); - } + /** @var string */ + public const TEXTCONTENT_TYPE = BooleanValue::class; } diff --git a/src/XML/fed/Realm.php b/src/XML/fed/Realm.php index c9e5e9c0..38c2f0ca 100644 --- a/src/XML/fed/Realm.php +++ b/src/XML/fed/Realm.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\TypedTextContentTrait; /** * A Realm element @@ -15,14 +16,8 @@ final class Realm extends AbstractFedElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/fed/SecurityTokenServiceType.php b/src/XML/fed/SecurityTokenServiceType.php index b6f9693d..d3a30084 100644 --- a/src/XML/fed/SecurityTokenServiceType.php +++ b/src/XML/fed/SecurityTokenServiceType.php @@ -4,15 +4,14 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\Assert\Assert as SAMLAssert; +use SimpleSAML\SAML2\Assert\Assert; +use SimpleSAML\SAML2\Type\{SAMLDateTimeValue, SAMLStringValue}; use SimpleSAML\SAML2\XML\md\{ContactPerson, Extensions, KeyDescriptor, Organization}; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException, TooManyElementsException}; +use SimpleSAML\XML\Type\{DurationValue, IDValue}; use SimpleSAML\XMLSecurity\XML\ds\Signature; use function preg_split; @@ -51,8 +50,6 @@ public static function fromXML(DOMElement $xml): static Assert::same($type, static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME,); $protocols = self::getAttribute($xml, 'protocolSupportEnumeration'); - $validUntil = self::getOptionalAttribute($xml, 'validUntil', null); - SAMLAssert::nullOrValidDateTime($validUntil); $orgs = Organization::getChildrenOfClass($xml); Assert::maxCount( @@ -136,11 +133,11 @@ public static function fromXML(DOMElement $xml): static $securityTokenServiceType = new static( preg_split('/[\s]+/', trim($protocols)), - self::getOptionalAttribute($xml, 'ID', null), - $validUntil !== null ? new DateTimeImmutable($validUntil) : null, - self::getOptionalAttribute($xml, 'cacheDuration', null), + self::getOptionalAttribute($xml, 'ID', IDValue::class, null), + self::getOptionalAttribute($xml, 'validUntil', SAMLDateTimeValue, null), + self::getOptionalAttribute($xml, 'cacheDuration', DurationValue::class, null), array_pop($extensions), - self::getOptionalAttribute($xml, 'errorURL', null), + self::getOptionalAttribute($xml, 'errorURL', SAMLAnyURIValue::class, null), KeyDescriptor::getChildrenOfClass($xml), array_pop($orgs), ContactPerson::getChildrenOfClass($xml), @@ -152,8 +149,8 @@ public static function fromXML(DOMElement $xml): static array_pop($claimTypesRequested), array_pop($automaticPseudonyms), array_pop($targetScopes), - self::getOptionalAttribute($xml, 'ServiceDisplayName', null), - self::getOptionalAttribute($xml, 'ServiceDescription', null), + self::getOptionalAttribute($xml, 'ServiceDisplayName', SAMLStringValue::class, null), + self::getOptionalAttribute($xml, 'ServiceDescription', SAMLStringValue::class, null), SecurityTokenServiceEndpoint::getChildrenOfClass($xml), SingleSignOutSubscriptionEndpoint::getChildrenOfClass($xml), SingleSignOutNotificationEndpoint::getChildrenOfClass($xml), diff --git a/src/XML/wsa_200508/AbstractAttributedURIType.php b/src/XML/wsa_200508/AbstractAttributedURIType.php index 4477124c..642ce2b8 100644 --- a/src/XML/wsa_200508/AbstractAttributedURIType.php +++ b/src/XML/wsa_200508/AbstractAttributedURIType.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; /** @@ -22,7 +23,10 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement { use ExtendableAttributesTrait; - use URIElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -31,10 +35,10 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement /** * AbstractAttributedURIType constructor. * - * @param string $value The localized string. + * @param \SimpleSAML\XML\Type\AnyURIValue $value The localized URI. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(AnyURIValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -55,7 +59,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(AnyURIValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -68,7 +72,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/tests/WSSecurity/XML/auth/AdditionalContextTest.php b/tests/WSSecurity/XML/auth/AdditionalContextTest.php index fda0c8c9..8a37a1d9 100644 --- a/tests/WSSecurity/XML/auth/AdditionalContextTest.php +++ b/tests/WSSecurity/XML/auth/AdditionalContextTest.php @@ -4,20 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\auth\AbstractAdditionalContextType; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AdditionalContext; -use SimpleSAML\WSSecurity\XML\auth\ContextItem; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; -use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAdditionalContextType, + AbstractAuthElement, + AdditionalContext, + ContextItem, + Value, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; +use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; use function dirname; use function strval; @@ -57,13 +56,15 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'value2'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('value2')); $contextItem = new ContextItem( - C::NAMESPACE, - 'urn:x-simplesamlphp:scope', - new Value('someValue'), + AnyURIValue::fromString(C::NAMESPACE), + AnyURIValue::fromString('urn:x-simplesamlphp:scope'), + new Value( + StringValue::fromString('someValue'), + ), null, [$attr1], ); diff --git a/tests/WSSecurity/XML/auth/ClaimTypeTest.php b/tests/WSSecurity/XML/auth/ClaimTypeTest.php index edb10b4a..4737e47f 100644 --- a/tests/WSSecurity/XML/auth/ClaimTypeTest.php +++ b/tests/WSSecurity/XML/auth/ClaimTypeTest.php @@ -4,22 +4,22 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\Utils\XPath; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractClaimType; -use SimpleSAML\WSSecurity\XML\auth\ClaimType; -use SimpleSAML\WSSecurity\XML\auth\Description; -use SimpleSAML\WSSecurity\XML\auth\DisplayName; -use SimpleSAML\WSSecurity\XML\auth\DisplayValue; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; -use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractClaimType, + ClaimType, + Description, + DisplayName, + DisplayValue, + Value, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, DOMDocumentFactory}; +use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; +use SimpleSAML\XML\Type\{AnyURIValue, BooleanValue, StringValue}; use function dirname; use function strval; @@ -59,14 +59,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $claimType = new ClaimType( - C::NAMESPACE, - true, - new DisplayName('someDisplayName'), - new Description('someDescription'), - new DisplayValue('someDisplayValue'), - new Value('someValue'), + AnyURIValue::fromString(C::NAMESPACE), + BooleanValue::fromBoolean(true), + new DisplayName(StringValue::fromString('someDisplayName')), + new Description(StringValue::fromString('someDescription')), + new DisplayValue(StringValue::fromString('someDisplayValue')), + new Value(StringValue::fromString('someValue')), [$attr], ); @@ -81,14 +81,14 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $claimType = new ClaimType( - C::NAMESPACE, - true, - new DisplayName('someDisplayName'), - new Description('someDescription'), - new DisplayValue('someDisplayValue'), - new Value('someValue'), + AnyURIValue::fromString(C::NAMESPACE), + BooleanValue::fromBoolean(true), + new DisplayName(StringValue::fromString('someDisplayName')), + new Description(StringValue::fromString('someDescription')), + new DisplayValue(StringValue::fromString('someDisplayValue')), + new Value(StringValue::fromString('someValue')), [$attr], ); $claimTypeElement = $claimType->toXML(); diff --git a/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php index 5574b016..bf85d581 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php @@ -4,19 +4,18 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, DataProvider, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Assert\AssertionFailedException; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedManyValueType, + StructuredValue, + Value, + ValueOneOf, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\XML\Type\StringValue; /** * Tests for auth:ConstrainedManyValueType. @@ -51,7 +50,7 @@ public function testMarshallingEmpty(string $class): void #[DataProvider('classProvider')] public function testMarshallingIllegalCombination(string $class): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); @@ -61,7 +60,7 @@ public function testMarshallingIllegalCombination(string $class): void [$attr1], ); - $value = new Value('MyValue'); + $value = new Value(StringValue::fromString('MyValue')); $this->expectException(AssertionFailedException::class); new $class([$value], [$structuredValue]); diff --git a/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php index 9a7d7c0d..5c6f5db3 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php @@ -4,24 +4,23 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, DataProvider, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Assert\AssertionFailedException; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan; -use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual; -use SimpleSAML\WSSecurity\XML\auth\ValueLessThan; -use SimpleSAML\WSSecurity\XML\auth\ValueLessThanOrEqual; -use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; -use SimpleSAML\WSSecurity\XML\auth\ValueUpperBound; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + StructuredValue, + Value, + ValueGreaterThan, + ValueGreaterThanOrEqual, + ValueLessThan, + ValueLessThanOrEqual, + ValueLowerBound, + ValueUpperBound, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\XML\Type\StringValue; /** * Tests for auth:ConstrainedSingleValueType. @@ -60,7 +59,7 @@ public function testMarshallingEmpty(string $class): void #[DataProvider('classProvider')] public function testMarshallingIllegalCombination(string $class): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); @@ -70,7 +69,7 @@ public function testMarshallingIllegalCombination(string $class): void [$attr1], ); - $value = new Value('MyValue'); + $value = new Value(StringValue::fromString('MyValue')); $this->expectException(AssertionFailedException::class); new $class($value, $structuredValue); diff --git a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php index 63f1a4e9..5f75b0cc 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php @@ -4,22 +4,21 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, DataProvider, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedValueType; -use SimpleSAML\WSSecurity\XML\auth\ConstrainedValue; -//use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan; -use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual; -use SimpleSAML\WSSecurity\XML\auth\ValueLessThan; -use SimpleSAML\WSSecurity\XML\auth\ValueLessThanOrEqual; -use SimpleSAML\XML\Attribute as XMLAttribute; -//use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedValueType, + ConstrainedValue, + //StructuredValue, + Value, + ValueGreaterThan, + ValueGreaterThanOrEqual, + ValueLessThan, + ValueLessThanOrEqual, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute,/*Chunk,*/ DOMDocumentFactory}; +use SimpleSAML\XML\Type\{BooleanValue, StringValue}; use function dirname; use function strval; @@ -48,19 +47,19 @@ public static function setUpBeforeClass(): void { self::$resourcePath = dirname(__FILE__, 4) . '/resources/xml/'; - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); -/** + /** self::$structuredValue = new StructuredValue( [new Chunk($child->documentElement)], [$attr1], ); -*/ + */ - self::$value = new Value('MyValue'); + self::$value = new Value(StringValue::fromString('MyValue')); } @@ -91,7 +90,7 @@ public function testMarshalling(string $class, string $xmlRepresentation): void * ) $item */ $item = new $class(self::$value, null); - $constrainedValue = new ConstrainedValue($item, [], true); + $constrainedValue = new ConstrainedValue($item, [], BooleanValue::fromBoolean(true)); $this->assertEquals( $xmlRepresentation->saveXML($xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/auth/ContextItemTest.php b/tests/WSSecurity/XML/auth/ContextItemTest.php index 952c2828..5829f906 100644 --- a/tests/WSSecurity/XML/auth/ContextItemTest.php +++ b/tests/WSSecurity/XML/auth/ContextItemTest.php @@ -4,17 +4,18 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractContextItemType; -use SimpleSAML\WSSecurity\XML\auth\ContextItem; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractContextItemType, + ContextItem, + Value, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; use function dirname; use function strval; @@ -53,12 +54,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $contextItem = new ContextItem( - C::NAMESPACE, - 'urn:x-simplesamlphp:scope', - new Value('someValue'), + AnyURIValue::fromString(C::NAMESPACE), + AnyURIValue::fromString('urn:x-simplesamlphp:scope'), + new Value(StringValue::fromString('someValue')), null, [$attr1], ); diff --git a/tests/WSSecurity/XML/auth/DescriptionTest.php b/tests/WSSecurity/XML/auth/DescriptionTest.php index 8658f6b4..f0f67549 100644 --- a/tests/WSSecurity/XML/auth/DescriptionTest.php +++ b/tests/WSSecurity/XML/auth/DescriptionTest.php @@ -4,15 +4,12 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractDescriptionType; -use SimpleSAML\WSSecurity\XML\auth\Description; -use SimpleSAML\XML\Attribute; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractDescriptionType, Description}; +use SimpleSAML\XML\{Attribute, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -51,8 +48,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $description = new Description('MyDescription', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $description = new Description(StringValue::fromString('MyDescription'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/auth/DisplayNameTest.php b/tests/WSSecurity/XML/auth/DisplayNameTest.php index 09ccb5b5..f8cd3fe2 100644 --- a/tests/WSSecurity/XML/auth/DisplayNameTest.php +++ b/tests/WSSecurity/XML/auth/DisplayNameTest.php @@ -4,15 +4,12 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractDisplayNameType; -use SimpleSAML\WSSecurity\XML\auth\DisplayName; -use SimpleSAML\XML\Attribute; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractDisplayNameType, DisplayName}; +use SimpleSAML\XML\{Attribute, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -51,8 +48,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $displayName = new DisplayName('MyFancyDisplayName', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $displayName = new DisplayName(StringValue::fromString('MyFancyDisplayName'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/auth/DisplayValueTest.php b/tests/WSSecurity/XML/auth/DisplayValueTest.php index ff594ba8..e3659491 100644 --- a/tests/WSSecurity/XML/auth/DisplayValueTest.php +++ b/tests/WSSecurity/XML/auth/DisplayValueTest.php @@ -4,15 +4,12 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractDisplayValueType; -use SimpleSAML\WSSecurity\XML\auth\DisplayValue; -use SimpleSAML\XML\Attribute; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractDisplayValueType, DisplayValue}; +use SimpleSAML\XML\{Attribute, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -51,8 +48,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $displayValue = new DisplayValue('MyValue', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $displayValue = new DisplayValue(StringValue::fromString('MyValue'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/auth/EncryptedValueTest.php b/tests/WSSecurity/XML/auth/EncryptedValueTest.php index 433d05b4..6e9e6d45 100644 --- a/tests/WSSecurity/XML/auth/EncryptedValueTest.php +++ b/tests/WSSecurity/XML/auth/EncryptedValueTest.php @@ -4,20 +4,14 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractEncryptedValueType; -use SimpleSAML\WSSecurity\XML\auth\EncryptedValue; +use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractEncryptedValueType, EncryptedValue}; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XMLSecurity\XML\ds\KeyInfo; -use SimpleSAML\XMLSecurity\XML\xenc\CipherData; -use SimpleSAML\XMLSecurity\XML\xenc\CipherValue; -use SimpleSAML\XMLSecurity\XML\xenc\EncryptedData; -use SimpleSAML\XMLSecurity\XML\xenc\EncryptedKey; -use SimpleSAML\XMLSecurity\XML\xenc\EncryptionMethod; +use SimpleSAML\XMLSecurity\XML\xenc\{CipherData, CipherValue, EncryptedData, EncryptedKey, EncryptionMethod}; +use SimpleSAML\XML\Type\{AnyURIValue, Base64BinaryValue, IDValue, StringValue}; use function dirname; use function strval; @@ -57,29 +51,41 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $encryptedData = new EncryptedData( - new CipherData(new CipherValue('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=')), - 'MyID', - 'http://www.w3.org/2001/04/xmlenc#Element', - 'text/plain', - 'urn:x-simplesamlphp:encoding', - new EncryptionMethod('http://www.w3.org/2001/04/xmlenc#aes128-cbc'), + new CipherData( + new CipherValue( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + ), + ), + IDValue::fromString('MyID'), + AnyURIValue::fromString('http://www.w3.org/2001/04/xmlenc#Element'), + StringValue::fromString('text/plain'), + AnyURIValue::fromString('urn:x-simplesamlphp:encoding'), + new EncryptionMethod( + AnyURIValue::fromString('http://www.w3.org/2001/04/xmlenc#aes128-cbc'), + ), new KeyInfo( [ new EncryptedKey( - new CipherData(new CipherValue('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=')), + new CipherData( + new CipherValue( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + ), + ), null, null, null, null, null, null, - new EncryptionMethod('http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'), + new EncryptionMethod( + AnyURIValue::fromString('http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'), + ), ), ], ), ); - $encryptedValue = new EncryptedValue($encryptedData, 'urn:some:uri'); + $encryptedValue = new EncryptedValue($encryptedData, AnyURIValue::fromString('urn:some:uri')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/auth/StructuredValueTest.php b/tests/WSSecurity/XML/auth/StructuredValueTest.php index 22775671..6a2f90cc 100644 --- a/tests/WSSecurity/XML/auth/StructuredValueTest.php +++ b/tests/WSSecurity/XML/auth/StructuredValueTest.php @@ -4,16 +4,12 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractStructuredValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractStructuredValueType, StructuredValue}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -52,7 +48,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php b/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php index bcf8f0d2..0c10b7d1 100644 --- a/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php +++ b/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php @@ -4,17 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + StructuredValue, + ValueGreaterThanOrEqual, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -53,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php b/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php index 98920174..fa49b391 100644 --- a/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php +++ b/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php @@ -4,17 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + StructuredValue, + ValueGreaterThan, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -53,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/auth/ValueInRangenTest.php b/tests/WSSecurity/XML/auth/ValueInRangenTest.php index 026f0ced..069a3392 100644 --- a/tests/WSSecurity/XML/auth/ValueInRangenTest.php +++ b/tests/WSSecurity/XML/auth/ValueInRangenTest.php @@ -4,20 +4,20 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractValueInRangeType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\WSSecurity\XML\auth\ValueInRangen; -use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; -use SimpleSAML\WSSecurity\XML\auth\ValueUpperBound; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractValueInRangeType, + StructuredValue, + Value, + ValueInRangen, + ValueLowerBound, + ValueUpperBound, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -56,7 +56,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); @@ -67,7 +67,10 @@ public function testMarshalling(): void ); $valueUpperBound = new ValueUpperBound(null, $structuredValue); - $valueLowerBound = new ValueLowerBound(new Value('MyValue'), null); + $valueLowerBound = new ValueLowerBound( + new Value(StringValue::fromString('MyValue')), + null, + ); $valueInRangen = new ValueInRangen($valueUpperBound, $valueLowerBound); $this->assertEquals( diff --git a/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php b/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php index eb7140a7..f0d83ce5 100644 --- a/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php +++ b/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php @@ -4,18 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\ValueLessThanOrEqual; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + StructuredValue, + ValueLessThanOrEqual, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; - +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -53,7 +52,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/auth/ValueLessThanTest.php b/tests/WSSecurity/XML/auth/ValueLessThanTest.php index 713c6a10..be96c61f 100644 --- a/tests/WSSecurity/XML/auth/ValueLessThanTest.php +++ b/tests/WSSecurity/XML/auth/ValueLessThanTest.php @@ -4,17 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\ValueLessThan; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + StructuredValue, + ValueLessThan, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -53,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php b/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php index 9cb336fe..5da1ba1e 100644 --- a/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php +++ b/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php @@ -4,15 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + Value, + ValueLowerBound, +}; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -51,7 +53,9 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $valueLowerBound = new ValueLowerBound(new Value('MyValue')); + $valueLowerBound = new ValueLowerBound( + new Value(StringValue::fromString('MyValue')), + ); $this->assertFalse($valueLowerBound->isEmptyElement()); $this->assertEquals( diff --git a/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php b/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php index 2855afa6..b37e760a 100644 --- a/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php +++ b/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php @@ -4,17 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedManyValueType, + StructuredValue, + ValueOneOf, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -53,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $child1 = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php b/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php index d9ba4522..bf95d211 100644 --- a/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php +++ b/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php @@ -4,15 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType; -use SimpleSAML\WSSecurity\XML\auth\Value; -use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedManyValueType, + Value, + ValueOneOf, +}; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -51,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $value1 = new Value('MyValue'); - $value2 = new Value('MyOtherValue'); + $value1 = new Value(StringValue::fromString('MyValue')); + $value2 = new Value(StringValue::fromString('MyOtherValue')); $valueOneOf = new ValueOneOf([$value1, $value2]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/auth/ValueTest.php b/tests/WSSecurity/XML/auth/ValueTest.php index 7838072f..30bac83b 100644 --- a/tests/WSSecurity/XML/auth/ValueTest.php +++ b/tests/WSSecurity/XML/auth/ValueTest.php @@ -4,13 +4,12 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, Value}; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -48,7 +47,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $value = new Value('MyValue'); + $value = new Value(StringValue::fromString('MyValue')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php b/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php index 103ddef4..8be72c46 100644 --- a/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php +++ b/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php @@ -4,17 +4,17 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; -use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; -use SimpleSAML\WSSecurity\XML\auth\StructuredValue; -use SimpleSAML\WSSecurity\XML\auth\ValueUpperBound; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\auth\{ + AbstractAuthElement, + AbstractConstrainedSingleValueType, + StructuredValue, + ValueUpperBound, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; @@ -53,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/fed/ReferenceDigestTest.php b/tests/WSSecurity/XML/fed/ReferenceDigestTest.php index 418850f4..9b0e6811 100644 --- a/tests/WSSecurity/XML/fed/ReferenceDigestTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceDigestTest.php @@ -4,16 +4,14 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; -use SimpleSAML\WSSecurity\XML\fed\AbstractReferenceDigestType; -use SimpleSAML\WSSecurity\XML\fed\ReferenceDigest; +use SimpleSAML\WSSecurity\XML\fed\{AbstractFedElement, AbstractReferenceDigestType, ReferenceDigest}; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\{Base64BinaryValue, StringValue}; use function dirname; @@ -51,8 +49,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $referenceDigest = new ReferenceDigest('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=', [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $referenceDigest = new ReferenceDigest( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/ReferenceEPRTest.php b/tests/WSSecurity/XML/fed/ReferenceEPRTest.php index c02ad901..3b508bab 100644 --- a/tests/WSSecurity/XML/fed/ReferenceEPRTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceEPRTest.php @@ -5,19 +5,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; use DOMElement; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\WSSecurity\XML\fed\ReferenceEPR; -use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractEndpointReferenceType; -use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; -use SimpleSAML\WSSecurity\XML\wsa_200508\Address; -use SimpleSAML\WSSecurity\XML\wsa_200508\Metadata; -use SimpleSAML\WSSecurity\XML\wsa_200508\ReferenceParameters; -use SimpleSAML\XML\Attribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\wsa_200508\{ + AbstractEndpointReferenceType, + AbstractWsaElement, + Address, + Metadata, + ReferenceParameters, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; use function dirname; use function strval; @@ -78,17 +78,20 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', 'testval3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', 'testval4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', StringValue::fromString('testval4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr3]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr4]); $chunk = new Chunk(self::$customContent); $referenceEPR = new ReferenceEPR( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address( + AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), + [$attr2], + ), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/ReferenceToken11Test.php b/tests/WSSecurity/XML/fed/ReferenceToken11Test.php index 25d311cd..406ff367 100644 --- a/tests/WSSecurity/XML/fed/ReferenceToken11Test.php +++ b/tests/WSSecurity/XML/fed/ReferenceToken11Test.php @@ -4,18 +4,13 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; -use SimpleSAML\WSSecurity\XML\fed\ReferenceToken11; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; -use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\WSSecurity\XML\fed\{AbstractAssertionType, AbstractFedElement, ReferenceToken11}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; +use SimpleSAML\XML\Type\StringValue; use function dirname; @@ -50,7 +45,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_ReferenceToken11.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/ReferenceTokenTest.php b/tests/WSSecurity/XML/fed/ReferenceTokenTest.php index 93f5fea2..dcc6717c 100644 --- a/tests/WSSecurity/XML/fed/ReferenceTokenTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceTokenTest.php @@ -5,26 +5,27 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; use DOMElement; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\AbstractReferenceTokenType; -use SimpleSAML\WSSecurity\XML\fed\ReferenceDigest; -use SimpleSAML\WSSecurity\XML\fed\ReferenceEPR; -use SimpleSAML\WSSecurity\XML\fed\ReferenceToken; -use SimpleSAML\WSSecurity\XML\fed\ReferenceType; -use SimpleSAML\WSSecurity\XML\fed\SerialNo; -use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractEndpointReferenceType; -use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; -use SimpleSAML\WSSecurity\XML\wsa_200508\Address; -use SimpleSAML\WSSecurity\XML\wsa_200508\Metadata; -use SimpleSAML\WSSecurity\XML\wsa_200508\ReferenceParameters; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; -use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\WSSecurity\XML\fed\{ + AbstractReferenceTokenType, + ReferenceDigest, + ReferenceEPR, + ReferenceToken, + ReferenceType, + SerialNo, +}; +use SimpleSAML\WSSecurity\XML\wsa_200508\{ + AbstractEndpointReferenceType, + AbstractWsaElement, + Address, + Metadata, + ReferenceParameters, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; +use SimpleSAML\XML\Type\{AnyURIValue, Base64BinaryValue, StringValue}; use function dirname; use function strval; @@ -99,14 +100,14 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr3', 'testval3'); - $attr4 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr4', 'testval4'); - $attr5 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr5', 'testval5'); - $attr6 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr6', 'testval6'); - $attr7 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr7', 'testval7'); - $attr8 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr8', 'testval8'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr4', StringValue::fromString('testval4')); + $attr5 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr5', StringValue::fromString('testval5')); + $attr6 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr6', StringValue::fromString('testval6')); + $attr7 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr7', StringValue::fromString('testval7')); + $attr8 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr8', StringValue::fromString('testval8')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr5]); @@ -114,16 +115,22 @@ public function testMarshalling(): void $some = new Chunk(self::$some); $referenceEPR = new ReferenceEPR( - new Address('https://login.microsoftonline.com/login.srf', [$attr3]), + new Address( + AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), + [$attr3], + ), $referenceParameters, $metadata, [$chunk], [$attr2], ); - $referenceDigest = new ReferenceDigest('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=', [$attr6]); - $referenceType = new ReferenceType(C::NAMESPACE, [$attr7]); - $serialNo = new SerialNo(C::NAMESPACE, [$attr8]); + $referenceDigest = new ReferenceDigest( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + [$attr6], + ); + $referenceType = new ReferenceType(AnyURIValue::fromString(C::NAMESPACE), [$attr7]); + $serialNo = new SerialNo(AnyURIValue::fromString(C::NAMESPACE), [$attr8]); $referenceToken = new ReferenceToken( [$referenceEPR], diff --git a/tests/WSSecurity/XML/fed/ReferenceTypeTest.php b/tests/WSSecurity/XML/fed/ReferenceTypeTest.php index c0800da3..23e3339f 100644 --- a/tests/WSSecurity/XML/fed/ReferenceTypeTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceTypeTest.php @@ -4,17 +4,18 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\AbstractAttributeExtensibleString; -use SimpleSAML\WSSecurity\XML\fed\AbstractAttributeExtensibleURI; -use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; -use SimpleSAML\WSSecurity\XML\fed\ReferenceType; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\WSSecurity\XML\fed\{ + AbstractAttributeExtensibleString, + AbstractAttributeExtensibleURI, + AbstractFedElement, + ReferenceType, +}; +use SimpleSAML\XML\{Attribute as XMLAttribute, DOMDocumentFactory}; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; use function dirname; @@ -53,8 +54,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $referenceType = new ReferenceType(C::NAMESPACE, [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $referenceType = new ReferenceType(AnyURIValue::fromString(C::NAMESPACE), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/RequestPseudonymTest.php b/tests/WSSecurity/XML/fed/RequestPseudonymTest.php index 4bf44b6d..41e42882 100644 --- a/tests/WSSecurity/XML/fed/RequestPseudonymTest.php +++ b/tests/WSSecurity/XML/fed/RequestPseudonymTest.php @@ -4,17 +4,12 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\{CoversClass, Group}; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; -use SimpleSAML\WSSecurity\XML\fed\AbstractRequestPseudonymType; -use SimpleSAML\WSSecurity\XML\fed\RequestPseudonym; -use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; -use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\WSSecurity\XML\fed\{AbstractFedElement, AbstractRequestPseudonymType, RequestPseudonym}; +use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; +use SimpleSAML\XML\Type\{BooleanValue, StringValue}; use function dirname; use function strval; @@ -54,14 +49,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $requestPseudonym = new RequestPseudonym( - true, - false, + BooleanValue::fromBoolean(true), + BooleanValue::fromBoolean(false), [new Chunk($child->documentElement)], [$attr1], ); From 61bf2451256f15fe72e9955c4aa07cefbe036ae9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 26 Jul 2025 22:19:11 +0200 Subject: [PATCH 02/34] Bump dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 04140c9c..e44686c5 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,12 @@ "simplesamlphp/assert": "~1.9.2", "simplesamlphp/saml2": "dev-feature/xsd-types", - "simplesamlphp/xml-common": "dev-feature/xsd-types", - "simplesamlphp/xml-security": "dev-feature/xsd-types", - "simplesamlphp/xml-soap": "dev-feature/xsd-types" + "simplesamlphp/xml-common": "~2.0.1", + "simplesamlphp/xml-security": "~2.0.0", + "simplesamlphp/xml-soap": "~2.0.1" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.9.2" + "simplesamlphp/simplesamlphp-test-framework": "~1.9.3" }, "autoload": { "psr-4": { From 8728946816625610bf54fbb04f5c559f26d1f8b7 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 12 Oct 2025 23:09:42 +0200 Subject: [PATCH 03/34] Migrate to xsd-types --- composer.json | 4 +- .../auth/AbstractAdditionalContextType.php | 9 +++-- src/XML/auth/AbstractClaimType.php | 39 ++++++++++--------- .../auth/AbstractConstrainedManyValueType.php | 4 +- .../AbstractConstrainedSingleValueType.php | 5 ++- src/XML/auth/AbstractConstrainedValueType.php | 14 ++++--- src/XML/auth/AbstractContextItemType.php | 22 ++++++----- src/XML/auth/AbstractDescriptionType.php | 13 ++++--- src/XML/auth/AbstractDisplayNameType.php | 13 ++++--- src/XML/auth/AbstractDisplayValueType.php | 13 ++++--- src/XML/auth/AbstractEncryptedValueType.php | 17 ++++---- src/XML/auth/AbstractStructuredValueType.php | 9 +++-- src/XML/auth/AbstractValueInRangeType.php | 4 +- src/XML/auth/AdditionalContext.php | 3 +- src/XML/auth/ClaimType.php | 3 +- src/XML/auth/Value.php | 2 +- .../fed/AbstractApplicationServiceType.php | 1 - src/XML/fed/AbstractFreshnessType.php | 2 - src/XML/fed/AbstractProofTokenType.php | 10 +++-- src/XML/fed/AbstractPseudonymBasisType.php | 12 ++++-- src/XML/fed/AbstractPseudonymServiceType.php | 36 +++++++++++------ src/XML/fed/AbstractPseudonymType.php | 10 +++-- src/XML/fed/AbstractReferenceDigestType.php | 11 +++--- src/XML/fed/AbstractReferenceTokenType.php | 11 ++++-- src/XML/fed/AbstractRelativeToType.php | 9 +++-- src/XML/fed/AbstractRequestProofTokenType.php | 9 +++-- src/XML/fed/AbstractRequestPseudonymType.php | 19 ++++----- .../fed/AbstractSecurityTokenServiceType.php | 36 +++++++++++------ src/XML/fed/AbstractSecurityTokenType.php | 11 ++++-- src/XML/fed/AbstractSignOutBasisType.php | 10 +++-- src/XML/fed/AbstractSignOutType.php | 17 ++++---- src/XML/fed/AbstractTokenType.php | 16 ++++---- src/XML/fed/AbstractTokenTypesOfferedType.php | 11 ++++-- .../fed/AbstractWebServiceDescriptorType.php | 33 ++++++++++------ src/XML/fed/AutomaticPseudonyms.php | 5 ++- src/XML/fed/Realm.php | 5 ++- src/XML/fed/SecurityTokenServiceType.php | 38 ++++++++++-------- 37 files changed, 283 insertions(+), 203 deletions(-) diff --git a/composer.json b/composer.json index e44686c5..2fad8f83 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ "simplesamlphp/assert": "~1.9.2", "simplesamlphp/saml2": "dev-feature/xsd-types", - "simplesamlphp/xml-common": "~2.0.1", - "simplesamlphp/xml-security": "~2.0.0", + "simplesamlphp/xml-common": "~2.0.3", + "simplesamlphp/xml-security": "~2.0.3", "simplesamlphp/xml-soap": "~2.0.1" }, "require-dev": { diff --git a/src/XML/auth/AbstractAdditionalContextType.php b/src/XML/auth/AbstractAdditionalContextType.php index 5eb371b0..7475f2a9 100644 --- a/src/XML/auth/AbstractAdditionalContextType.php +++ b/src/XML/auth/AbstractAdditionalContextType.php @@ -7,9 +7,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\auth\ContextItem; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the AdditionalContextType element @@ -62,7 +63,7 @@ public function getContextItem(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractClaimType.php b/src/XML/auth/AbstractClaimType.php index 9884fc87..74421a7f 100644 --- a/src/XML/auth/AbstractClaimType.php +++ b/src/XML/auth/AbstractClaimType.php @@ -6,20 +6,21 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\WSSecurity\XML\auth\{ - ConstrainedValue, - Description, - DisplayName, - DisplayValue, - EncryptedValue, - StructuredValue, - Value, -}; -use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, TooManyElementsException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; -use SimpleSAML\XML\Type\{AnyURIValue, BooleanValue}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\WSSecurity\XML\auth\ConstrainedValue; +use SimpleSAML\WSSecurity\XML\auth\Description; +use SimpleSAML\WSSecurity\XML\auth\DisplayName; +use SimpleSAML\WSSecurity\XML\auth\DisplayValue; +use SimpleSAML\WSSecurity\XML\auth\EncryptedValue; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_filter; use function array_merge; @@ -46,8 +47,8 @@ abstract class AbstractClaimType extends AbstractAuthElement /** * AbstractClaimType constructor * - * @param \SimpleSAML\XML\Type\AnyURIValue $uri - * @param \SimpleSAML\XML\Type\BooleanValue|null $optional + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $uri + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $optional * @param \SimpleSAML\WSSecurity\XML\auth\DisplayName|null $displayName * @param \SimpleSAML\WSSecurity\XML\auth\Description|null $description * @param \SimpleSAML\WSSecurity\XML\auth\DisplayValue|null $displayValue @@ -138,7 +139,7 @@ public function getDescription(): ?Description /** * Get the value of the uri property. * - * @return \SimpleSAML\XML\Type\AnyURIValue + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ public function getURI(): AnyURIValue { @@ -149,7 +150,7 @@ public function getURI(): AnyURIValue /** * Get the value of the optional property. * - * @return \SimpleSAML\XML\Type\BooleanValue|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ public function getOptional(): ?BooleanValue { @@ -163,7 +164,7 @@ public function getOptional(): ?BooleanValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractConstrainedManyValueType.php b/src/XML/auth/AbstractConstrainedManyValueType.php index af274230..be47a326 100644 --- a/src/XML/auth/AbstractConstrainedManyValueType.php +++ b/src/XML/auth/AbstractConstrainedManyValueType.php @@ -6,7 +6,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * Class representing WS-authorization ConstrainedManyValueType. @@ -72,7 +72,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractConstrainedSingleValueType.php b/src/XML/auth/AbstractConstrainedSingleValueType.php index 73ef02f6..fc10a7c6 100644 --- a/src/XML/auth/AbstractConstrainedSingleValueType.php +++ b/src/XML/auth/AbstractConstrainedSingleValueType.php @@ -6,7 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, TooManyElementsException}; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use function array_pop; @@ -74,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractConstrainedValueType.php b/src/XML/auth/AbstractConstrainedValueType.php index 25fcb85c..40916fce 100644 --- a/src/XML/auth/AbstractConstrainedValueType.php +++ b/src/XML/auth/AbstractConstrainedValueType.php @@ -6,10 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, TooManyElementsException}; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\Type\BooleanValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_filter; use function array_merge; @@ -41,7 +43,7 @@ abstract class AbstractConstrainedValueType extends AbstractAuthElement * \SimpleSAML\WSSecurity\XML\auth\ValueOneOf * ) $value * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param \SimpleSAML\XML\Type\BooleanValue|null $assertConstraint + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $assertConstraint */ final public function __construct( protected ValueLessThan|ValueLessThanOrEqual|ValueGreaterThan|ValueGreaterThanOrEqual|ValueInRangen|ValueOneOf $value, @@ -73,7 +75,7 @@ public function getValue(): ValueLessThan|ValueLessThanOrEqual|ValueGreaterThan| /** * Get the value of the assertConstraint property. * - * @return \SimpleSAML\XML\Type\BooleanValue|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ public function getAssertConstraint(): ?BooleanValue { @@ -87,7 +89,7 @@ public function getAssertConstraint(): ?BooleanValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractContextItemType.php b/src/XML/auth/AbstractContextItemType.php index 86c143d6..1d123b64 100644 --- a/src/XML/auth/AbstractContextItemType.php +++ b/src/XML/auth/AbstractContextItemType.php @@ -6,10 +6,14 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException, TooManyElementsException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -33,8 +37,8 @@ abstract class AbstractContextItemType extends AbstractAuthElement /** * AbstractContextItemType constructor * - * @param \SimpleSAML\XML\Type\AnyURIValue $Name - * @param \SimpleSAML\XML\Type\AnyURIValue|null $Scope + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $Name + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Scope * @param \SimpleSAML\WSSecurity\XML\auth\Value|null $value * @param \SimpleSAML\XML\SerializableElementInterface|null $child * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes @@ -71,7 +75,7 @@ public function getValue(): ?Value /** * Get the value of the Name property. * - * @return \SimpleSAML\XML\Type\AnyURIValue + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ public function getName(): AnyURIValue { @@ -82,7 +86,7 @@ public function getName(): AnyURIValue /** * Get the value of the Scope property. * - * @return \SimpleSAML\XML\Type\AnyURIValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ public function getScope(): ?AnyURIValue { @@ -96,7 +100,7 @@ public function getScope(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractDescriptionType.php b/src/XML/auth/AbstractDescriptionType.php index 49606ce1..c4f21fd5 100644 --- a/src/XML/auth/AbstractDescriptionType.php +++ b/src/XML/auth/AbstractDescriptionType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; -use SimpleSAML\XML\Type\StringValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-authorization DescriptionType. @@ -31,7 +32,7 @@ abstract class AbstractDescriptionType extends AbstractAuthElement /** * AbstractDescriptionType constructor. * - * @param \SimpleSAML\XML\Type\StringValue $value The value string. + * @param \SimpleSAML\XMLSchema\Type\StringValue $value The value string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct(StringValue $value, array $namespacedAttributes = []) @@ -47,7 +48,7 @@ final public function __construct(StringValue $value, array $namespacedAttribute * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractDisplayNameType.php b/src/XML/auth/AbstractDisplayNameType.php index 1c119efb..7a8d8dfb 100644 --- a/src/XML/auth/AbstractDisplayNameType.php +++ b/src/XML/auth/AbstractDisplayNameType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; -use SimpleSAML\XML\Type\StringValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-authorization DisplayNameType. @@ -31,7 +32,7 @@ abstract class AbstractDisplayNameType extends AbstractAuthElement /** * AbstractDisplayNameType constructor. * - * @param \SimpleSAML\XML\Type\StringValue $value The value string. + * @param \SimpleSAML\XMLSchema\Type\StringValue $value The value string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct(StringValue $value, array $namespacedAttributes = []) @@ -47,7 +48,7 @@ final public function __construct(StringValue $value, array $namespacedAttribute * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractDisplayValueType.php b/src/XML/auth/AbstractDisplayValueType.php index caae2361..73a916e5 100644 --- a/src/XML/auth/AbstractDisplayValueType.php +++ b/src/XML/auth/AbstractDisplayValueType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; -use SimpleSAML\XML\Type\StringValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-authorization DisplayValueType. @@ -31,7 +32,7 @@ abstract class AbstractDisplayValueType extends AbstractAuthElement /** * AbstractDisplayValueType constructor. * - * @param \SimpleSAML\XML\Type\StringValue $value The value string. + * @param \SimpleSAML\XMLSchema\Type\StringValue $value The value string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct(StringValue $value, array $namespacedAttributes = []) @@ -47,7 +48,7 @@ final public function __construct(StringValue $value, array $namespacedAttribute * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractEncryptedValueType.php b/src/XML/auth/AbstractEncryptedValueType.php index f6b646f8..5946632c 100644 --- a/src/XML/auth/AbstractEncryptedValueType.php +++ b/src/XML/auth/AbstractEncryptedValueType.php @@ -6,13 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{ - InvalidDOMElementException, - MissingElementException, - SchemaViolationException, - TooManyElementsException, -}; -use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSecurity\XML\xenc\EncryptedData; use function array_pop; @@ -28,7 +25,7 @@ abstract class AbstractEncryptedValueType extends AbstractAuthElement * AbstractEncryptedValueType constructor. * * @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedData $encryptedData - * @param \SimpleSAML\XML\Type\AnyURIValue|null $descriptionCondition + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $descriptionCondition */ final public function __construct( protected EncryptedData $encryptedData, @@ -40,7 +37,7 @@ final public function __construct( /** * Get the value of the $descriptionCondition property. * - * @return \SimpleSAML\XML\Type\AnyURIValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ public function getDescriptionCondition(): ?AnyURIValue { @@ -65,7 +62,7 @@ public function getEncryptedData(): EncryptedData * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractStructuredValueType.php b/src/XML/auth/AbstractStructuredValueType.php index 386e4a4a..99a7a61c 100644 --- a/src/XML/auth/AbstractStructuredValueType.php +++ b/src/XML/auth/AbstractStructuredValueType.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the StructuredValueType element @@ -51,7 +52,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AbstractValueInRangeType.php b/src/XML/auth/AbstractValueInRangeType.php index e7bd0b48..678cb095 100644 --- a/src/XML/auth/AbstractValueInRangeType.php +++ b/src/XML/auth/AbstractValueInRangeType.php @@ -6,7 +6,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use function array_pop; @@ -36,7 +36,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/auth/AdditionalContext.php b/src/XML/auth/AdditionalContext.php index 3947be4c..d7441da8 100644 --- a/src/XML/auth/AdditionalContext.php +++ b/src/XML/auth/AdditionalContext.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\auth; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class representing WS-authorization AdditionalContext. diff --git a/src/XML/auth/ClaimType.php b/src/XML/auth/ClaimType.php index 46662f70..5ec7d3e9 100644 --- a/src/XML/auth/ClaimType.php +++ b/src/XML/auth/ClaimType.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\auth; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class representing WS-authorization ClaimType. diff --git a/src/XML/auth/Value.php b/src/XML/auth/Value.php index e2045200..3ac8dc87 100644 --- a/src/XML/auth/Value.php +++ b/src/XML/auth/Value.php @@ -4,8 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\auth; -use SimpleSAML\XML\Type\StringValue; use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Class representing WS-authorization Value. diff --git a/src/XML/fed/AbstractApplicationServiceType.php b/src/XML/fed/AbstractApplicationServiceType.php index a3a4ca41..d502c00d 100644 --- a/src/XML/fed/AbstractApplicationServiceType.php +++ b/src/XML/fed/AbstractApplicationServiceType.php @@ -4,7 +4,6 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DateTimeImmutable; use DOMElement; use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; diff --git a/src/XML/fed/AbstractFreshnessType.php b/src/XML/fed/AbstractFreshnessType.php index 08cd5015..83cd44f4 100644 --- a/src/XML/fed/AbstractFreshnessType.php +++ b/src/XML/fed/AbstractFreshnessType.php @@ -11,8 +11,6 @@ use SimpleSAML\XML\Type\{BooleanValue, UnsignedIntValue}; use SimpleSAML\XML\XsNamespace as NS; -use function intval; -use function sprintf; use function var_export; /** diff --git a/src/XML/fed/AbstractProofTokenType.php b/src/XML/fed/AbstractProofTokenType.php index 65df0434..0b58c6d2 100644 --- a/src/XML/fed/AbstractProofTokenType.php +++ b/src/XML/fed/AbstractProofTokenType.php @@ -6,10 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ProofTokenType element @@ -49,7 +51,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractPseudonymBasisType.php b/src/XML/fed/AbstractPseudonymBasisType.php index 202498f7..e333d9b3 100644 --- a/src/XML/fed/AbstractPseudonymBasisType.php +++ b/src/XML/fed/AbstractPseudonymBasisType.php @@ -6,9 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, TooManyElementsException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -50,7 +54,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractPseudonymServiceType.php b/src/XML/fed/AbstractPseudonymServiceType.php index 181aff39..8dd85ed6 100644 --- a/src/XML/fed/AbstractPseudonymServiceType.php +++ b/src/XML/fed/AbstractPseudonymServiceType.php @@ -4,14 +4,20 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use DateTimeImmutable; use DOMElement; -use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; -use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; +use SimpleSAML\SAML2\Type\AnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLDateTimeValue; +use SimpleSAML\SAML2\Type\SAMLStringValue; +use SimpleSAML\SAML2\XML\md\Extensions; +use SimpleSAML\SAML2\XML\md\Organization; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; -use SimpleSAML\XML\Type\{DurationValue, IDValue}; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\DurationValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * A PseudonymServiceType @@ -33,12 +39,17 @@ abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptor /** * PseudonymServiceType constructor. * - * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. - * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $type + * @param \SimpleSAML\SAML2\Type\AnyURIListValue $protocolSupportEnumeration + * A set of URI specifying the protocols supported. + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil + * Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration + * Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL + * An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -59,7 +70,8 @@ abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptor * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint */ final public function __construct( - array $protocolSupportEnumeration, + QNameValue $type, + AnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, @@ -94,7 +106,7 @@ final public function __construct( ); parent::__construct( - static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME, + $type, $protocolSupportEnumeration, $ID, $validUntil, diff --git a/src/XML/fed/AbstractPseudonymType.php b/src/XML/fed/AbstractPseudonymType.php index 3131667d..3ba0bbdc 100644 --- a/src/XML/fed/AbstractPseudonymType.php +++ b/src/XML/fed/AbstractPseudonymType.php @@ -6,9 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A PseudonymType @@ -80,7 +82,7 @@ public function getRelativeTo(): RelativeTo * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractReferenceDigestType.php b/src/XML/fed/AbstractReferenceDigestType.php index e70aab09..96305464 100644 --- a/src/XML/fed/AbstractReferenceDigestType.php +++ b/src/XML/fed/AbstractReferenceDigestType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; -use SimpleSAML\XML\Type\Base64BinaryValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * An AbstractReferenceDigestType element @@ -29,7 +30,7 @@ abstract class AbstractReferenceDigestType extends AbstractFedElement /** - * @param \SimpleSAML\XML\Type\Base64BinaryValue $content + * @param \SimpleSAML\XMLSchema\Type\Base64BinaryValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ final public function __construct(Base64BinaryValue $content, array $namespacedAttributes) diff --git a/src/XML/fed/AbstractReferenceTokenType.php b/src/XML/fed/AbstractReferenceTokenType.php index d5b584ec..4351e554 100644 --- a/src/XML/fed/AbstractReferenceTokenType.php +++ b/src/XML/fed/AbstractReferenceTokenType.php @@ -6,9 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A ReferenceTokenType @@ -107,7 +110,7 @@ public function getSerialNo(): ?SerialNo * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractRelativeToType.php b/src/XML/fed/AbstractRelativeToType.php index b5c374e2..62bb9ccd 100644 --- a/src/XML/fed/AbstractRelativeToType.php +++ b/src/XML/fed/AbstractRelativeToType.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RelativeToType element @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractRequestProofTokenType.php b/src/XML/fed/AbstractRequestProofTokenType.php index 36d94bf7..58e142b2 100644 --- a/src/XML/fed/AbstractRequestProofTokenType.php +++ b/src/XML/fed/AbstractRequestProofTokenType.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestProofTokenType element @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractRequestPseudonymType.php b/src/XML/fed/AbstractRequestPseudonymType.php index 982d3374..91b34a89 100644 --- a/src/XML/fed/AbstractRequestPseudonymType.php +++ b/src/XML/fed/AbstractRequestPseudonymType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\Type\BooleanValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function var_export; @@ -33,8 +34,8 @@ abstract class AbstractRequestPseudonymType extends AbstractFedElement /** * AbstractRequestPseudonymType constructor * - * @param \SimpleSAML\XML\Type\BooleanValue|null $SingleUse - * @param \SimpleSAML\XML\Type\BooleanValue|null $Lookup + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $SingleUse + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $Lookup * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ @@ -50,7 +51,7 @@ final public function __construct( /** - * @return \SimpleSAML\XML\Type\BooleanValue|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ public function getSingleUse(): ?BooleanValue { @@ -59,7 +60,7 @@ public function getSingleUse(): ?BooleanValue /** - * @return \SimpleSAML\XML\Type\BooleanValue|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ public function getLookup(): ?BooleanValue { @@ -87,7 +88,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractSecurityTokenServiceType.php b/src/XML/fed/AbstractSecurityTokenServiceType.php index e8df0d39..ffbc10c3 100644 --- a/src/XML/fed/AbstractSecurityTokenServiceType.php +++ b/src/XML/fed/AbstractSecurityTokenServiceType.php @@ -5,12 +5,20 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; -use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; +use SimpleSAML\SAML2\Type\AnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLDateTimeValue; +use SimpleSAML\SAML2\Type\SAMLStringValue; +use SimpleSAML\SAML2\XML\md\Extensions; +use SimpleSAML\SAML2\XML\md\Organization; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; -use SimpleSAML\XML\Type\{DurationValue, IDValue}; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\DurationValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\QNameValue; + /** * A SecurityTokenServiceType * @@ -31,12 +39,17 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri /** * SecurityTokenServiceType constructor. * - * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. - * @param \SimpleSAML\SAML2\Type\DateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $type + * @param \SimpleSAML\SAML2\Type\AnyURIListValue $protocolSupportEnumeration + * A set of URI specifying the protocols supported. + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil + * Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration + * Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL + * An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptors An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -59,7 +72,8 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri * @param \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] $passiveRequestorEndpoint */ final public function __construct( - array $protocolSupportEnumeration, + QNameValue $type, + AnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, @@ -106,7 +120,7 @@ final public function __construct( ); parent::__construct( - static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME, + $type, $protocolSupportEnumeration, $ID, $validUntil, diff --git a/src/XML/fed/AbstractSecurityTokenType.php b/src/XML/fed/AbstractSecurityTokenType.php index fba0da18..be18473e 100644 --- a/src/XML/fed/AbstractSecurityTokenType.php +++ b/src/XML/fed/AbstractSecurityTokenType.php @@ -6,9 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait, SerializableElementInterface}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\SerializableElementInterface; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the SecurityTokenType element @@ -48,7 +51,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractSignOutBasisType.php b/src/XML/fed/AbstractSignOutBasisType.php index 67c0a85b..e248c6e1 100644 --- a/src/XML/fed/AbstractSignOutBasisType.php +++ b/src/XML/fed/AbstractSignOutBasisType.php @@ -6,9 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A SignOutBasisType @@ -50,7 +52,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractSignOutType.php b/src/XML/fed/AbstractSignOutType.php index 88f79bee..740ac85e 100644 --- a/src/XML/fed/AbstractSignOutType.php +++ b/src/XML/fed/AbstractSignOutType.php @@ -8,10 +8,13 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, TooManyElementsException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\Type\NCNameValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A SignOutType @@ -42,7 +45,7 @@ abstract class AbstractSignOutType extends AbstractFedElement * * @param \SimpleSAML\WSSecurity\XML\fed\SignOutBasis $signOutBasis * @param \SimpleSAML\WSSecurity\XML\fed\Realm|null $realm - * @param \SimpleSAML\XML\Type\NCNameValue|null $Id + * @param \SimpleSAML\XMLSchema\Type\NCNameValue|null $Id * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ @@ -83,7 +86,7 @@ public function getRealm(): ?Realm /** * Collect the value of the Id-property * - * @return \SimpleSAML\XML\Type\NCNameValue|null + * @return \SimpleSAML\XMLSchema\Type\NCNameValue|null */ public function getId(): ?NCNameValue { @@ -97,7 +100,7 @@ public function getId(): ?NCNameValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractTokenType.php b/src/XML/fed/AbstractTokenType.php index 0219802f..3f438ce2 100644 --- a/src/XML/fed/AbstractTokenType.php +++ b/src/XML/fed/AbstractTokenType.php @@ -6,10 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the TokenType element @@ -31,7 +33,7 @@ abstract class AbstractTokenType extends AbstractFedElement /** * AbstractTokenType constructor * - * @param \SimpleSAML\XML\Type\AnyURIValue|null $Uri + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Uri * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ @@ -46,7 +48,7 @@ final public function __construct( /** - * @return \SimpleSAML\XML\Type\AnyURIValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ public function getUri(): ?AnyURIValue { @@ -73,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractTokenTypesOfferedType.php b/src/XML/fed/AbstractTokenTypesOfferedType.php index af12cd47..5f8f16a4 100644 --- a/src/XML/fed/AbstractTokenTypesOfferedType.php +++ b/src/XML/fed/AbstractTokenTypesOfferedType.php @@ -7,9 +7,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\fed\TokenType; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the TokenTypesOffered element @@ -63,7 +66,7 @@ public function getTokenType(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractWebServiceDescriptorType.php b/src/XML/fed/AbstractWebServiceDescriptorType.php index cb0f5635..5f5d7e6e 100644 --- a/src/XML/fed/AbstractWebServiceDescriptorType.php +++ b/src/XML/fed/AbstractWebServiceDescriptorType.php @@ -5,9 +5,16 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; -use SimpleSAML\SAML2\XML\md\{AbstractRoleDescriptor, Extensions, Organization}; -use SimpleSAML\XML\Type\{DurationValue, IDValue}; +use SimpleSAML\SAML2\Type\AnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLDateTimeValue; +use SimpleSAML\SAML2\Type\SAMLStringValue; +use SimpleSAML\SAML2\XML\md\AbstractRoleDescriptor; +use SimpleSAML\SAML2\XML\md\Extensions; +use SimpleSAML\SAML2\XML\md\Organization; +use SimpleSAML\XMLSchema\Type\DurationValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * An WebServiceDescriptorType @@ -19,13 +26,17 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptor /** * WebServiceDescriptorType constructor. * - * @param string $type The xsi-type of the element - * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. - * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi-type of the element + * @param \SimpleSAML\SAML2\Type\AnyURIListValue $protocolSupportEnumeration + * A set of URI specifying the protocols supported. + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil + * Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration + * Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL + * An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptors An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization @@ -44,8 +55,8 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptor * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $serviceDescription */ protected function __construct( - string $type, - array $protocolSupportEnumeration, + QNameValue $type, + AnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, diff --git a/src/XML/fed/AutomaticPseudonyms.php b/src/XML/fed/AutomaticPseudonyms.php index 753757cd..746bd39a 100644 --- a/src/XML/fed/AutomaticPseudonyms.php +++ b/src/XML/fed/AutomaticPseudonyms.php @@ -4,9 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * A AutomaticPseudonyms element diff --git a/src/XML/fed/Realm.php b/src/XML/fed/Realm.php index 38c2f0ca..7d2da008 100644 --- a/src/XML/fed/Realm.php +++ b/src/XML/fed/Realm.php @@ -4,9 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A Realm element diff --git a/src/XML/fed/SecurityTokenServiceType.php b/src/XML/fed/SecurityTokenServiceType.php index d3a30084..c675b770 100644 --- a/src/XML/fed/SecurityTokenServiceType.php +++ b/src/XML/fed/SecurityTokenServiceType.php @@ -5,17 +5,24 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Assert\Assert; -use SimpleSAML\SAML2\Type\{SAMLDateTimeValue, SAMLStringValue}; -use SimpleSAML\SAML2\XML\md\{ContactPerson, Extensions, KeyDescriptor, Organization}; +use SimpleSAML\SAML2\Type\AnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLDateTimeValue; +use SimpleSAML\SAML2\Type\SAMLStringValue; +use SimpleSAML\SAML2\XML\md\ContactPerson; +use SimpleSAML\SAML2\XML\md\Extensions; +use SimpleSAML\SAML2\XML\md\KeyDescriptor; +use SimpleSAML\SAML2\XML\md\Organization; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException, TooManyElementsException}; -use SimpleSAML\XML\Type\{DurationValue, IDValue}; +use SimpleSAML\XMLSchema\Constants as C; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\DurationValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSecurity\XML\ds\Signature; -use function preg_split; - /** * Class representing WS-federation SecurityTokenServiceType RoleDescriptor. * @@ -29,9 +36,9 @@ final class SecurityTokenServiceType extends AbstractSecurityTokenServiceType * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong - * @throws \SimpleSAML\XML\Exception\TooManyElementsException + * @throws \SimpleSAML\XMLSchema\Exception\TooManyElementsException * if too many child-elements of a type are specified */ public static function fromXML(DOMElement $xml): static @@ -45,11 +52,7 @@ public static function fromXML(DOMElement $xml): static SchemaViolationException::class, ); - $type = $xml->getAttributeNS(C::NS_XSI, 'type'); - Assert::validQName($type, SchemaViolationException::class); - Assert::same($type, static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME,); - - $protocols = self::getAttribute($xml, 'protocolSupportEnumeration'); + $type = QNameValue::fromDocument($xml->getAttributeNS(C::NS_XSI, 'type'), $xml); $orgs = Organization::getChildrenOfClass($xml); Assert::maxCount( @@ -132,9 +135,10 @@ public static function fromXML(DOMElement $xml): static ); $securityTokenServiceType = new static( - preg_split('/[\s]+/', trim($protocols)), + $type, + self::getAttribute($xml, 'protocolSupportEnumeration', AnyURIListValue::class), self::getOptionalAttribute($xml, 'ID', IDValue::class, null), - self::getOptionalAttribute($xml, 'validUntil', SAMLDateTimeValue, null), + self::getOptionalAttribute($xml, 'validUntil', SAMLDateTimeValue::class, null), self::getOptionalAttribute($xml, 'cacheDuration', DurationValue::class, null), array_pop($extensions), self::getOptionalAttribute($xml, 'errorURL', SAMLAnyURIValue::class, null), From 78f16df79fc90f1b7a626ebdbe2b7dc7b9b3e054 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 14 Oct 2025 22:40:04 +0200 Subject: [PATCH 04/34] Migrate to xsd-types --- src/XML/mssp/MustNotSendCancel.php | 3 ++- src/XML/mssp/RequireClientCertificate.php | 3 ++- src/XML/mssp/RsaToken.php | 3 ++- src/XML/mssp/SslContextToken.php | 3 ++- src/XML/sp_200507/AlgorithmSuite.php | 3 ++- src/XML/sp_200507/AsymmetricBinding.php | 3 ++- src/XML/sp_200507/Basic128.php | 3 ++- src/XML/sp_200507/Basic128Rsa15.php | 3 ++- src/XML/sp_200507/Basic128Sha256.php | 3 ++- src/XML/sp_200507/Basic128Sha256Rsa15.php | 3 ++- src/XML/sp_200507/Basic192.php | 3 ++- src/XML/sp_200507/Basic192Rsa15.php | 3 ++- src/XML/sp_200507/Basic192Sha256.php | 3 ++- src/XML/sp_200507/Basic192Sha256Rsa15.php | 3 ++- src/XML/sp_200507/Basic256.php | 3 ++- src/XML/sp_200507/Basic256Rsa15.php | 3 ++- src/XML/sp_200507/Basic256Sha256.php | 3 ++- src/XML/sp_200507/Basic256Sha256Rsa15.php | 3 ++- src/XML/sp_200507/BootstrapPolicy.php | 3 ++- src/XML/sp_200507/EncryptBeforeSigning.php | 3 ++- src/XML/sp_200507/EncryptSignature.php | 3 ++- src/XML/sp_200507/EncryptedElements.php | 3 ++- src/XML/sp_200507/EncryptedParts.php | 3 ++- src/XML/sp_200507/EncryptionToken.php | 3 ++- src/XML/sp_200507/EndorsingSupportingTokens.php | 3 ++- src/XML/sp_200507/HttpsToken.php | 3 ++- src/XML/sp_200507/IncludeTimestamp.php | 3 ++- src/XML/sp_200507/InclusiveC14N.php | 3 ++- src/XML/sp_200507/InitiatorToken.php | 3 ++- src/XML/sp_200507/IssuedToken.php | 3 ++- src/XML/sp_200507/KerberosToken.php | 3 ++- src/XML/sp_200507/Lax.php | 3 ++- src/XML/sp_200507/LaxTsFirst.php | 3 ++- src/XML/sp_200507/LaxTsLast.php | 3 ++- src/XML/sp_200507/Layout.php | 3 ++- src/XML/sp_200507/MustSupportClientChallenge.php | 3 ++- src/XML/sp_200507/MustSupportIssuedTokens.php | 3 ++- src/XML/sp_200507/MustSupportRefEmbeddedToken.php | 3 ++- src/XML/sp_200507/MustSupportRefEncryptedKey.php | 3 ++- src/XML/sp_200507/MustSupportRefExternalURI.php | 3 ++- src/XML/sp_200507/MustSupportRefIssuerSerial.php | 3 ++- src/XML/sp_200507/MustSupportRefKeyIdentifier.php | 3 ++- src/XML/sp_200507/MustSupportRefThumbprint.php | 3 ++- src/XML/sp_200507/MustSupportServerChallenge.php | 3 ++- src/XML/sp_200507/OnlySignEntireHeadersAndBody.php | 3 ++- src/XML/sp_200507/ProtectTokens.php | 3 ++- src/XML/sp_200507/ProtectionToken.php | 3 ++- src/XML/sp_200507/RecipientToken.php | 3 ++- src/XML/sp_200507/RelToken.php | 3 ++- src/XML/sp_200507/RequireClientEntropy.php | 3 ++- src/XML/sp_200507/RequireDerivedKeys.php | 3 ++- src/XML/sp_200507/RequireEmbeddedTokenReference.php | 3 ++- src/XML/sp_200507/RequireExternalReference.php | 3 ++- src/XML/sp_200507/RequireExternalUriReference.php | 3 ++- src/XML/sp_200507/RequireInternalReference.php | 3 ++- src/XML/sp_200507/RequireIssuerSerialReference.php | 3 ++- src/XML/sp_200507/RequireKeyIdentifierReference.php | 3 ++- src/XML/sp_200507/RequireServerEntropy.php | 3 ++- src/XML/sp_200507/RequireSignatureConfirmation.php | 3 ++- src/XML/sp_200507/RequireThumbprintReference.php | 3 ++- src/XML/sp_200507/RequiredElements.php | 3 ++- src/XML/sp_200507/SC10SecurityContextToken.php | 3 ++- src/XML/sp_200507/SOAPNormalization10.php | 3 ++- src/XML/sp_200507/STRTransform10.php | 3 ++- src/XML/sp_200507/SamlToken.php | 3 ++- src/XML/sp_200507/SecureConversationToken.php | 3 ++- src/XML/sp_200507/SecurityContextToken.php | 3 ++- src/XML/sp_200507/SignatureToken.php | 3 ++- src/XML/sp_200507/SignedElements.php | 3 ++- src/XML/sp_200507/SignedEndorsingSupportingTokens.php | 3 ++- src/XML/sp_200507/SignedParts.php | 3 ++- src/XML/sp_200507/SignedSupportingTokens.php | 3 ++- src/XML/sp_200507/SpnegoContextToken.php | 3 ++- src/XML/sp_200507/Strict.php | 3 ++- src/XML/sp_200507/SupportingTokens.php | 3 ++- src/XML/sp_200507/SymmetricBinding.php | 3 ++- src/XML/sp_200507/TransportBinding.php | 3 ++- src/XML/sp_200507/TransportToken.php | 3 ++- src/XML/sp_200507/TripleDes.php | 3 ++- src/XML/sp_200507/TripleDesRsa15.php | 3 ++- src/XML/sp_200507/TripleDesSha256.php | 3 ++- src/XML/sp_200507/TripleDesSha256Rsa15.php | 3 ++- src/XML/sp_200507/Trust10.php | 3 ++- src/XML/sp_200507/UsernameToken.php | 3 ++- src/XML/sp_200507/Wss10.php | 3 ++- src/XML/sp_200507/Wss11.php | 3 ++- src/XML/sp_200507/WssGssKerberosV5ApReqToken11.php | 3 ++- src/XML/sp_200507/WssKerberosV5ApReqToken11.php | 3 ++- src/XML/sp_200507/WssRelV10Token10.php | 3 ++- src/XML/sp_200507/WssRelV10Token11.php | 3 ++- src/XML/sp_200507/WssRelV20Token10.php | 3 ++- src/XML/sp_200507/WssRelV20Token11.php | 3 ++- src/XML/sp_200507/WssSamlV10Token10.php | 3 ++- src/XML/sp_200507/WssSamlV10Token11.php | 3 ++- src/XML/sp_200507/WssSamlV11Token10.php | 3 ++- src/XML/sp_200507/WssSamlV11Token11.php | 3 ++- src/XML/sp_200507/WssSamlV20Token11.php | 3 ++- src/XML/sp_200507/WssUsernameToken10.php | 3 ++- src/XML/sp_200507/WssUsernameToken11.php | 3 ++- src/XML/sp_200507/WssX509Pkcs7Token10.php | 3 ++- src/XML/sp_200507/WssX509Pkcs7Token11.php | 3 ++- src/XML/sp_200507/WssX509PkiPathV1Token10.php | 3 ++- src/XML/sp_200507/WssX509PkiPathV1Token11.php | 3 ++- src/XML/sp_200507/WssX509V1Token10.php | 3 ++- src/XML/sp_200507/WssX509V1Token11.php | 3 ++- src/XML/sp_200507/WssX509V3Token10.php | 3 ++- src/XML/sp_200507/WssX509V3Token11.php | 3 ++- src/XML/sp_200507/X509Token.php | 3 ++- src/XML/sp_200507/XPathFilter20.php | 3 ++- 109 files changed, 218 insertions(+), 109 deletions(-) diff --git a/src/XML/mssp/MustNotSendCancel.php b/src/XML/mssp/MustNotSendCancel.php index 16da52ff..ed3209da 100644 --- a/src/XML/mssp/MustNotSendCancel.php +++ b/src/XML/mssp/MustNotSendCancel.php @@ -6,7 +6,8 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractQNameAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustNotSendCancel element diff --git a/src/XML/mssp/RequireClientCertificate.php b/src/XML/mssp/RequireClientCertificate.php index aefb2fe2..3484957a 100644 --- a/src/XML/mssp/RequireClientCertificate.php +++ b/src/XML/mssp/RequireClientCertificate.php @@ -6,7 +6,8 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractQNameAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireClientCertificate element diff --git a/src/XML/mssp/RsaToken.php b/src/XML/mssp/RsaToken.php index 3fc6d062..f72042c1 100644 --- a/src/XML/mssp/RsaToken.php +++ b/src/XML/mssp/RsaToken.php @@ -6,7 +6,8 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RsaToken element diff --git a/src/XML/mssp/SslContextToken.php b/src/XML/mssp/SslContextToken.php index ce028fa4..97723ad1 100644 --- a/src/XML/mssp/SslContextToken.php +++ b/src/XML/mssp/SslContextToken.php @@ -6,7 +6,8 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SslContextToken element diff --git a/src/XML/sp_200507/AlgorithmSuite.php b/src/XML/sp_200507/AlgorithmSuite.php index c5baabcd..e6907db5 100644 --- a/src/XML/sp_200507/AlgorithmSuite.php +++ b/src/XML/sp_200507/AlgorithmSuite.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AlgorithmSuite element diff --git a/src/XML/sp_200507/AsymmetricBinding.php b/src/XML/sp_200507/AsymmetricBinding.php index ed61b160..de1a8276 100644 --- a/src/XML/sp_200507/AsymmetricBinding.php +++ b/src/XML/sp_200507/AsymmetricBinding.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AsymmetricBinding element diff --git a/src/XML/sp_200507/Basic128.php b/src/XML/sp_200507/Basic128.php index ed4d69d1..5762fe7f 100644 --- a/src/XML/sp_200507/Basic128.php +++ b/src/XML/sp_200507/Basic128.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128 element diff --git a/src/XML/sp_200507/Basic128Rsa15.php b/src/XML/sp_200507/Basic128Rsa15.php index 8e329d29..a30f18bd 100644 --- a/src/XML/sp_200507/Basic128Rsa15.php +++ b/src/XML/sp_200507/Basic128Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128Rsa15 element diff --git a/src/XML/sp_200507/Basic128Sha256.php b/src/XML/sp_200507/Basic128Sha256.php index 55589af6..39ebe27f 100644 --- a/src/XML/sp_200507/Basic128Sha256.php +++ b/src/XML/sp_200507/Basic128Sha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128Sha256 element diff --git a/src/XML/sp_200507/Basic128Sha256Rsa15.php b/src/XML/sp_200507/Basic128Sha256Rsa15.php index 5e12ef78..565dc3cd 100644 --- a/src/XML/sp_200507/Basic128Sha256Rsa15.php +++ b/src/XML/sp_200507/Basic128Sha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128Sha256Rsa15 element diff --git a/src/XML/sp_200507/Basic192.php b/src/XML/sp_200507/Basic192.php index 029184bf..33edb32d 100644 --- a/src/XML/sp_200507/Basic192.php +++ b/src/XML/sp_200507/Basic192.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192 element diff --git a/src/XML/sp_200507/Basic192Rsa15.php b/src/XML/sp_200507/Basic192Rsa15.php index 336cb5eb..d35496f5 100644 --- a/src/XML/sp_200507/Basic192Rsa15.php +++ b/src/XML/sp_200507/Basic192Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192Rsa15 element diff --git a/src/XML/sp_200507/Basic192Sha256.php b/src/XML/sp_200507/Basic192Sha256.php index a96027bb..a3a3fd98 100644 --- a/src/XML/sp_200507/Basic192Sha256.php +++ b/src/XML/sp_200507/Basic192Sha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192Sha256 element diff --git a/src/XML/sp_200507/Basic192Sha256Rsa15.php b/src/XML/sp_200507/Basic192Sha256Rsa15.php index 701eff63..26b9a9ef 100644 --- a/src/XML/sp_200507/Basic192Sha256Rsa15.php +++ b/src/XML/sp_200507/Basic192Sha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192Sha256Rsa15 element diff --git a/src/XML/sp_200507/Basic256.php b/src/XML/sp_200507/Basic256.php index 4204b042..73ca1632 100644 --- a/src/XML/sp_200507/Basic256.php +++ b/src/XML/sp_200507/Basic256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256 element diff --git a/src/XML/sp_200507/Basic256Rsa15.php b/src/XML/sp_200507/Basic256Rsa15.php index ffb87370..d1380b5f 100644 --- a/src/XML/sp_200507/Basic256Rsa15.php +++ b/src/XML/sp_200507/Basic256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256Rsa15 element diff --git a/src/XML/sp_200507/Basic256Sha256.php b/src/XML/sp_200507/Basic256Sha256.php index 00ac7468..3e74c8fc 100644 --- a/src/XML/sp_200507/Basic256Sha256.php +++ b/src/XML/sp_200507/Basic256Sha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256Sha256 element diff --git a/src/XML/sp_200507/Basic256Sha256Rsa15.php b/src/XML/sp_200507/Basic256Sha256Rsa15.php index 2d4a19d2..62dce9ce 100644 --- a/src/XML/sp_200507/Basic256Sha256Rsa15.php +++ b/src/XML/sp_200507/Basic256Sha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256Sha256Rsa15 element diff --git a/src/XML/sp_200507/BootstrapPolicy.php b/src/XML/sp_200507/BootstrapPolicy.php index 7185fc5c..86639114 100644 --- a/src/XML/sp_200507/BootstrapPolicy.php +++ b/src/XML/sp_200507/BootstrapPolicy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A BootstrapPolicy element diff --git a/src/XML/sp_200507/EncryptBeforeSigning.php b/src/XML/sp_200507/EncryptBeforeSigning.php index 2ea8bfb7..fcdfdc8b 100644 --- a/src/XML/sp_200507/EncryptBeforeSigning.php +++ b/src/XML/sp_200507/EncryptBeforeSigning.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptBeforeSigning element diff --git a/src/XML/sp_200507/EncryptSignature.php b/src/XML/sp_200507/EncryptSignature.php index 7d1b3191..a22e5351 100644 --- a/src/XML/sp_200507/EncryptSignature.php +++ b/src/XML/sp_200507/EncryptSignature.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptSignature element diff --git a/src/XML/sp_200507/EncryptedElements.php b/src/XML/sp_200507/EncryptedElements.php index 84d67630..ee300025 100644 --- a/src/XML/sp_200507/EncryptedElements.php +++ b/src/XML/sp_200507/EncryptedElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptedElements element diff --git a/src/XML/sp_200507/EncryptedParts.php b/src/XML/sp_200507/EncryptedParts.php index 87dede98..53c42eb5 100644 --- a/src/XML/sp_200507/EncryptedParts.php +++ b/src/XML/sp_200507/EncryptedParts.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptedParts element diff --git a/src/XML/sp_200507/EncryptionToken.php b/src/XML/sp_200507/EncryptionToken.php index 4e220049..41351ba4 100644 --- a/src/XML/sp_200507/EncryptionToken.php +++ b/src/XML/sp_200507/EncryptionToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A EncryptionToken element diff --git a/src/XML/sp_200507/EndorsingSupportingTokens.php b/src/XML/sp_200507/EndorsingSupportingTokens.php index f5530d5c..0bfb781c 100644 --- a/src/XML/sp_200507/EndorsingSupportingTokens.php +++ b/src/XML/sp_200507/EndorsingSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A EndorsingSupportingTokens element diff --git a/src/XML/sp_200507/HttpsToken.php b/src/XML/sp_200507/HttpsToken.php index 44d685e1..600d231c 100644 --- a/src/XML/sp_200507/HttpsToken.php +++ b/src/XML/sp_200507/HttpsToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An HttpsToken element diff --git a/src/XML/sp_200507/IncludeTimestamp.php b/src/XML/sp_200507/IncludeTimestamp.php index 4454fc32..fabf0d91 100644 --- a/src/XML/sp_200507/IncludeTimestamp.php +++ b/src/XML/sp_200507/IncludeTimestamp.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An IncludeTimestamp element diff --git a/src/XML/sp_200507/InclusiveC14N.php b/src/XML/sp_200507/InclusiveC14N.php index dc8e5250..31f9a38a 100644 --- a/src/XML/sp_200507/InclusiveC14N.php +++ b/src/XML/sp_200507/InclusiveC14N.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An InclusiveC14N element diff --git a/src/XML/sp_200507/InitiatorToken.php b/src/XML/sp_200507/InitiatorToken.php index a46fb613..0e7202f7 100644 --- a/src/XML/sp_200507/InitiatorToken.php +++ b/src/XML/sp_200507/InitiatorToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An InitiatorToken element diff --git a/src/XML/sp_200507/IssuedToken.php b/src/XML/sp_200507/IssuedToken.php index 1fb725e0..e368f98a 100644 --- a/src/XML/sp_200507/IssuedToken.php +++ b/src/XML/sp_200507/IssuedToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An IssuedToken element diff --git a/src/XML/sp_200507/KerberosToken.php b/src/XML/sp_200507/KerberosToken.php index d5cdaf4e..5e582a3c 100644 --- a/src/XML/sp_200507/KerberosToken.php +++ b/src/XML/sp_200507/KerberosToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An KerberosToken element diff --git a/src/XML/sp_200507/Lax.php b/src/XML/sp_200507/Lax.php index 532ad0c2..87783856 100644 --- a/src/XML/sp_200507/Lax.php +++ b/src/XML/sp_200507/Lax.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Lax element diff --git a/src/XML/sp_200507/LaxTsFirst.php b/src/XML/sp_200507/LaxTsFirst.php index 377e0b17..95c710d4 100644 --- a/src/XML/sp_200507/LaxTsFirst.php +++ b/src/XML/sp_200507/LaxTsFirst.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An LaxTsFirst element diff --git a/src/XML/sp_200507/LaxTsLast.php b/src/XML/sp_200507/LaxTsLast.php index 8ca9099b..b128f754 100644 --- a/src/XML/sp_200507/LaxTsLast.php +++ b/src/XML/sp_200507/LaxTsLast.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An LaxTsLast element diff --git a/src/XML/sp_200507/Layout.php b/src/XML/sp_200507/Layout.php index ee6e19ec..2c2266b7 100644 --- a/src/XML/sp_200507/Layout.php +++ b/src/XML/sp_200507/Layout.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Layout element diff --git a/src/XML/sp_200507/MustSupportClientChallenge.php b/src/XML/sp_200507/MustSupportClientChallenge.php index 90386a2b..11c5adfd 100644 --- a/src/XML/sp_200507/MustSupportClientChallenge.php +++ b/src/XML/sp_200507/MustSupportClientChallenge.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportClientChallenge element diff --git a/src/XML/sp_200507/MustSupportIssuedTokens.php b/src/XML/sp_200507/MustSupportIssuedTokens.php index 2032156a..7271d885 100644 --- a/src/XML/sp_200507/MustSupportIssuedTokens.php +++ b/src/XML/sp_200507/MustSupportIssuedTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportIssuedTokens element diff --git a/src/XML/sp_200507/MustSupportRefEmbeddedToken.php b/src/XML/sp_200507/MustSupportRefEmbeddedToken.php index 18f8eac0..3ee88db6 100644 --- a/src/XML/sp_200507/MustSupportRefEmbeddedToken.php +++ b/src/XML/sp_200507/MustSupportRefEmbeddedToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefEmbeddedToken element diff --git a/src/XML/sp_200507/MustSupportRefEncryptedKey.php b/src/XML/sp_200507/MustSupportRefEncryptedKey.php index b320ed68..506ca9c5 100644 --- a/src/XML/sp_200507/MustSupportRefEncryptedKey.php +++ b/src/XML/sp_200507/MustSupportRefEncryptedKey.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefEncryptedKey element diff --git a/src/XML/sp_200507/MustSupportRefExternalURI.php b/src/XML/sp_200507/MustSupportRefExternalURI.php index 4579e2a0..290ab241 100644 --- a/src/XML/sp_200507/MustSupportRefExternalURI.php +++ b/src/XML/sp_200507/MustSupportRefExternalURI.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefExternalURI element diff --git a/src/XML/sp_200507/MustSupportRefIssuerSerial.php b/src/XML/sp_200507/MustSupportRefIssuerSerial.php index 5f545541..0f73622e 100644 --- a/src/XML/sp_200507/MustSupportRefIssuerSerial.php +++ b/src/XML/sp_200507/MustSupportRefIssuerSerial.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefIssuerSerial element diff --git a/src/XML/sp_200507/MustSupportRefKeyIdentifier.php b/src/XML/sp_200507/MustSupportRefKeyIdentifier.php index fcc731ba..d86a5de5 100644 --- a/src/XML/sp_200507/MustSupportRefKeyIdentifier.php +++ b/src/XML/sp_200507/MustSupportRefKeyIdentifier.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefKeyIdentifier element diff --git a/src/XML/sp_200507/MustSupportRefThumbprint.php b/src/XML/sp_200507/MustSupportRefThumbprint.php index 22c5db21..fa643fb5 100644 --- a/src/XML/sp_200507/MustSupportRefThumbprint.php +++ b/src/XML/sp_200507/MustSupportRefThumbprint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefThumbprint element diff --git a/src/XML/sp_200507/MustSupportServerChallenge.php b/src/XML/sp_200507/MustSupportServerChallenge.php index 09119092..3a141588 100644 --- a/src/XML/sp_200507/MustSupportServerChallenge.php +++ b/src/XML/sp_200507/MustSupportServerChallenge.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportServerChallenge element diff --git a/src/XML/sp_200507/OnlySignEntireHeadersAndBody.php b/src/XML/sp_200507/OnlySignEntireHeadersAndBody.php index 230af489..febb3b4f 100644 --- a/src/XML/sp_200507/OnlySignEntireHeadersAndBody.php +++ b/src/XML/sp_200507/OnlySignEntireHeadersAndBody.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An OnlySignEntireHeadersAndBody element diff --git a/src/XML/sp_200507/ProtectTokens.php b/src/XML/sp_200507/ProtectTokens.php index d594a708..38a569c7 100644 --- a/src/XML/sp_200507/ProtectTokens.php +++ b/src/XML/sp_200507/ProtectTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ProtectTokens element diff --git a/src/XML/sp_200507/ProtectionToken.php b/src/XML/sp_200507/ProtectionToken.php index 25fac113..66351577 100644 --- a/src/XML/sp_200507/ProtectionToken.php +++ b/src/XML/sp_200507/ProtectionToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ProtectionToken element diff --git a/src/XML/sp_200507/RecipientToken.php b/src/XML/sp_200507/RecipientToken.php index 99c3caf9..e211cee7 100644 --- a/src/XML/sp_200507/RecipientToken.php +++ b/src/XML/sp_200507/RecipientToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RecipientToken element diff --git a/src/XML/sp_200507/RelToken.php b/src/XML/sp_200507/RelToken.php index a68795b7..97af3c18 100644 --- a/src/XML/sp_200507/RelToken.php +++ b/src/XML/sp_200507/RelToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RelToken element diff --git a/src/XML/sp_200507/RequireClientEntropy.php b/src/XML/sp_200507/RequireClientEntropy.php index b9c3eebb..7a0266bc 100644 --- a/src/XML/sp_200507/RequireClientEntropy.php +++ b/src/XML/sp_200507/RequireClientEntropy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireClientEntropy element diff --git a/src/XML/sp_200507/RequireDerivedKeys.php b/src/XML/sp_200507/RequireDerivedKeys.php index 45720fb7..ea8f6504 100644 --- a/src/XML/sp_200507/RequireDerivedKeys.php +++ b/src/XML/sp_200507/RequireDerivedKeys.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireDerivedKeys element diff --git a/src/XML/sp_200507/RequireEmbeddedTokenReference.php b/src/XML/sp_200507/RequireEmbeddedTokenReference.php index 5ce9e9b1..27ff7b31 100644 --- a/src/XML/sp_200507/RequireEmbeddedTokenReference.php +++ b/src/XML/sp_200507/RequireEmbeddedTokenReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireEmbeddedTokenReference element diff --git a/src/XML/sp_200507/RequireExternalReference.php b/src/XML/sp_200507/RequireExternalReference.php index 5aa98cf2..1ee31678 100644 --- a/src/XML/sp_200507/RequireExternalReference.php +++ b/src/XML/sp_200507/RequireExternalReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireExternalReference element diff --git a/src/XML/sp_200507/RequireExternalUriReference.php b/src/XML/sp_200507/RequireExternalUriReference.php index 1b2ab722..990b638a 100644 --- a/src/XML/sp_200507/RequireExternalUriReference.php +++ b/src/XML/sp_200507/RequireExternalUriReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireExternalUriReference element diff --git a/src/XML/sp_200507/RequireInternalReference.php b/src/XML/sp_200507/RequireInternalReference.php index ff12cd64..1c7809e1 100644 --- a/src/XML/sp_200507/RequireInternalReference.php +++ b/src/XML/sp_200507/RequireInternalReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireInternalReference element diff --git a/src/XML/sp_200507/RequireIssuerSerialReference.php b/src/XML/sp_200507/RequireIssuerSerialReference.php index 1937a770..ebf99426 100644 --- a/src/XML/sp_200507/RequireIssuerSerialReference.php +++ b/src/XML/sp_200507/RequireIssuerSerialReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireIssuerSerialReference element diff --git a/src/XML/sp_200507/RequireKeyIdentifierReference.php b/src/XML/sp_200507/RequireKeyIdentifierReference.php index 49d0b487..fdaae7e3 100644 --- a/src/XML/sp_200507/RequireKeyIdentifierReference.php +++ b/src/XML/sp_200507/RequireKeyIdentifierReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireKeyIdentifierReference element diff --git a/src/XML/sp_200507/RequireServerEntropy.php b/src/XML/sp_200507/RequireServerEntropy.php index ea8a59c5..b13f0036 100644 --- a/src/XML/sp_200507/RequireServerEntropy.php +++ b/src/XML/sp_200507/RequireServerEntropy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireServerEntropy element diff --git a/src/XML/sp_200507/RequireSignatureConfirmation.php b/src/XML/sp_200507/RequireSignatureConfirmation.php index ddd932dd..fa6ac491 100644 --- a/src/XML/sp_200507/RequireSignatureConfirmation.php +++ b/src/XML/sp_200507/RequireSignatureConfirmation.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireSignatureConfirmation element diff --git a/src/XML/sp_200507/RequireThumbprintReference.php b/src/XML/sp_200507/RequireThumbprintReference.php index e42354ad..98607155 100644 --- a/src/XML/sp_200507/RequireThumbprintReference.php +++ b/src/XML/sp_200507/RequireThumbprintReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireThumbprintReference element diff --git a/src/XML/sp_200507/RequiredElements.php b/src/XML/sp_200507/RequiredElements.php index 61c83bb1..5237cdc4 100644 --- a/src/XML/sp_200507/RequiredElements.php +++ b/src/XML/sp_200507/RequiredElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequiredElements element diff --git a/src/XML/sp_200507/SC10SecurityContextToken.php b/src/XML/sp_200507/SC10SecurityContextToken.php index e1787896..ce663120 100644 --- a/src/XML/sp_200507/SC10SecurityContextToken.php +++ b/src/XML/sp_200507/SC10SecurityContextToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SC10SecurityContextToken element diff --git a/src/XML/sp_200507/SOAPNormalization10.php b/src/XML/sp_200507/SOAPNormalization10.php index 07383a34..e2f57654 100644 --- a/src/XML/sp_200507/SOAPNormalization10.php +++ b/src/XML/sp_200507/SOAPNormalization10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SOAPNormalization10 element diff --git a/src/XML/sp_200507/STRTransform10.php b/src/XML/sp_200507/STRTransform10.php index c8177d44..db16acc6 100644 --- a/src/XML/sp_200507/STRTransform10.php +++ b/src/XML/sp_200507/STRTransform10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An STRTransform10 element diff --git a/src/XML/sp_200507/SamlToken.php b/src/XML/sp_200507/SamlToken.php index 9a0cc723..da0c4a86 100644 --- a/src/XML/sp_200507/SamlToken.php +++ b/src/XML/sp_200507/SamlToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SamlToken element diff --git a/src/XML/sp_200507/SecureConversationToken.php b/src/XML/sp_200507/SecureConversationToken.php index 83134061..88f66f41 100644 --- a/src/XML/sp_200507/SecureConversationToken.php +++ b/src/XML/sp_200507/SecureConversationToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SecureConversationToken element diff --git a/src/XML/sp_200507/SecurityContextToken.php b/src/XML/sp_200507/SecurityContextToken.php index 6d0a6ed5..1252e7b1 100644 --- a/src/XML/sp_200507/SecurityContextToken.php +++ b/src/XML/sp_200507/SecurityContextToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SecurityContextToken element diff --git a/src/XML/sp_200507/SignatureToken.php b/src/XML/sp_200507/SignatureToken.php index a542aaa5..7382823c 100644 --- a/src/XML/sp_200507/SignatureToken.php +++ b/src/XML/sp_200507/SignatureToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignatureToken element diff --git a/src/XML/sp_200507/SignedElements.php b/src/XML/sp_200507/SignedElements.php index 8668dd8d..68a2d85c 100644 --- a/src/XML/sp_200507/SignedElements.php +++ b/src/XML/sp_200507/SignedElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignedElements element diff --git a/src/XML/sp_200507/SignedEndorsingSupportingTokens.php b/src/XML/sp_200507/SignedEndorsingSupportingTokens.php index 13d76dd1..9c0e1d8d 100644 --- a/src/XML/sp_200507/SignedEndorsingSupportingTokens.php +++ b/src/XML/sp_200507/SignedEndorsingSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignedEndorsingSupportingTokens element diff --git a/src/XML/sp_200507/SignedParts.php b/src/XML/sp_200507/SignedParts.php index 3392ef8d..d1b598cf 100644 --- a/src/XML/sp_200507/SignedParts.php +++ b/src/XML/sp_200507/SignedParts.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignedParts element diff --git a/src/XML/sp_200507/SignedSupportingTokens.php b/src/XML/sp_200507/SignedSupportingTokens.php index 5400dac5..583bb917 100644 --- a/src/XML/sp_200507/SignedSupportingTokens.php +++ b/src/XML/sp_200507/SignedSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignedSupportingTokens element diff --git a/src/XML/sp_200507/SpnegoContextToken.php b/src/XML/sp_200507/SpnegoContextToken.php index 8ed617b1..652b04c7 100644 --- a/src/XML/sp_200507/SpnegoContextToken.php +++ b/src/XML/sp_200507/SpnegoContextToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SpnegoContextToken element diff --git a/src/XML/sp_200507/Strict.php b/src/XML/sp_200507/Strict.php index 032a1cd8..cb211b77 100644 --- a/src/XML/sp_200507/Strict.php +++ b/src/XML/sp_200507/Strict.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Strict element diff --git a/src/XML/sp_200507/SupportingTokens.php b/src/XML/sp_200507/SupportingTokens.php index e6ed2286..6ad28ef8 100644 --- a/src/XML/sp_200507/SupportingTokens.php +++ b/src/XML/sp_200507/SupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SupportingTokens element diff --git a/src/XML/sp_200507/SymmetricBinding.php b/src/XML/sp_200507/SymmetricBinding.php index 21fcd57d..0225ccfc 100644 --- a/src/XML/sp_200507/SymmetricBinding.php +++ b/src/XML/sp_200507/SymmetricBinding.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SymmetricBinding element diff --git a/src/XML/sp_200507/TransportBinding.php b/src/XML/sp_200507/TransportBinding.php index 9b42884e..dc2c0147 100644 --- a/src/XML/sp_200507/TransportBinding.php +++ b/src/XML/sp_200507/TransportBinding.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A TransportBinding element diff --git a/src/XML/sp_200507/TransportToken.php b/src/XML/sp_200507/TransportToken.php index 915beb06..160306d7 100644 --- a/src/XML/sp_200507/TransportToken.php +++ b/src/XML/sp_200507/TransportToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A TransportToken element diff --git a/src/XML/sp_200507/TripleDes.php b/src/XML/sp_200507/TripleDes.php index 2f6c2c48..27dc3c18 100644 --- a/src/XML/sp_200507/TripleDes.php +++ b/src/XML/sp_200507/TripleDes.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDes element diff --git a/src/XML/sp_200507/TripleDesRsa15.php b/src/XML/sp_200507/TripleDesRsa15.php index 7974b5b4..34946455 100644 --- a/src/XML/sp_200507/TripleDesRsa15.php +++ b/src/XML/sp_200507/TripleDesRsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDesRsa15 element diff --git a/src/XML/sp_200507/TripleDesSha256.php b/src/XML/sp_200507/TripleDesSha256.php index fa9ea2e5..052f03cd 100644 --- a/src/XML/sp_200507/TripleDesSha256.php +++ b/src/XML/sp_200507/TripleDesSha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDesSha256 element diff --git a/src/XML/sp_200507/TripleDesSha256Rsa15.php b/src/XML/sp_200507/TripleDesSha256Rsa15.php index 9d89b7e4..2a7d9fe4 100644 --- a/src/XML/sp_200507/TripleDesSha256Rsa15.php +++ b/src/XML/sp_200507/TripleDesSha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDesSha256Rsa15 element diff --git a/src/XML/sp_200507/Trust10.php b/src/XML/sp_200507/Trust10.php index 602b1e10..139f90ed 100644 --- a/src/XML/sp_200507/Trust10.php +++ b/src/XML/sp_200507/Trust10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Trust10 element diff --git a/src/XML/sp_200507/UsernameToken.php b/src/XML/sp_200507/UsernameToken.php index 206b7ac7..a18c5ac5 100644 --- a/src/XML/sp_200507/UsernameToken.php +++ b/src/XML/sp_200507/UsernameToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An UsernameToken element diff --git a/src/XML/sp_200507/Wss10.php b/src/XML/sp_200507/Wss10.php index 09590de3..e15b3914 100644 --- a/src/XML/sp_200507/Wss10.php +++ b/src/XML/sp_200507/Wss10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Wss10 element diff --git a/src/XML/sp_200507/Wss11.php b/src/XML/sp_200507/Wss11.php index 69de71a5..eb365715 100644 --- a/src/XML/sp_200507/Wss11.php +++ b/src/XML/sp_200507/Wss11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Wss11 element diff --git a/src/XML/sp_200507/WssGssKerberosV5ApReqToken11.php b/src/XML/sp_200507/WssGssKerberosV5ApReqToken11.php index d16bcd8b..fe9db0f9 100644 --- a/src/XML/sp_200507/WssGssKerberosV5ApReqToken11.php +++ b/src/XML/sp_200507/WssGssKerberosV5ApReqToken11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssGssKerberosV5ApReqToken11 element diff --git a/src/XML/sp_200507/WssKerberosV5ApReqToken11.php b/src/XML/sp_200507/WssKerberosV5ApReqToken11.php index 7f2631c5..56189b75 100644 --- a/src/XML/sp_200507/WssKerberosV5ApReqToken11.php +++ b/src/XML/sp_200507/WssKerberosV5ApReqToken11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssKerberosV5ApReqToken11 element diff --git a/src/XML/sp_200507/WssRelV10Token10.php b/src/XML/sp_200507/WssRelV10Token10.php index 359951b5..069cb801 100644 --- a/src/XML/sp_200507/WssRelV10Token10.php +++ b/src/XML/sp_200507/WssRelV10Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV10Token10 element diff --git a/src/XML/sp_200507/WssRelV10Token11.php b/src/XML/sp_200507/WssRelV10Token11.php index d117c8f4..a97d21c1 100644 --- a/src/XML/sp_200507/WssRelV10Token11.php +++ b/src/XML/sp_200507/WssRelV10Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV10Token11 element diff --git a/src/XML/sp_200507/WssRelV20Token10.php b/src/XML/sp_200507/WssRelV20Token10.php index c220b4d6..9a6ab6b9 100644 --- a/src/XML/sp_200507/WssRelV20Token10.php +++ b/src/XML/sp_200507/WssRelV20Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV20Token10 element diff --git a/src/XML/sp_200507/WssRelV20Token11.php b/src/XML/sp_200507/WssRelV20Token11.php index c737d803..f7289a62 100644 --- a/src/XML/sp_200507/WssRelV20Token11.php +++ b/src/XML/sp_200507/WssRelV20Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV20Token11 element diff --git a/src/XML/sp_200507/WssSamlV10Token10.php b/src/XML/sp_200507/WssSamlV10Token10.php index 38d9b194..cb9289a9 100644 --- a/src/XML/sp_200507/WssSamlV10Token10.php +++ b/src/XML/sp_200507/WssSamlV10Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV10Token10 element diff --git a/src/XML/sp_200507/WssSamlV10Token11.php b/src/XML/sp_200507/WssSamlV10Token11.php index 155fc87e..89b38263 100644 --- a/src/XML/sp_200507/WssSamlV10Token11.php +++ b/src/XML/sp_200507/WssSamlV10Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV10Token11 element diff --git a/src/XML/sp_200507/WssSamlV11Token10.php b/src/XML/sp_200507/WssSamlV11Token10.php index be0fce0e..550b7bf7 100644 --- a/src/XML/sp_200507/WssSamlV11Token10.php +++ b/src/XML/sp_200507/WssSamlV11Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV11Token10 element diff --git a/src/XML/sp_200507/WssSamlV11Token11.php b/src/XML/sp_200507/WssSamlV11Token11.php index 5635c545..c3af0fe1 100644 --- a/src/XML/sp_200507/WssSamlV11Token11.php +++ b/src/XML/sp_200507/WssSamlV11Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV11Token11 element diff --git a/src/XML/sp_200507/WssSamlV20Token11.php b/src/XML/sp_200507/WssSamlV20Token11.php index 8913665c..272ce3c3 100644 --- a/src/XML/sp_200507/WssSamlV20Token11.php +++ b/src/XML/sp_200507/WssSamlV20Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV20Token11 element diff --git a/src/XML/sp_200507/WssUsernameToken10.php b/src/XML/sp_200507/WssUsernameToken10.php index 2731ac58..1204bc1c 100644 --- a/src/XML/sp_200507/WssUsernameToken10.php +++ b/src/XML/sp_200507/WssUsernameToken10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssUsernameToken10 element diff --git a/src/XML/sp_200507/WssUsernameToken11.php b/src/XML/sp_200507/WssUsernameToken11.php index 40390cb8..e3d5f280 100644 --- a/src/XML/sp_200507/WssUsernameToken11.php +++ b/src/XML/sp_200507/WssUsernameToken11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssUsernameToken11 element diff --git a/src/XML/sp_200507/WssX509Pkcs7Token10.php b/src/XML/sp_200507/WssX509Pkcs7Token10.php index e414057f..e4cf6be7 100644 --- a/src/XML/sp_200507/WssX509Pkcs7Token10.php +++ b/src/XML/sp_200507/WssX509Pkcs7Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509Pkcs7Token10 element diff --git a/src/XML/sp_200507/WssX509Pkcs7Token11.php b/src/XML/sp_200507/WssX509Pkcs7Token11.php index b44e9a77..98f10c44 100644 --- a/src/XML/sp_200507/WssX509Pkcs7Token11.php +++ b/src/XML/sp_200507/WssX509Pkcs7Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509Pkcs7Token11 element diff --git a/src/XML/sp_200507/WssX509PkiPathV1Token10.php b/src/XML/sp_200507/WssX509PkiPathV1Token10.php index 18ef864e..4d51cc1c 100644 --- a/src/XML/sp_200507/WssX509PkiPathV1Token10.php +++ b/src/XML/sp_200507/WssX509PkiPathV1Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509PkiPathV1Token10 element diff --git a/src/XML/sp_200507/WssX509PkiPathV1Token11.php b/src/XML/sp_200507/WssX509PkiPathV1Token11.php index f5d4dbe7..7c1c41d6 100644 --- a/src/XML/sp_200507/WssX509PkiPathV1Token11.php +++ b/src/XML/sp_200507/WssX509PkiPathV1Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509PkiPathV1Token11 element diff --git a/src/XML/sp_200507/WssX509V1Token10.php b/src/XML/sp_200507/WssX509V1Token10.php index 593dd4c8..9cafe0d9 100644 --- a/src/XML/sp_200507/WssX509V1Token10.php +++ b/src/XML/sp_200507/WssX509V1Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V1Token10 element diff --git a/src/XML/sp_200507/WssX509V1Token11.php b/src/XML/sp_200507/WssX509V1Token11.php index 0e6609e0..46846303 100644 --- a/src/XML/sp_200507/WssX509V1Token11.php +++ b/src/XML/sp_200507/WssX509V1Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V1Token11 element diff --git a/src/XML/sp_200507/WssX509V3Token10.php b/src/XML/sp_200507/WssX509V3Token10.php index f0b48357..37bc6d05 100644 --- a/src/XML/sp_200507/WssX509V3Token10.php +++ b/src/XML/sp_200507/WssX509V3Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V3Token10 element diff --git a/src/XML/sp_200507/WssX509V3Token11.php b/src/XML/sp_200507/WssX509V3Token11.php index 07577407..dfd1f731 100644 --- a/src/XML/sp_200507/WssX509V3Token11.php +++ b/src/XML/sp_200507/WssX509V3Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V3Token11 element diff --git a/src/XML/sp_200507/X509Token.php b/src/XML/sp_200507/X509Token.php index ba36fb0a..15d7dd5e 100644 --- a/src/XML/sp_200507/X509Token.php +++ b/src/XML/sp_200507/X509Token.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An X509Token element diff --git a/src/XML/sp_200507/XPathFilter20.php b/src/XML/sp_200507/XPathFilter20.php index 03933dc5..6b8f7496 100644 --- a/src/XML/sp_200507/XPathFilter20.php +++ b/src/XML/sp_200507/XPathFilter20.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An XPathFilter20 element From 2e527af7f2edb25ddbdbcc1f0606a87de6ebcd77 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 15 Oct 2025 23:47:50 +0200 Subject: [PATCH 05/34] Migrate to xsd-types --- src/XML/sp_200702/AbsXPath.php | 3 +- src/XML/sp_200702/AbstractHeaderType.php | 47 +++++++++-------- src/XML/sp_200702/AbstractIssuedTokenType.php | 2 +- .../sp_200702/AbstractKeyValueTokenType.php | 2 +- .../sp_200702/AbstractNestedPolicyType.php | 2 +- .../sp_200702/AbstractQNameAssertionType.php | 2 +- src/XML/sp_200702/AbstractReqPartsType.php | 2 +- ...stractRequestSecurityTokenTemplateType.php | 21 ++++---- src/XML/sp_200702/AbstractSePartsType.php | 2 +- .../AbstractSecureConversationTokenType.php | 2 +- src/XML/sp_200702/AbstractSerElementsType.php | 16 +++--- .../AbstractSpnegoContextTokenType.php | 6 +-- .../sp_200702/AbstractTokenAssertionType.php | 6 +-- src/XML/sp_200702/AlgorithmSuite.php | 3 +- src/XML/sp_200702/AsymmetricBinding.php | 3 +- src/XML/sp_200702/Basic128.php | 3 +- src/XML/sp_200702/Basic128Rsa15.php | 3 +- src/XML/sp_200702/Basic128Sha256.php | 3 +- src/XML/sp_200702/Basic128Sha256Rsa15.php | 3 +- src/XML/sp_200702/Basic192.php | 3 +- src/XML/sp_200702/Basic192Rsa15.php | 3 +- src/XML/sp_200702/Basic192Sha256.php | 3 +- src/XML/sp_200702/Basic192Sha256Rsa15.php | 3 +- src/XML/sp_200702/Basic256.php | 3 +- src/XML/sp_200702/Basic256Rsa15.php | 3 +- src/XML/sp_200702/Basic256Sha256.php | 3 +- src/XML/sp_200702/Basic256Sha256Rsa15.php | 3 +- src/XML/sp_200702/BootstrapPolicy.php | 3 +- .../sp_200702/ContentEncryptedElements.php | 3 +- src/XML/sp_200702/EncryptBeforeSigning.php | 3 +- src/XML/sp_200702/EncryptSignature.php | 3 +- src/XML/sp_200702/EncryptedElements.php | 3 +- src/XML/sp_200702/EncryptedParts.php | 3 +- .../sp_200702/EncryptedSupportingTokens.php | 3 +- src/XML/sp_200702/EncryptionToken.php | 3 +- .../EndorsingEncryptedSupportingTokens.php | 3 +- .../sp_200702/EndorsingSupportingTokens.php | 3 +- src/XML/sp_200702/HashPassword.php | 3 +- src/XML/sp_200702/HttpBasicAuthentication.php | 3 +- .../sp_200702/HttpDigestAuthentication.php | 3 +- src/XML/sp_200702/HttpsToken.php | 3 +- src/XML/sp_200702/IncludeTimestamp.php | 3 +- src/XML/sp_200702/InclusiveC14N.php | 3 +- .../sp_200702/InitiatorEncryptionToken.php | 3 +- src/XML/sp_200702/InitiatorSignatureToken.php | 3 +- src/XML/sp_200702/InitiatorToken.php | 3 +- src/XML/sp_200702/IssuedToken.php | 3 +- src/XML/sp_200702/IssuerName.php | 16 ++---- src/XML/sp_200702/KerberosToken.php | 3 +- src/XML/sp_200702/KeyValueToken.php | 3 +- src/XML/sp_200702/Lax.php | 3 +- src/XML/sp_200702/LaxTsFirst.php | 3 +- src/XML/sp_200702/LaxTsLast.php | 3 +- src/XML/sp_200702/Layout.php | 3 +- src/XML/sp_200702/MustNotSendAmend.php | 3 +- src/XML/sp_200702/MustNotSendCancel.php | 3 +- src/XML/sp_200702/MustNotSendRenew.php | 3 +- .../sp_200702/MustSupportClientChallenge.php | 3 +- src/XML/sp_200702/MustSupportIssuedTokens.php | 3 +- .../sp_200702/MustSupportRefEmbeddedToken.php | 3 +- .../sp_200702/MustSupportRefEncryptedKey.php | 3 +- .../sp_200702/MustSupportRefExternalURI.php | 3 +- .../sp_200702/MustSupportRefIssuerSerial.php | 3 +- .../sp_200702/MustSupportRefKeyIdentifier.php | 3 +- .../sp_200702/MustSupportRefThumbprint.php | 3 +- .../sp_200702/MustSupportServerChallenge.php | 3 +- src/XML/sp_200702/NoPassword.php | 3 +- .../OnlySignEntireHeadersAndBody.php | 3 +- src/XML/sp_200702/ProtectTokens.php | 3 +- src/XML/sp_200702/ProtectionToken.php | 3 +- .../sp_200702/RecipientEncryptionToken.php | 3 +- src/XML/sp_200702/RecipientSignatureToken.php | 3 +- src/XML/sp_200702/RecipientToken.php | 3 +- src/XML/sp_200702/RelToken.php | 3 +- src/XML/sp_200702/RequireAppliesTo.php | 3 +- .../sp_200702/RequireClientCertificate.php | 3 +- src/XML/sp_200702/RequireClientEntropy.php | 3 +- src/XML/sp_200702/RequireDerivedKeys.php | 3 +- .../RequireEmbeddedTokenReference.php | 3 +- .../sp_200702/RequireExplicitDerivedKeys.php | 3 +- .../sp_200702/RequireExternalReference.php | 3 +- .../sp_200702/RequireExternalUriReference.php | 3 +- .../sp_200702/RequireImpliedDerivedKeys.php | 3 +- .../sp_200702/RequireInternalReference.php | 3 +- .../RequireIssuerSerialReference.php | 3 +- .../RequireKeyIdentifierReference.php | 3 +- .../RequireRequestSecurityTokenCollection.php | 3 +- src/XML/sp_200702/RequireServerEntropy.php | 3 +- .../RequireSignatureConfirmation.php | 3 +- .../sp_200702/RequireThumbprintReference.php | 3 +- src/XML/sp_200702/RequiredElements.php | 3 +- src/XML/sp_200702/RequiredParts.php | 3 +- src/XML/sp_200702/RsaKeyValue.php | 3 +- .../sp_200702/SC13SecurityContextToken.php | 3 +- src/XML/sp_200702/SOAPNormalization10.php | 3 +- src/XML/sp_200702/STRTransform10.php | 3 +- src/XML/sp_200702/SamlToken.php | 3 +- src/XML/sp_200702/SecureConversationToken.php | 3 +- src/XML/sp_200702/SecurityContextToken.php | 3 +- src/XML/sp_200702/SignatureToken.php | 3 +- src/XML/sp_200702/SignedElements.php | 3 +- .../SignedEncryptedSupportingTokens.php | 3 +- ...gnedEndorsingEncryptedSupportingTokens.php | 3 +- .../SignedEndorsingSupportingTokens.php | 3 +- src/XML/sp_200702/SignedParts.php | 3 +- src/XML/sp_200702/SignedSupportingTokens.php | 3 +- src/XML/sp_200702/SpnegoContextToken.php | 3 +- src/XML/sp_200702/Strict.php | 3 +- src/XML/sp_200702/SupportingTokens.php | 3 +- src/XML/sp_200702/SymmetricBinding.php | 3 +- src/XML/sp_200702/TransportBinding.php | 3 +- src/XML/sp_200702/TransportToken.php | 3 +- src/XML/sp_200702/TripleDes.php | 3 +- src/XML/sp_200702/TripleDesRsa15.php | 3 +- src/XML/sp_200702/TripleDesSha256.php | 3 +- src/XML/sp_200702/TripleDesSha256Rsa15.php | 3 +- src/XML/sp_200702/Trust13.php | 3 +- src/XML/sp_200702/UsernameToken.php | 3 +- src/XML/sp_200702/Wss10.php | 3 +- src/XML/sp_200702/Wss11.php | 3 +- .../WssGssKerberosV5ApReqToken11.php | 3 +- .../sp_200702/WssKerberosV5ApReqToken11.php | 3 +- src/XML/sp_200702/WssRelV10Token10.php | 3 +- src/XML/sp_200702/WssRelV10Token11.php | 3 +- src/XML/sp_200702/WssRelV20Token10.php | 3 +- src/XML/sp_200702/WssRelV20Token11.php | 3 +- src/XML/sp_200702/WssSamlV11Token10.php | 3 +- src/XML/sp_200702/WssSamlV11Token11.php | 3 +- src/XML/sp_200702/WssSamlV20Token11.php | 3 +- src/XML/sp_200702/WssUsernameToken10.php | 3 +- src/XML/sp_200702/WssUsernameToken11.php | 3 +- src/XML/sp_200702/WssX509Pkcs7Token10.php | 3 +- src/XML/sp_200702/WssX509Pkcs7Token11.php | 3 +- src/XML/sp_200702/WssX509PkiPathV1Token10.php | 3 +- src/XML/sp_200702/WssX509PkiPathV1Token11.php | 3 +- src/XML/sp_200702/WssX509V1Token11.php | 3 +- src/XML/sp_200702/WssX509V3Token10.php | 3 +- src/XML/sp_200702/WssX509V3Token11.php | 3 +- src/XML/sp_200702/X509Token.php | 3 +- src/XML/sp_200702/XPath.php | 19 +++---- src/XML/sp_200702/XPath10.php | 3 +- src/XML/sp_200702/XPathFilter20.php | 3 +- .../AbstractAttributedQNameType.php | 22 ++++---- .../wsa_200408/AbstractAttributedURIType.php | 23 ++++---- .../AbstractEndpointReferenceType.php | 12 ++--- .../wsa_200408/AbstractRelationshipType.php | 35 ++++++++----- src/XML/wsa_200408/AbstractRetryAfterType.php | 37 ++++++------- .../wsa_200408/AbstractServiceNameType.php | 36 +++++++------ src/XML/wsa_200408/Action.php | 3 +- src/XML/wsa_200408/EndpointReference.php | 3 +- src/XML/wsa_200408/FaultTo.php | 3 +- src/XML/wsa_200408/From.php | 3 +- src/XML/wsa_200408/MessageID.php | 3 +- src/XML/wsa_200408/ReferenceParameters.php | 6 +-- src/XML/wsa_200408/ReferenceProperties.php | 6 +-- src/XML/wsa_200408/RelatesTo.php | 3 +- src/XML/wsa_200408/ReplyTo.php | 3 +- src/XML/wsa_200408/RetryAfter.php | 3 +- src/XML/wsa_200408/To.php | 3 +- .../AbstractAttributedQNameType.php | 23 ++++---- .../wsa_200508/AbstractAttributedURIType.php | 10 ++-- ...=> AbstractAttributedUnsignedLongType.php} | 41 ++++++--------- .../AbstractEndpointReferenceType.php | 12 ++--- .../wsa_200508/AbstractProblemActionType.php | 2 +- src/XML/wsa_200508/Action.php | 3 +- src/XML/wsa_200508/EndpointReference.php | 3 +- src/XML/wsa_200508/FaultTo.php | 3 +- src/XML/wsa_200508/From.php | 3 +- src/XML/wsa_200508/MessageID.php | 3 +- src/XML/wsa_200508/Metadata.php | 11 ++-- src/XML/wsa_200508/ProblemAction.php | 9 ++-- src/XML/wsa_200508/ProblemHeaderQName.php | 3 +- src/XML/wsa_200508/ProblemIRI.php | 3 +- src/XML/wsa_200508/ReferenceParameters.php | 11 ++-- src/XML/wsa_200508/RelatesTo.php | 43 ++++++++------- src/XML/wsa_200508/ReplyTo.php | 3 +- src/XML/wsa_200508/RetryAfter.php | 5 +- src/XML/wsa_200508/SoapAction.php | 52 ++----------------- src/XML/wsa_200508/To.php | 3 +- 179 files changed, 543 insertions(+), 436 deletions(-) rename src/XML/wsa_200508/{AbstractAttributedLongType.php => AbstractAttributedUnsignedLongType.php} (62%) diff --git a/src/XML/sp_200702/AbsXPath.php b/src/XML/sp_200702/AbsXPath.php index 74fd88e1..939dc546 100644 --- a/src/XML/sp_200702/AbsXPath.php +++ b/src/XML/sp_200702/AbsXPath.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AbsXPath element diff --git a/src/XML/sp_200702/AbstractHeaderType.php b/src/XML/sp_200702/AbstractHeaderType.php index e5c5543c..6c37828f 100644 --- a/src/XML/sp_200702/AbstractHeaderType.php +++ b/src/XML/sp_200702/AbstractHeaderType.php @@ -8,7 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; use function sprintf; @@ -24,22 +26,25 @@ abstract class AbstractHeaderType extends AbstractSpElement /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; + /** The exclusions for the xs:anyAttribute element */ + public const XS_ANY_ATTR_EXCLUSIONS = [ + [null, 'Name'], + [null, 'Namespace'], + ]; + /** * AbstractHeaderType constructor. * - * @param string $namespace - * @param string|null $name + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $namespace + * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $name * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected string $namespace, - protected ?string $name = null, + protected AnyURIValue $namespace, + protected ?QNameValue $name = null, array $namespacedAttributes = [], ) { - Assert::validURI($namespace); - Assert::nullOrValidQName($name); - $this->setAttributesNS($namespacedAttributes); } @@ -47,9 +52,9 @@ final public function __construct( /** * Collect the value of the Name property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\QNameValue|null */ - public function getName(): ?string + public function getName(): ?QNameValue { return $this->name; } @@ -58,9 +63,9 @@ public function getName(): ?string /** * Collect the value of the Namespace property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getNamespace(): string + public function getNamespace(): AnyURIValue { return $this->namespace; } @@ -88,17 +93,13 @@ public static function fromXML(DOMElement $xml): static ); $namespacedAttributes = self::getAttributesNSFromXML($xml); - foreach ($namespacedAttributes as $i => $attr) { - if ($attr->getNamespaceURI() === null) { - if ($attr->getAttrName() === 'Name' || $attr->getAttrName() === 'Namespace') { - unset($namespacedAttributes[$i]); - } - } - } + $namespace = self::getAttribute($xml, 'Namespace', AnyURIValue::class); return new static( - self::getAttribute($xml, 'Namespace'), - self::getOptionalAttribute($xml, 'Name', null), + $namespace, + $xml->hasAttribute('Name') + ? QNameValue::fromString('{' . $namespace . '}' . $xml->getAttribute('Name')) + : null, $namespacedAttributes, ); } @@ -115,10 +116,10 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getName() !== null) { - $e->setAttribute('Name', $this->getName()); + $e->setAttribute('Name', $this->getName()->getValue()); } - $e->setAttribute('Namespace', $this->getNamespace()); + $e->setAttribute('Namespace', $this->getNamespace()->getValue()); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/sp_200702/AbstractIssuedTokenType.php b/src/XML/sp_200702/AbstractIssuedTokenType.php index b6bcf3bb..22265bc3 100644 --- a/src/XML/sp_200702/AbstractIssuedTokenType.php +++ b/src/XML/sp_200702/AbstractIssuedTokenType.php @@ -11,7 +11,7 @@ use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; diff --git a/src/XML/sp_200702/AbstractKeyValueTokenType.php b/src/XML/sp_200702/AbstractKeyValueTokenType.php index b651fc5b..31db30e7 100644 --- a/src/XML/sp_200702/AbstractKeyValueTokenType.php +++ b/src/XML/sp_200702/AbstractKeyValueTokenType.php @@ -9,7 +9,7 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; diff --git a/src/XML/sp_200702/AbstractNestedPolicyType.php b/src/XML/sp_200702/AbstractNestedPolicyType.php index c2a81c3f..a266e93a 100644 --- a/src/XML/sp_200702/AbstractNestedPolicyType.php +++ b/src/XML/sp_200702/AbstractNestedPolicyType.php @@ -9,7 +9,7 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing sp:NestedPolicyType diff --git a/src/XML/sp_200702/AbstractQNameAssertionType.php b/src/XML/sp_200702/AbstractQNameAssertionType.php index 0146e597..5bffd300 100644 --- a/src/XML/sp_200702/AbstractQNameAssertionType.php +++ b/src/XML/sp_200702/AbstractQNameAssertionType.php @@ -8,7 +8,7 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; diff --git a/src/XML/sp_200702/AbstractReqPartsType.php b/src/XML/sp_200702/AbstractReqPartsType.php index 7b262796..fff25620 100644 --- a/src/XML/sp_200702/AbstractReqPartsType.php +++ b/src/XML/sp_200702/AbstractReqPartsType.php @@ -10,7 +10,7 @@ use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; diff --git a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php index 654dada5..5606d75c 100644 --- a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php @@ -9,7 +9,8 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -38,17 +39,15 @@ abstract class AbstractRequestSecurityTokenTemplateType extends AbstractSpElemen /** * AbstractRequestSecurityTokenTemplateType constructor. * - * @param string|null $trustVersion + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $trustVersion * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $trustVersion = null, + protected ?AnyURIValue $trustVersion = null, array $elts = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($trustVersion); - $this->setElements($elts); $this->setAttributesNS($namespacedAttributes); } @@ -57,9 +56,9 @@ final public function __construct( /** * Collect the value of the trustVersion property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getTrustVersion(): ?string + public function getTrustVersion(): ?AnyURIValue { return $this->trustVersion; } @@ -72,7 +71,9 @@ public function getTrustVersion(): ?string */ public function isEmptyElement(): bool { - return empty($this->trustVersion) && empty($this->elements) && empty($this->namespacedAttributes); + return empty($this->getTrustVersion()) + && empty($this->getElements()) + && empty($this->getAttributesNS()); } @@ -102,7 +103,7 @@ public static function fromXML(DOMElement $xml): static ); return new static( - self::getOptionalAttribute($xml, 'TrustVersion', null), + self::getOptionalAttribute($xml, 'TrustVersion', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -120,7 +121,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getTrustVersion() !== null) { - $e->setAttribute('TrustVersion', $this->getTrustVersion()); + $e->setAttribute('TrustVersion', $this->getTrustVersion()->getValue()); } foreach ($this->getElements() as $elt) { diff --git a/src/XML/sp_200702/AbstractSePartsType.php b/src/XML/sp_200702/AbstractSePartsType.php index 8f2992aa..8fad2b6a 100644 --- a/src/XML/sp_200702/AbstractSePartsType.php +++ b/src/XML/sp_200702/AbstractSePartsType.php @@ -10,7 +10,7 @@ use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; diff --git a/src/XML/sp_200702/AbstractSecureConversationTokenType.php b/src/XML/sp_200702/AbstractSecureConversationTokenType.php index dad6cb20..d314e08c 100644 --- a/src/XML/sp_200702/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200702/AbstractSecureConversationTokenType.php @@ -9,7 +9,7 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; diff --git a/src/XML/sp_200702/AbstractSerElementsType.php b/src/XML/sp_200702/AbstractSerElementsType.php index ff2b65c8..fcc81f66 100644 --- a/src/XML/sp_200702/AbstractSerElementsType.php +++ b/src/XML/sp_200702/AbstractSerElementsType.php @@ -10,7 +10,8 @@ use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -40,18 +41,17 @@ abstract class AbstractSerElementsType extends AbstractSpElement * AbstractSerElementsType constructor. * * @param list<\SimpleSAML\WSSecurity\XML\sp_200702\XPath> $xpath - * @param string|null $xpathVersion + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $xpathVersion * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $xpath, - protected ?string $xpathVersion = null, + protected ?AnyURIValue $xpathVersion = null, array $elts = [], array $namespacedAttributes = [], ) { Assert::minCount($xpath, 1, SchemaViolationException::class); - Assert::nullOrValidURI($xpathVersion); $this->setElements($elts); $this->setAttributesNS($namespacedAttributes); @@ -72,9 +72,9 @@ public function getXPath(): array /** * Collect the value of the XPathVersion property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getXPathVersion(): ?string + public function getXPathVersion(): ?AnyURIValue { return $this->xpathVersion; } @@ -103,7 +103,7 @@ public static function fromXML(DOMElement $xml): static return new static( XPath::getChildrenOfClass($xml), - $xml->hasAttributeNS(self::NS, 'XPathVersion') ? $xml->getAttributeNS(self::NS, 'XPathVersion') : null, + $xml->hasAttributeNS(self::NS, 'XPathVersion') ? $xml->getAttributeNS(self::NS, 'XPathVersion', AnyURIValue) : null, self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -121,7 +121,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getXPathVersion() !== null) { - $e->setAttributeNS(self::NS, 'sp:XPathVersion', $this->getXPathVersion()); + $e->setAttributeNS(self::NS, 'sp:XPathVersion', $this->getXPathVersion()->getValue()); } foreach ($this->getXPath() as $xpath) { diff --git a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php index 179dfa07..26e04a62 100644 --- a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; @@ -80,7 +80,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractTokenAssertionType.php b/src/XML/sp_200702/AbstractTokenAssertionType.php index e58f2e03..7b69f5ce 100644 --- a/src/XML/sp_200702/AbstractTokenAssertionType.php +++ b/src/XML/sp_200702/AbstractTokenAssertionType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -65,7 +65,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AlgorithmSuite.php b/src/XML/sp_200702/AlgorithmSuite.php index d10d3761..1e501df6 100644 --- a/src/XML/sp_200702/AlgorithmSuite.php +++ b/src/XML/sp_200702/AlgorithmSuite.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AlgorithmSuite element diff --git a/src/XML/sp_200702/AsymmetricBinding.php b/src/XML/sp_200702/AsymmetricBinding.php index e4ef6ba1..667cbd38 100644 --- a/src/XML/sp_200702/AsymmetricBinding.php +++ b/src/XML/sp_200702/AsymmetricBinding.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AsymmetricBinding element diff --git a/src/XML/sp_200702/Basic128.php b/src/XML/sp_200702/Basic128.php index e8923626..146d9de9 100644 --- a/src/XML/sp_200702/Basic128.php +++ b/src/XML/sp_200702/Basic128.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128 element diff --git a/src/XML/sp_200702/Basic128Rsa15.php b/src/XML/sp_200702/Basic128Rsa15.php index 6a0039ad..01ca249f 100644 --- a/src/XML/sp_200702/Basic128Rsa15.php +++ b/src/XML/sp_200702/Basic128Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128Rsa15 element diff --git a/src/XML/sp_200702/Basic128Sha256.php b/src/XML/sp_200702/Basic128Sha256.php index d999bbe9..b232a0b3 100644 --- a/src/XML/sp_200702/Basic128Sha256.php +++ b/src/XML/sp_200702/Basic128Sha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128Sha256 element diff --git a/src/XML/sp_200702/Basic128Sha256Rsa15.php b/src/XML/sp_200702/Basic128Sha256Rsa15.php index 06a0d411..d73f0bf2 100644 --- a/src/XML/sp_200702/Basic128Sha256Rsa15.php +++ b/src/XML/sp_200702/Basic128Sha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic128Sha256Rsa15 element diff --git a/src/XML/sp_200702/Basic192.php b/src/XML/sp_200702/Basic192.php index e6470e4e..ac44223d 100644 --- a/src/XML/sp_200702/Basic192.php +++ b/src/XML/sp_200702/Basic192.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192 element diff --git a/src/XML/sp_200702/Basic192Rsa15.php b/src/XML/sp_200702/Basic192Rsa15.php index 9e7d732a..6b6cc050 100644 --- a/src/XML/sp_200702/Basic192Rsa15.php +++ b/src/XML/sp_200702/Basic192Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192Rsa15 element diff --git a/src/XML/sp_200702/Basic192Sha256.php b/src/XML/sp_200702/Basic192Sha256.php index e07803f2..585cbf7e 100644 --- a/src/XML/sp_200702/Basic192Sha256.php +++ b/src/XML/sp_200702/Basic192Sha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192Sha256 element diff --git a/src/XML/sp_200702/Basic192Sha256Rsa15.php b/src/XML/sp_200702/Basic192Sha256Rsa15.php index fade6bc0..59edad9a 100644 --- a/src/XML/sp_200702/Basic192Sha256Rsa15.php +++ b/src/XML/sp_200702/Basic192Sha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic192Sha256Rsa15 element diff --git a/src/XML/sp_200702/Basic256.php b/src/XML/sp_200702/Basic256.php index 7bef9238..a24308c0 100644 --- a/src/XML/sp_200702/Basic256.php +++ b/src/XML/sp_200702/Basic256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256 element diff --git a/src/XML/sp_200702/Basic256Rsa15.php b/src/XML/sp_200702/Basic256Rsa15.php index 82efbff6..6881adc7 100644 --- a/src/XML/sp_200702/Basic256Rsa15.php +++ b/src/XML/sp_200702/Basic256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256Rsa15 element diff --git a/src/XML/sp_200702/Basic256Sha256.php b/src/XML/sp_200702/Basic256Sha256.php index 3d8656e9..ef419b14 100644 --- a/src/XML/sp_200702/Basic256Sha256.php +++ b/src/XML/sp_200702/Basic256Sha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256Sha256 element diff --git a/src/XML/sp_200702/Basic256Sha256Rsa15.php b/src/XML/sp_200702/Basic256Sha256Rsa15.php index 566ce942..da4079bd 100644 --- a/src/XML/sp_200702/Basic256Sha256Rsa15.php +++ b/src/XML/sp_200702/Basic256Sha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Basic256Sha256Rsa15 element diff --git a/src/XML/sp_200702/BootstrapPolicy.php b/src/XML/sp_200702/BootstrapPolicy.php index 01e2adc0..fd0ba2ef 100644 --- a/src/XML/sp_200702/BootstrapPolicy.php +++ b/src/XML/sp_200702/BootstrapPolicy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A BootstrapPolicy element diff --git a/src/XML/sp_200702/ContentEncryptedElements.php b/src/XML/sp_200702/ContentEncryptedElements.php index d9dd1183..c1f8be68 100644 --- a/src/XML/sp_200702/ContentEncryptedElements.php +++ b/src/XML/sp_200702/ContentEncryptedElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An ContentEncryptedElements element diff --git a/src/XML/sp_200702/EncryptBeforeSigning.php b/src/XML/sp_200702/EncryptBeforeSigning.php index 5bd6103c..dc2f7589 100644 --- a/src/XML/sp_200702/EncryptBeforeSigning.php +++ b/src/XML/sp_200702/EncryptBeforeSigning.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptBeforeSigning element diff --git a/src/XML/sp_200702/EncryptSignature.php b/src/XML/sp_200702/EncryptSignature.php index de2b6af8..821cd459 100644 --- a/src/XML/sp_200702/EncryptSignature.php +++ b/src/XML/sp_200702/EncryptSignature.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptSignature element diff --git a/src/XML/sp_200702/EncryptedElements.php b/src/XML/sp_200702/EncryptedElements.php index 73c178c0..80575100 100644 --- a/src/XML/sp_200702/EncryptedElements.php +++ b/src/XML/sp_200702/EncryptedElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptedElements element diff --git a/src/XML/sp_200702/EncryptedParts.php b/src/XML/sp_200702/EncryptedParts.php index a378282b..674fefd9 100644 --- a/src/XML/sp_200702/EncryptedParts.php +++ b/src/XML/sp_200702/EncryptedParts.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptedParts element diff --git a/src/XML/sp_200702/EncryptedSupportingTokens.php b/src/XML/sp_200702/EncryptedSupportingTokens.php index a2c4f8bb..5aa984fd 100644 --- a/src/XML/sp_200702/EncryptedSupportingTokens.php +++ b/src/XML/sp_200702/EncryptedSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A EncryptedSupportingTokens element diff --git a/src/XML/sp_200702/EncryptionToken.php b/src/XML/sp_200702/EncryptionToken.php index ff221e15..11837a15 100644 --- a/src/XML/sp_200702/EncryptionToken.php +++ b/src/XML/sp_200702/EncryptionToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An EncryptionToken element diff --git a/src/XML/sp_200702/EndorsingEncryptedSupportingTokens.php b/src/XML/sp_200702/EndorsingEncryptedSupportingTokens.php index 1a410982..229d97db 100644 --- a/src/XML/sp_200702/EndorsingEncryptedSupportingTokens.php +++ b/src/XML/sp_200702/EndorsingEncryptedSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A EndorsingEncryptedSupportingTokens element diff --git a/src/XML/sp_200702/EndorsingSupportingTokens.php b/src/XML/sp_200702/EndorsingSupportingTokens.php index faece866..43a69b71 100644 --- a/src/XML/sp_200702/EndorsingSupportingTokens.php +++ b/src/XML/sp_200702/EndorsingSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A EndorsingSupportingTokens element diff --git a/src/XML/sp_200702/HashPassword.php b/src/XML/sp_200702/HashPassword.php index 012507ef..c269f2aa 100644 --- a/src/XML/sp_200702/HashPassword.php +++ b/src/XML/sp_200702/HashPassword.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An HashPassword element diff --git a/src/XML/sp_200702/HttpBasicAuthentication.php b/src/XML/sp_200702/HttpBasicAuthentication.php index 5bb6fa48..9f0a1c30 100644 --- a/src/XML/sp_200702/HttpBasicAuthentication.php +++ b/src/XML/sp_200702/HttpBasicAuthentication.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An HttpBasicAuthentication element diff --git a/src/XML/sp_200702/HttpDigestAuthentication.php b/src/XML/sp_200702/HttpDigestAuthentication.php index 2d8be34f..09b3da36 100644 --- a/src/XML/sp_200702/HttpDigestAuthentication.php +++ b/src/XML/sp_200702/HttpDigestAuthentication.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An HttpDigestAuthentication element diff --git a/src/XML/sp_200702/HttpsToken.php b/src/XML/sp_200702/HttpsToken.php index af45e31b..d02e8006 100644 --- a/src/XML/sp_200702/HttpsToken.php +++ b/src/XML/sp_200702/HttpsToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An HttpsToken element diff --git a/src/XML/sp_200702/IncludeTimestamp.php b/src/XML/sp_200702/IncludeTimestamp.php index f4a80e2f..6952a97f 100644 --- a/src/XML/sp_200702/IncludeTimestamp.php +++ b/src/XML/sp_200702/IncludeTimestamp.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An IncludeTimestamp element diff --git a/src/XML/sp_200702/InclusiveC14N.php b/src/XML/sp_200702/InclusiveC14N.php index dce05af0..74dea99c 100644 --- a/src/XML/sp_200702/InclusiveC14N.php +++ b/src/XML/sp_200702/InclusiveC14N.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An InclusiveC14N element diff --git a/src/XML/sp_200702/InitiatorEncryptionToken.php b/src/XML/sp_200702/InitiatorEncryptionToken.php index f67f7e02..32562afa 100644 --- a/src/XML/sp_200702/InitiatorEncryptionToken.php +++ b/src/XML/sp_200702/InitiatorEncryptionToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An InitiatorEncryptionToken element diff --git a/src/XML/sp_200702/InitiatorSignatureToken.php b/src/XML/sp_200702/InitiatorSignatureToken.php index d72db8fc..2ccd27cd 100644 --- a/src/XML/sp_200702/InitiatorSignatureToken.php +++ b/src/XML/sp_200702/InitiatorSignatureToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An InitiatorSignatureToken element diff --git a/src/XML/sp_200702/InitiatorToken.php b/src/XML/sp_200702/InitiatorToken.php index 444be76b..6c4d61f2 100644 --- a/src/XML/sp_200702/InitiatorToken.php +++ b/src/XML/sp_200702/InitiatorToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An InitiatorToken element diff --git a/src/XML/sp_200702/IssuedToken.php b/src/XML/sp_200702/IssuedToken.php index 53f923d6..02f3fb91 100644 --- a/src/XML/sp_200702/IssuedToken.php +++ b/src/XML/sp_200702/IssuedToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An IssuedToken element diff --git a/src/XML/sp_200702/IssuerName.php b/src/XML/sp_200702/IssuerName.php index aab2cef6..173a6304 100644 --- a/src/XML/sp_200702/IssuerName.php +++ b/src/XML/sp_200702/IssuerName.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * An IssuerName element @@ -13,16 +14,9 @@ */ final class IssuerName extends AbstractSpElement { - use URIElementTrait; + use TypedTextContentTrait; - /** - * Initialize an IssuerName. - * - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/sp_200702/KerberosToken.php b/src/XML/sp_200702/KerberosToken.php index b9d2d04b..2232623d 100644 --- a/src/XML/sp_200702/KerberosToken.php +++ b/src/XML/sp_200702/KerberosToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An KerberosToken element diff --git a/src/XML/sp_200702/KeyValueToken.php b/src/XML/sp_200702/KeyValueToken.php index a686bdc6..4e117ec3 100644 --- a/src/XML/sp_200702/KeyValueToken.php +++ b/src/XML/sp_200702/KeyValueToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An KeyValueToken element diff --git a/src/XML/sp_200702/Lax.php b/src/XML/sp_200702/Lax.php index 0931440e..86a47c82 100644 --- a/src/XML/sp_200702/Lax.php +++ b/src/XML/sp_200702/Lax.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Lax element diff --git a/src/XML/sp_200702/LaxTsFirst.php b/src/XML/sp_200702/LaxTsFirst.php index 7612ffb8..62c43ff1 100644 --- a/src/XML/sp_200702/LaxTsFirst.php +++ b/src/XML/sp_200702/LaxTsFirst.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An LaxTsFirst element diff --git a/src/XML/sp_200702/LaxTsLast.php b/src/XML/sp_200702/LaxTsLast.php index e6c5075c..7d000fe4 100644 --- a/src/XML/sp_200702/LaxTsLast.php +++ b/src/XML/sp_200702/LaxTsLast.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An LaxTsLast element diff --git a/src/XML/sp_200702/Layout.php b/src/XML/sp_200702/Layout.php index 13b0db69..04e27ac8 100644 --- a/src/XML/sp_200702/Layout.php +++ b/src/XML/sp_200702/Layout.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Layout element diff --git a/src/XML/sp_200702/MustNotSendAmend.php b/src/XML/sp_200702/MustNotSendAmend.php index f00b557e..53c4aad4 100644 --- a/src/XML/sp_200702/MustNotSendAmend.php +++ b/src/XML/sp_200702/MustNotSendAmend.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustNotSendAmend element diff --git a/src/XML/sp_200702/MustNotSendCancel.php b/src/XML/sp_200702/MustNotSendCancel.php index 20368055..8c6b33f1 100644 --- a/src/XML/sp_200702/MustNotSendCancel.php +++ b/src/XML/sp_200702/MustNotSendCancel.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustNotSendCancel element diff --git a/src/XML/sp_200702/MustNotSendRenew.php b/src/XML/sp_200702/MustNotSendRenew.php index e0051757..2ed25b22 100644 --- a/src/XML/sp_200702/MustNotSendRenew.php +++ b/src/XML/sp_200702/MustNotSendRenew.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustNotSendRenew element diff --git a/src/XML/sp_200702/MustSupportClientChallenge.php b/src/XML/sp_200702/MustSupportClientChallenge.php index b6bbe07f..c3e0fd23 100644 --- a/src/XML/sp_200702/MustSupportClientChallenge.php +++ b/src/XML/sp_200702/MustSupportClientChallenge.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportClientChallenge element diff --git a/src/XML/sp_200702/MustSupportIssuedTokens.php b/src/XML/sp_200702/MustSupportIssuedTokens.php index 3c8ba800..cd66e41a 100644 --- a/src/XML/sp_200702/MustSupportIssuedTokens.php +++ b/src/XML/sp_200702/MustSupportIssuedTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportIssuedTokens element diff --git a/src/XML/sp_200702/MustSupportRefEmbeddedToken.php b/src/XML/sp_200702/MustSupportRefEmbeddedToken.php index 14ee6f4f..03c2c55c 100644 --- a/src/XML/sp_200702/MustSupportRefEmbeddedToken.php +++ b/src/XML/sp_200702/MustSupportRefEmbeddedToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefEmbeddedToken element diff --git a/src/XML/sp_200702/MustSupportRefEncryptedKey.php b/src/XML/sp_200702/MustSupportRefEncryptedKey.php index 41f80440..d0d1a143 100644 --- a/src/XML/sp_200702/MustSupportRefEncryptedKey.php +++ b/src/XML/sp_200702/MustSupportRefEncryptedKey.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefEncryptedKey element diff --git a/src/XML/sp_200702/MustSupportRefExternalURI.php b/src/XML/sp_200702/MustSupportRefExternalURI.php index 893c8f42..7192655c 100644 --- a/src/XML/sp_200702/MustSupportRefExternalURI.php +++ b/src/XML/sp_200702/MustSupportRefExternalURI.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefExternalURI element diff --git a/src/XML/sp_200702/MustSupportRefIssuerSerial.php b/src/XML/sp_200702/MustSupportRefIssuerSerial.php index 33cbbda4..6e2baed2 100644 --- a/src/XML/sp_200702/MustSupportRefIssuerSerial.php +++ b/src/XML/sp_200702/MustSupportRefIssuerSerial.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefIssuerSerial element diff --git a/src/XML/sp_200702/MustSupportRefKeyIdentifier.php b/src/XML/sp_200702/MustSupportRefKeyIdentifier.php index 6599fe98..77ffc337 100644 --- a/src/XML/sp_200702/MustSupportRefKeyIdentifier.php +++ b/src/XML/sp_200702/MustSupportRefKeyIdentifier.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefKeyIdentifier element diff --git a/src/XML/sp_200702/MustSupportRefThumbprint.php b/src/XML/sp_200702/MustSupportRefThumbprint.php index 21a8ad5f..26b90963 100644 --- a/src/XML/sp_200702/MustSupportRefThumbprint.php +++ b/src/XML/sp_200702/MustSupportRefThumbprint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportRefThumbprint element diff --git a/src/XML/sp_200702/MustSupportServerChallenge.php b/src/XML/sp_200702/MustSupportServerChallenge.php index 228f0f16..da75d799 100644 --- a/src/XML/sp_200702/MustSupportServerChallenge.php +++ b/src/XML/sp_200702/MustSupportServerChallenge.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An MustSupportServerChallenge element diff --git a/src/XML/sp_200702/NoPassword.php b/src/XML/sp_200702/NoPassword.php index 7b999596..f3ca5af6 100644 --- a/src/XML/sp_200702/NoPassword.php +++ b/src/XML/sp_200702/NoPassword.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An NoPassword element diff --git a/src/XML/sp_200702/OnlySignEntireHeadersAndBody.php b/src/XML/sp_200702/OnlySignEntireHeadersAndBody.php index ec78aca9..83c40c60 100644 --- a/src/XML/sp_200702/OnlySignEntireHeadersAndBody.php +++ b/src/XML/sp_200702/OnlySignEntireHeadersAndBody.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An OnlySignEntireHeadersAndBody element diff --git a/src/XML/sp_200702/ProtectTokens.php b/src/XML/sp_200702/ProtectTokens.php index 7d46404d..eb2c7b54 100644 --- a/src/XML/sp_200702/ProtectTokens.php +++ b/src/XML/sp_200702/ProtectTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An ProtectTokens element diff --git a/src/XML/sp_200702/ProtectionToken.php b/src/XML/sp_200702/ProtectionToken.php index e7e11656..3d65a970 100644 --- a/src/XML/sp_200702/ProtectionToken.php +++ b/src/XML/sp_200702/ProtectionToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ProtectionToken element diff --git a/src/XML/sp_200702/RecipientEncryptionToken.php b/src/XML/sp_200702/RecipientEncryptionToken.php index 60ea2e7f..0a4e5bfd 100644 --- a/src/XML/sp_200702/RecipientEncryptionToken.php +++ b/src/XML/sp_200702/RecipientEncryptionToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RecipientEncryptionToken element diff --git a/src/XML/sp_200702/RecipientSignatureToken.php b/src/XML/sp_200702/RecipientSignatureToken.php index e9b0e173..072cecab 100644 --- a/src/XML/sp_200702/RecipientSignatureToken.php +++ b/src/XML/sp_200702/RecipientSignatureToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RecipientSignatureToken element diff --git a/src/XML/sp_200702/RecipientToken.php b/src/XML/sp_200702/RecipientToken.php index 333b7dc6..6e44d2fe 100644 --- a/src/XML/sp_200702/RecipientToken.php +++ b/src/XML/sp_200702/RecipientToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RecipientToken element diff --git a/src/XML/sp_200702/RelToken.php b/src/XML/sp_200702/RelToken.php index a55b9c36..a807c48d 100644 --- a/src/XML/sp_200702/RelToken.php +++ b/src/XML/sp_200702/RelToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RelToken element diff --git a/src/XML/sp_200702/RequireAppliesTo.php b/src/XML/sp_200702/RequireAppliesTo.php index beccb3a2..78c01f9d 100644 --- a/src/XML/sp_200702/RequireAppliesTo.php +++ b/src/XML/sp_200702/RequireAppliesTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireAppliesTo element diff --git a/src/XML/sp_200702/RequireClientCertificate.php b/src/XML/sp_200702/RequireClientCertificate.php index 6d2d3c5a..6603a8af 100644 --- a/src/XML/sp_200702/RequireClientCertificate.php +++ b/src/XML/sp_200702/RequireClientCertificate.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireClientCertificate element diff --git a/src/XML/sp_200702/RequireClientEntropy.php b/src/XML/sp_200702/RequireClientEntropy.php index 3b641080..8220525e 100644 --- a/src/XML/sp_200702/RequireClientEntropy.php +++ b/src/XML/sp_200702/RequireClientEntropy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireClientEntropy element diff --git a/src/XML/sp_200702/RequireDerivedKeys.php b/src/XML/sp_200702/RequireDerivedKeys.php index 8f587fe9..6ac9610b 100644 --- a/src/XML/sp_200702/RequireDerivedKeys.php +++ b/src/XML/sp_200702/RequireDerivedKeys.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireDerivedKeys element diff --git a/src/XML/sp_200702/RequireEmbeddedTokenReference.php b/src/XML/sp_200702/RequireEmbeddedTokenReference.php index 1ccf763b..d698fb6a 100644 --- a/src/XML/sp_200702/RequireEmbeddedTokenReference.php +++ b/src/XML/sp_200702/RequireEmbeddedTokenReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireEmbeddedTokenReference element diff --git a/src/XML/sp_200702/RequireExplicitDerivedKeys.php b/src/XML/sp_200702/RequireExplicitDerivedKeys.php index b79ec05d..9a0d2cea 100644 --- a/src/XML/sp_200702/RequireExplicitDerivedKeys.php +++ b/src/XML/sp_200702/RequireExplicitDerivedKeys.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireExplicitDerivedKeys element diff --git a/src/XML/sp_200702/RequireExternalReference.php b/src/XML/sp_200702/RequireExternalReference.php index f3306864..89b823a6 100644 --- a/src/XML/sp_200702/RequireExternalReference.php +++ b/src/XML/sp_200702/RequireExternalReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireExternalReference element diff --git a/src/XML/sp_200702/RequireExternalUriReference.php b/src/XML/sp_200702/RequireExternalUriReference.php index 93bed58a..a3536310 100644 --- a/src/XML/sp_200702/RequireExternalUriReference.php +++ b/src/XML/sp_200702/RequireExternalUriReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireExternalUriReference element diff --git a/src/XML/sp_200702/RequireImpliedDerivedKeys.php b/src/XML/sp_200702/RequireImpliedDerivedKeys.php index ab7ca439..8e1995d5 100644 --- a/src/XML/sp_200702/RequireImpliedDerivedKeys.php +++ b/src/XML/sp_200702/RequireImpliedDerivedKeys.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireImpliedDerivedKeys element diff --git a/src/XML/sp_200702/RequireInternalReference.php b/src/XML/sp_200702/RequireInternalReference.php index 3aa93dbf..3c62ddaa 100644 --- a/src/XML/sp_200702/RequireInternalReference.php +++ b/src/XML/sp_200702/RequireInternalReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireInternalReference element diff --git a/src/XML/sp_200702/RequireIssuerSerialReference.php b/src/XML/sp_200702/RequireIssuerSerialReference.php index 5c585e5d..435e2189 100644 --- a/src/XML/sp_200702/RequireIssuerSerialReference.php +++ b/src/XML/sp_200702/RequireIssuerSerialReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireIssuerSerialReference element diff --git a/src/XML/sp_200702/RequireKeyIdentifierReference.php b/src/XML/sp_200702/RequireKeyIdentifierReference.php index fb0f9495..c7980478 100644 --- a/src/XML/sp_200702/RequireKeyIdentifierReference.php +++ b/src/XML/sp_200702/RequireKeyIdentifierReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireKeyIdentifierReference element diff --git a/src/XML/sp_200702/RequireRequestSecurityTokenCollection.php b/src/XML/sp_200702/RequireRequestSecurityTokenCollection.php index f50d95aa..5432e66f 100644 --- a/src/XML/sp_200702/RequireRequestSecurityTokenCollection.php +++ b/src/XML/sp_200702/RequireRequestSecurityTokenCollection.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireRequestSecurityTokenCollection element diff --git a/src/XML/sp_200702/RequireServerEntropy.php b/src/XML/sp_200702/RequireServerEntropy.php index 4c560547..6b957815 100644 --- a/src/XML/sp_200702/RequireServerEntropy.php +++ b/src/XML/sp_200702/RequireServerEntropy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireServerEntropy element diff --git a/src/XML/sp_200702/RequireSignatureConfirmation.php b/src/XML/sp_200702/RequireSignatureConfirmation.php index bc1a740d..12b05157 100644 --- a/src/XML/sp_200702/RequireSignatureConfirmation.php +++ b/src/XML/sp_200702/RequireSignatureConfirmation.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireSignatureConfirmation element diff --git a/src/XML/sp_200702/RequireThumbprintReference.php b/src/XML/sp_200702/RequireThumbprintReference.php index e55558f4..ea11288d 100644 --- a/src/XML/sp_200702/RequireThumbprintReference.php +++ b/src/XML/sp_200702/RequireThumbprintReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireThumbprintReference element diff --git a/src/XML/sp_200702/RequiredElements.php b/src/XML/sp_200702/RequiredElements.php index 556022ff..2bcec454 100644 --- a/src/XML/sp_200702/RequiredElements.php +++ b/src/XML/sp_200702/RequiredElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequiredElements element diff --git a/src/XML/sp_200702/RequiredParts.php b/src/XML/sp_200702/RequiredParts.php index c7e52774..1054e8e2 100644 --- a/src/XML/sp_200702/RequiredParts.php +++ b/src/XML/sp_200702/RequiredParts.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequiredParts element diff --git a/src/XML/sp_200702/RsaKeyValue.php b/src/XML/sp_200702/RsaKeyValue.php index caa1bbb3..3639cc8a 100644 --- a/src/XML/sp_200702/RsaKeyValue.php +++ b/src/XML/sp_200702/RsaKeyValue.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RsaKeyValue element diff --git a/src/XML/sp_200702/SC13SecurityContextToken.php b/src/XML/sp_200702/SC13SecurityContextToken.php index d4b5f834..661207e1 100644 --- a/src/XML/sp_200702/SC13SecurityContextToken.php +++ b/src/XML/sp_200702/SC13SecurityContextToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SC13SecurityContextToken element diff --git a/src/XML/sp_200702/SOAPNormalization10.php b/src/XML/sp_200702/SOAPNormalization10.php index 342b2e88..e17a66f8 100644 --- a/src/XML/sp_200702/SOAPNormalization10.php +++ b/src/XML/sp_200702/SOAPNormalization10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SOAPNormalization10 element diff --git a/src/XML/sp_200702/STRTransform10.php b/src/XML/sp_200702/STRTransform10.php index 710f9279..97f82c8a 100644 --- a/src/XML/sp_200702/STRTransform10.php +++ b/src/XML/sp_200702/STRTransform10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An STRTransform10 element diff --git a/src/XML/sp_200702/SamlToken.php b/src/XML/sp_200702/SamlToken.php index 5e5d6dee..85ea8515 100644 --- a/src/XML/sp_200702/SamlToken.php +++ b/src/XML/sp_200702/SamlToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SamlToken element diff --git a/src/XML/sp_200702/SecureConversationToken.php b/src/XML/sp_200702/SecureConversationToken.php index 80dd1592..f05e6ae8 100644 --- a/src/XML/sp_200702/SecureConversationToken.php +++ b/src/XML/sp_200702/SecureConversationToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SecureConversationToken element diff --git a/src/XML/sp_200702/SecurityContextToken.php b/src/XML/sp_200702/SecurityContextToken.php index 1709419d..c12903a4 100644 --- a/src/XML/sp_200702/SecurityContextToken.php +++ b/src/XML/sp_200702/SecurityContextToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SecurityContextToken element diff --git a/src/XML/sp_200702/SignatureToken.php b/src/XML/sp_200702/SignatureToken.php index 580d6817..85b2576c 100644 --- a/src/XML/sp_200702/SignatureToken.php +++ b/src/XML/sp_200702/SignatureToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignatureToken element diff --git a/src/XML/sp_200702/SignedElements.php b/src/XML/sp_200702/SignedElements.php index 4d224d18..e34bca2c 100644 --- a/src/XML/sp_200702/SignedElements.php +++ b/src/XML/sp_200702/SignedElements.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignedElements element diff --git a/src/XML/sp_200702/SignedEncryptedSupportingTokens.php b/src/XML/sp_200702/SignedEncryptedSupportingTokens.php index 6ba2f568..bd6d54b6 100644 --- a/src/XML/sp_200702/SignedEncryptedSupportingTokens.php +++ b/src/XML/sp_200702/SignedEncryptedSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignedEncryptedSupportingTokens element diff --git a/src/XML/sp_200702/SignedEndorsingEncryptedSupportingTokens.php b/src/XML/sp_200702/SignedEndorsingEncryptedSupportingTokens.php index 27dec845..6c0cde55 100644 --- a/src/XML/sp_200702/SignedEndorsingEncryptedSupportingTokens.php +++ b/src/XML/sp_200702/SignedEndorsingEncryptedSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignedEndorsingEncryptedSupportingTokens element diff --git a/src/XML/sp_200702/SignedEndorsingSupportingTokens.php b/src/XML/sp_200702/SignedEndorsingSupportingTokens.php index 8d1b639b..d37b407e 100644 --- a/src/XML/sp_200702/SignedEndorsingSupportingTokens.php +++ b/src/XML/sp_200702/SignedEndorsingSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignedEndorsingSupportingTokens element diff --git a/src/XML/sp_200702/SignedParts.php b/src/XML/sp_200702/SignedParts.php index 8a703a59..6f6e85fa 100644 --- a/src/XML/sp_200702/SignedParts.php +++ b/src/XML/sp_200702/SignedParts.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignedParts element diff --git a/src/XML/sp_200702/SignedSupportingTokens.php b/src/XML/sp_200702/SignedSupportingTokens.php index 16716894..e475ec41 100644 --- a/src/XML/sp_200702/SignedSupportingTokens.php +++ b/src/XML/sp_200702/SignedSupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SignedSupportingTokens element diff --git a/src/XML/sp_200702/SpnegoContextToken.php b/src/XML/sp_200702/SpnegoContextToken.php index a92418e7..6a6a6035 100644 --- a/src/XML/sp_200702/SpnegoContextToken.php +++ b/src/XML/sp_200702/SpnegoContextToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SpnegoContextToken element diff --git a/src/XML/sp_200702/Strict.php b/src/XML/sp_200702/Strict.php index d73cfac0..9e0205c5 100644 --- a/src/XML/sp_200702/Strict.php +++ b/src/XML/sp_200702/Strict.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Strict element diff --git a/src/XML/sp_200702/SupportingTokens.php b/src/XML/sp_200702/SupportingTokens.php index d89f7afc..a3e64a70 100644 --- a/src/XML/sp_200702/SupportingTokens.php +++ b/src/XML/sp_200702/SupportingTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SupportingTokens element diff --git a/src/XML/sp_200702/SymmetricBinding.php b/src/XML/sp_200702/SymmetricBinding.php index ab0a0d8d..6314e486 100644 --- a/src/XML/sp_200702/SymmetricBinding.php +++ b/src/XML/sp_200702/SymmetricBinding.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SymmetricBinding element diff --git a/src/XML/sp_200702/TransportBinding.php b/src/XML/sp_200702/TransportBinding.php index 05c2397e..6b188d04 100644 --- a/src/XML/sp_200702/TransportBinding.php +++ b/src/XML/sp_200702/TransportBinding.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A TransportBinding element diff --git a/src/XML/sp_200702/TransportToken.php b/src/XML/sp_200702/TransportToken.php index 4fc99fb2..b676eda6 100644 --- a/src/XML/sp_200702/TransportToken.php +++ b/src/XML/sp_200702/TransportToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A TransportToken element diff --git a/src/XML/sp_200702/TripleDes.php b/src/XML/sp_200702/TripleDes.php index b2b7886b..67d3b55d 100644 --- a/src/XML/sp_200702/TripleDes.php +++ b/src/XML/sp_200702/TripleDes.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDes element diff --git a/src/XML/sp_200702/TripleDesRsa15.php b/src/XML/sp_200702/TripleDesRsa15.php index 0555aa80..f6170d72 100644 --- a/src/XML/sp_200702/TripleDesRsa15.php +++ b/src/XML/sp_200702/TripleDesRsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDesRsa15 element diff --git a/src/XML/sp_200702/TripleDesSha256.php b/src/XML/sp_200702/TripleDesSha256.php index 7bab51a4..e85bbc67 100644 --- a/src/XML/sp_200702/TripleDesSha256.php +++ b/src/XML/sp_200702/TripleDesSha256.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDesSha256 element diff --git a/src/XML/sp_200702/TripleDesSha256Rsa15.php b/src/XML/sp_200702/TripleDesSha256Rsa15.php index 14781524..82fc0f81 100644 --- a/src/XML/sp_200702/TripleDesSha256Rsa15.php +++ b/src/XML/sp_200702/TripleDesSha256Rsa15.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An TripleDesSha256Rsa15 element diff --git a/src/XML/sp_200702/Trust13.php b/src/XML/sp_200702/Trust13.php index 1b466049..c492040b 100644 --- a/src/XML/sp_200702/Trust13.php +++ b/src/XML/sp_200702/Trust13.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Trust13 element diff --git a/src/XML/sp_200702/UsernameToken.php b/src/XML/sp_200702/UsernameToken.php index e4dac3d3..4ec03ee7 100644 --- a/src/XML/sp_200702/UsernameToken.php +++ b/src/XML/sp_200702/UsernameToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An UsernameToken element diff --git a/src/XML/sp_200702/Wss10.php b/src/XML/sp_200702/Wss10.php index f3fdda54..25d924b8 100644 --- a/src/XML/sp_200702/Wss10.php +++ b/src/XML/sp_200702/Wss10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Wss10 element diff --git a/src/XML/sp_200702/Wss11.php b/src/XML/sp_200702/Wss11.php index 1a7e870e..141723da 100644 --- a/src/XML/sp_200702/Wss11.php +++ b/src/XML/sp_200702/Wss11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Wss11 element diff --git a/src/XML/sp_200702/WssGssKerberosV5ApReqToken11.php b/src/XML/sp_200702/WssGssKerberosV5ApReqToken11.php index 433b42ae..cc0ea985 100644 --- a/src/XML/sp_200702/WssGssKerberosV5ApReqToken11.php +++ b/src/XML/sp_200702/WssGssKerberosV5ApReqToken11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssGssKerberosV5ApReqToken11 element diff --git a/src/XML/sp_200702/WssKerberosV5ApReqToken11.php b/src/XML/sp_200702/WssKerberosV5ApReqToken11.php index 82f72e97..c84a38f1 100644 --- a/src/XML/sp_200702/WssKerberosV5ApReqToken11.php +++ b/src/XML/sp_200702/WssKerberosV5ApReqToken11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssKerberosV5ApReqToken11 element diff --git a/src/XML/sp_200702/WssRelV10Token10.php b/src/XML/sp_200702/WssRelV10Token10.php index 1f37de6b..0f0b8873 100644 --- a/src/XML/sp_200702/WssRelV10Token10.php +++ b/src/XML/sp_200702/WssRelV10Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV10Token10 element diff --git a/src/XML/sp_200702/WssRelV10Token11.php b/src/XML/sp_200702/WssRelV10Token11.php index 5f36ea6e..e261ccdf 100644 --- a/src/XML/sp_200702/WssRelV10Token11.php +++ b/src/XML/sp_200702/WssRelV10Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV10Token11 element diff --git a/src/XML/sp_200702/WssRelV20Token10.php b/src/XML/sp_200702/WssRelV20Token10.php index e4329cef..d322b667 100644 --- a/src/XML/sp_200702/WssRelV20Token10.php +++ b/src/XML/sp_200702/WssRelV20Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV20Token10 element diff --git a/src/XML/sp_200702/WssRelV20Token11.php b/src/XML/sp_200702/WssRelV20Token11.php index f1879777..7abba7ec 100644 --- a/src/XML/sp_200702/WssRelV20Token11.php +++ b/src/XML/sp_200702/WssRelV20Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssRelV20Token11 element diff --git a/src/XML/sp_200702/WssSamlV11Token10.php b/src/XML/sp_200702/WssSamlV11Token10.php index 2fd152c3..fbf429a0 100644 --- a/src/XML/sp_200702/WssSamlV11Token10.php +++ b/src/XML/sp_200702/WssSamlV11Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV11Token10 element diff --git a/src/XML/sp_200702/WssSamlV11Token11.php b/src/XML/sp_200702/WssSamlV11Token11.php index 7bf29ce0..e19c6784 100644 --- a/src/XML/sp_200702/WssSamlV11Token11.php +++ b/src/XML/sp_200702/WssSamlV11Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV11Token11 element diff --git a/src/XML/sp_200702/WssSamlV20Token11.php b/src/XML/sp_200702/WssSamlV20Token11.php index ac375804..c3dcb137 100644 --- a/src/XML/sp_200702/WssSamlV20Token11.php +++ b/src/XML/sp_200702/WssSamlV20Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssSamlV20Token11 element diff --git a/src/XML/sp_200702/WssUsernameToken10.php b/src/XML/sp_200702/WssUsernameToken10.php index 77d71296..0af92dcb 100644 --- a/src/XML/sp_200702/WssUsernameToken10.php +++ b/src/XML/sp_200702/WssUsernameToken10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssUsernameToken10 element diff --git a/src/XML/sp_200702/WssUsernameToken11.php b/src/XML/sp_200702/WssUsernameToken11.php index 623461dd..838779a6 100644 --- a/src/XML/sp_200702/WssUsernameToken11.php +++ b/src/XML/sp_200702/WssUsernameToken11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssUsernameToken11 element diff --git a/src/XML/sp_200702/WssX509Pkcs7Token10.php b/src/XML/sp_200702/WssX509Pkcs7Token10.php index 1ca2e5c9..9dd9f91a 100644 --- a/src/XML/sp_200702/WssX509Pkcs7Token10.php +++ b/src/XML/sp_200702/WssX509Pkcs7Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509Pkcs7Token10 element diff --git a/src/XML/sp_200702/WssX509Pkcs7Token11.php b/src/XML/sp_200702/WssX509Pkcs7Token11.php index 36372688..51793dd0 100644 --- a/src/XML/sp_200702/WssX509Pkcs7Token11.php +++ b/src/XML/sp_200702/WssX509Pkcs7Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509Pkcs7Token11 element diff --git a/src/XML/sp_200702/WssX509PkiPathV1Token10.php b/src/XML/sp_200702/WssX509PkiPathV1Token10.php index 5f0bcac0..b3d27d27 100644 --- a/src/XML/sp_200702/WssX509PkiPathV1Token10.php +++ b/src/XML/sp_200702/WssX509PkiPathV1Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509PkiPathV1Token10 element diff --git a/src/XML/sp_200702/WssX509PkiPathV1Token11.php b/src/XML/sp_200702/WssX509PkiPathV1Token11.php index 931bf2d4..ed976a35 100644 --- a/src/XML/sp_200702/WssX509PkiPathV1Token11.php +++ b/src/XML/sp_200702/WssX509PkiPathV1Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509PkiPathV1Token11 element diff --git a/src/XML/sp_200702/WssX509V1Token11.php b/src/XML/sp_200702/WssX509V1Token11.php index 360e91d0..a66655d7 100644 --- a/src/XML/sp_200702/WssX509V1Token11.php +++ b/src/XML/sp_200702/WssX509V1Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V1Token11 element diff --git a/src/XML/sp_200702/WssX509V3Token10.php b/src/XML/sp_200702/WssX509V3Token10.php index c852d266..8a024f21 100644 --- a/src/XML/sp_200702/WssX509V3Token10.php +++ b/src/XML/sp_200702/WssX509V3Token10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V3Token10 element diff --git a/src/XML/sp_200702/WssX509V3Token11.php b/src/XML/sp_200702/WssX509V3Token11.php index e8c868d9..db39e8d7 100644 --- a/src/XML/sp_200702/WssX509V3Token11.php +++ b/src/XML/sp_200702/WssX509V3Token11.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An WssX509V3Token11 element diff --git a/src/XML/sp_200702/X509Token.php b/src/XML/sp_200702/X509Token.php index 3ecc0b59..93b6c5d7 100644 --- a/src/XML/sp_200702/X509Token.php +++ b/src/XML/sp_200702/X509Token.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An X509Token element diff --git a/src/XML/sp_200702/XPath.php b/src/XML/sp_200702/XPath.php index e9ee1e73..36ea981a 100644 --- a/src/XML/sp_200702/XPath.php +++ b/src/XML/sp_200702/XPath.php @@ -8,7 +8,8 @@ use DOMXPath; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * An XPath element @@ -17,26 +18,18 @@ */ final class XPath extends AbstractSpElement { - use StringElementTrait; + use TypedTextContentTrait; - /** - * Initialize an XPath. - * - * @param string $content - */ - public function __construct( - string $content, - ) { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** * Validate the content of the element. * * @param string $content The value to go in the XML textContent - * @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure + * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure * @return void */ protected function validateContent(string $content): void diff --git a/src/XML/sp_200702/XPath10.php b/src/XML/sp_200702/XPath10.php index 5d1fbca2..546456ee 100644 --- a/src/XML/sp_200702/XPath10.php +++ b/src/XML/sp_200702/XPath10.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An XPath10 element diff --git a/src/XML/sp_200702/XPathFilter20.php b/src/XML/sp_200702/XPathFilter20.php index 32a817dd..d193fd3f 100644 --- a/src/XML/sp_200702/XPathFilter20.php +++ b/src/XML/sp_200702/XPathFilter20.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An XPathFilter20 element diff --git a/src/XML/wsa_200408/AbstractAttributedQNameType.php b/src/XML/wsa_200408/AbstractAttributedQNameType.php index 1295ad0e..6998d7c7 100644 --- a/src/XML/wsa_200408/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200408/AbstractAttributedQNameType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\QNameElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing AttributedQNameType. @@ -23,7 +24,10 @@ abstract class AbstractAttributedQNameType extends AbstractWsaElement { use ExtendableAttributesTrait; - use QNameElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = QNameValue::class; /** The namespace-attribute for the xs:anyElement element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -32,10 +36,10 @@ abstract class AbstractAttributedQNameType extends AbstractWsaElement /** * AbstractAttributedQNameType constructor. * - * @param string $value The QName. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $value The QName. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(QNameValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -48,7 +52,7 @@ final public function __construct(string $value, array $namespacedAttributes = [ * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -56,7 +60,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(QNameValue::fromDocument($xml->textContent, $xml), self::getAttributesNSFromXML($xml)); } @@ -69,7 +73,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsa_200408/AbstractAttributedURIType.php b/src/XML/wsa_200408/AbstractAttributedURIType.php index 88358d3c..da43850f 100644 --- a/src/XML/wsa_200408/AbstractAttributedURIType.php +++ b/src/XML/wsa_200408/AbstractAttributedURIType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\URIElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing AttributedURIType. @@ -22,7 +23,11 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement { use ExtendableAttributesTrait; - use URIElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -31,10 +36,10 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement /** * AbstractAttributedURIType constructor. * - * @param string $value The localized string. + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $value The localized string. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(AnyURIValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -47,7 +52,7 @@ final public function __construct(string $value, array $namespacedAttributes = [ * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -55,7 +60,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(AnyURIValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -68,7 +73,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsa_200408/AbstractEndpointReferenceType.php b/src/XML/wsa_200408/AbstractEndpointReferenceType.php index 0047752d..7b6ecca7 100644 --- a/src/XML/wsa_200408/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200408/AbstractEndpointReferenceType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; @@ -127,9 +127,9 @@ public function getServiceName(): ?ServiceName * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong - * @throws \SimpleSAML\XML\Exception\MissingAttributeException + * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException * if the supplied element is missing any of the mandatory attributes */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200408/AbstractRelationshipType.php b/src/XML/wsa_200408/AbstractRelationshipType.php index fd3fecf8..1133b468 100644 --- a/src/XML/wsa_200408/AbstractRelationshipType.php +++ b/src/XML/wsa_200408/AbstractRelationshipType.php @@ -6,10 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\URIElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing RelationshipType. @@ -22,7 +24,10 @@ abstract class AbstractRelationshipType extends AbstractWsaElement { use ExtendableAttributesTrait; - use URIElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -31,13 +36,13 @@ abstract class AbstractRelationshipType extends AbstractWsaElement /** * AbstractRelationshipType constructor. * - * @param string $value The localized string. - * @param string|null $relationshipType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $value The localized string. + * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $relationshipType * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $value, - protected ?string $relationshipType = null, + AnyURIValue $value, + protected ?QNameValue $relationshipType = null, array $namespacedAttributes = [], ) { Assert::validQName($relationshipType); @@ -50,7 +55,7 @@ final public function __construct( /** * Retrieve the value of the relationshipType property */ - public function getRelationshipType(): ?string + public function getRelationshipType(): ?QNameValue { return $this->relationshipType; } @@ -62,7 +67,7 @@ public function getRelationshipType(): ?string * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -71,8 +76,10 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - self::getOptionalAttribute($xml, 'RelationshipType', null), + AnyURIValue::fromString($xml->textContent), + $xml->hasAttribute('RelationshipType') + ? QNameValue::fromDocument('RelationshipType', $xml) + : null, self::getAttributesNSFromXML($xml), ); } @@ -87,10 +94,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getRelationshipType() !== null) { - $e->setAttribute('RelationshipType', $this->getRelationshipType()); + $e->setAttribute('RelationshipType', $this->getRelationshipType()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsa_200408/AbstractRetryAfterType.php b/src/XML/wsa_200408/AbstractRetryAfterType.php index 4d42a479..9c00a4d6 100644 --- a/src/XML/wsa_200408/AbstractRetryAfterType.php +++ b/src/XML/wsa_200408/AbstractRetryAfterType.php @@ -6,13 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; - -use function intval; -use function strval; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\NonNegativeIntegerValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing RetryAfterType. @@ -25,6 +23,11 @@ abstract class AbstractRetryAfterType extends AbstractWsaElement { use ExtendableAttributesTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = NonNegativeIntegerValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -33,35 +36,25 @@ abstract class AbstractRetryAfterType extends AbstractWsaElement /** * AbstractRetryAfterType constructor. * - * @param int $value The long. + * @param \SimpleSAML\XMLSchema\Type\NonNegativeIntegerValue $value The long. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected int $value, + protected NonNegativeIntegerValue $value, array $namespacedAttributes = [], ) { - Assert::natural($value, SchemaViolationException::class); // Allows 0 as allowed by xs:nonNegativeInteger - + $this->setContent($value); $this->setAttributesNS($namespacedAttributes); } - /** - * Retrieve the value of the value-attribute - */ - public function getValue(): int - { - return $this->value; - } - - /** * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -69,7 +62,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(intval($xml->textContent), self::getAttributesNSFromXML($xml)); + return new static(NonNegativeIntegerValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -82,7 +75,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = strval($this->getValue()); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsa_200408/AbstractServiceNameType.php b/src/XML/wsa_200408/AbstractServiceNameType.php index 7cb04d56..6d5abf6e 100644 --- a/src/XML/wsa_200408/AbstractServiceNameType.php +++ b/src/XML/wsa_200408/AbstractServiceNameType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\QNameElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing ServiceNameType. @@ -24,7 +25,10 @@ abstract class AbstractServiceNameType extends AbstractWsaElement { use ExtendableAttributesTrait; - use QNameElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = QNameValue::class; /** The namespace-attribute for the xs:anyElement element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -33,17 +37,15 @@ abstract class AbstractServiceNameType extends AbstractWsaElement /** * AbstractServiceNameType constructor. * - * @param string $value The QName. - * @param string|null $portName The PortName. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $value The QName. + * @param \SimpleSAML\XMLSchema\Type\NCNameValue|null $portName The PortName. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $value, - protected ?string $portName = null, + QNameValue $value, + protected ?NCNameValue $portName = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($portName, SchemaViolationException::class); - $this->setContent($value); $this->setAttributesNS($namespacedAttributes); } @@ -52,7 +54,7 @@ final public function __construct( /** * Get the value of the portName property */ - public function getPortName(): ?string + public function getPortName(): ?NCNameValue { return $this->portName; } @@ -64,7 +66,7 @@ public function getPortName(): ?string * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -73,8 +75,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - self::getOptionalAttribute($xml, 'PortName', null), + QNameValue::fromDocument($xml->textContent, $xml), + self::getOptionalAttribute($xml, 'PortName', NCNameValue::class, null), self::getAttributesNSFromXML($xml), ); } @@ -89,10 +91,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getPortName() !== null) { - $e->setAttribute('PortName', $this->getPortName()); + $e->setAttribute('PortName', $this->getPortName()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsa_200408/Action.php b/src/XML/wsa_200408/Action.php index 92c68e15..8a94b8bf 100644 --- a/src/XML/wsa_200408/Action.php +++ b/src/XML/wsa_200408/Action.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI diff --git a/src/XML/wsa_200408/EndpointReference.php b/src/XML/wsa_200408/EndpointReference.php index e98d8e38..1871b89c 100644 --- a/src/XML/wsa_200408/EndpointReference.php +++ b/src/XML/wsa_200408/EndpointReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200408/FaultTo.php b/src/XML/wsa_200408/FaultTo.php index 6612cbcc..8853a88c 100644 --- a/src/XML/wsa_200408/FaultTo.php +++ b/src/XML/wsa_200408/FaultTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200408/From.php b/src/XML/wsa_200408/From.php index 925d35e5..f246535d 100644 --- a/src/XML/wsa_200408/From.php +++ b/src/XML/wsa_200408/From.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200408/MessageID.php b/src/XML/wsa_200408/MessageID.php index a741169c..6637ffd6 100644 --- a/src/XML/wsa_200408/MessageID.php +++ b/src/XML/wsa_200408/MessageID.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI diff --git a/src/XML/wsa_200408/ReferenceParameters.php b/src/XML/wsa_200408/ReferenceParameters.php index 837d4f3f..b89660bf 100644 --- a/src/XML/wsa_200408/ReferenceParameters.php +++ b/src/XML/wsa_200408/ReferenceParameters.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsa:ReferenceParameters element. @@ -51,7 +51,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200408/ReferenceProperties.php b/src/XML/wsa_200408/ReferenceProperties.php index 0ad6a8fa..e3f8c246 100644 --- a/src/XML/wsa_200408/ReferenceProperties.php +++ b/src/XML/wsa_200408/ReferenceProperties.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsa:ReferenceProperties element. @@ -51,7 +51,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200408/RelatesTo.php b/src/XML/wsa_200408/RelatesTo.php index 272c6b68..a2f8b6b3 100644 --- a/src/XML/wsa_200408/RelatesTo.php +++ b/src/XML/wsa_200408/RelatesTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * @package simplesamlphp/ws-security diff --git a/src/XML/wsa_200408/ReplyTo.php b/src/XML/wsa_200408/ReplyTo.php index f023d486..9016f76e 100644 --- a/src/XML/wsa_200408/ReplyTo.php +++ b/src/XML/wsa_200408/ReplyTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200408/RetryAfter.php b/src/XML/wsa_200408/RetryAfter.php index 4b78e9d4..d11edf9f 100644 --- a/src/XML/wsa_200408/RetryAfter.php +++ b/src/XML/wsa_200408/RetryAfter.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * @package simplesamlphp/ws-security diff --git a/src/XML/wsa_200408/To.php b/src/XML/wsa_200408/To.php index 533df172..495e7078 100644 --- a/src/XML/wsa_200408/To.php +++ b/src/XML/wsa_200408/To.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200408; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI diff --git a/src/XML/wsa_200508/AbstractAttributedQNameType.php b/src/XML/wsa_200508/AbstractAttributedQNameType.php index e551a00b..f340fccc 100644 --- a/src/XML/wsa_200508/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200508/AbstractAttributedQNameType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\QNameElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing AttributedQNameType. @@ -23,7 +24,11 @@ abstract class AbstractAttributedQNameType extends AbstractWsaElement { use ExtendableAttributesTrait; - use QNameElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = QNameValue::class; /** The namespace-attribute for the xs:anyElement element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -32,10 +37,10 @@ abstract class AbstractAttributedQNameType extends AbstractWsaElement /** * AbstractAttributedQNameType constructor. * - * @param string $value The QName. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $value The QName. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(QNameValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); @@ -48,7 +53,7 @@ final public function __construct(string $value, array $namespacedAttributes = [ * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -56,7 +61,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(QNameValue::fromDocument($xml->textContent, $xml), self::getAttributesNSFromXML($xml)); } @@ -69,7 +74,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsa_200508/AbstractAttributedURIType.php b/src/XML/wsa_200508/AbstractAttributedURIType.php index 642ce2b8..4b969fdc 100644 --- a/src/XML/wsa_200508/AbstractAttributedURIType.php +++ b/src/XML/wsa_200508/AbstractAttributedURIType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing AttributedURIType. @@ -35,7 +35,7 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement /** * AbstractAttributedURIType constructor. * - * @param \SimpleSAML\XML\Type\AnyURIValue $value The localized URI. + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $value The localized URI. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct(AnyURIValue $value, array $namespacedAttributes = []) @@ -51,7 +51,7 @@ final public function __construct(AnyURIValue $value, array $namespacedAttribute * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200508/AbstractAttributedLongType.php b/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php similarity index 62% rename from src/XML/wsa_200508/AbstractAttributedLongType.php rename to src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php index 0176e7a8..0bd78c4e 100644 --- a/src/XML/wsa_200508/AbstractAttributedLongType.php +++ b/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\UnsignedLongValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing AttributedLongType. @@ -20,10 +20,14 @@ * * @package simplesamlphp/ws-security */ -abstract class AbstractAttributedLongType extends AbstractWsaElement +abstract class AbstractAttributedUnsignedLongType extends AbstractWsaElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = UnsignedLongValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -32,38 +36,23 @@ abstract class AbstractAttributedLongType extends AbstractWsaElement /** * AbstractAttributedLongType constructor. * - * @param string $value The long. + * @param \SimpleSAML\XMLSchema\Type\UnsignedLongValue $value The long. * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ - final public function __construct(string $value, array $namespacedAttributes = []) + final public function __construct(UnsignedLongValue $value, array $namespacedAttributes = []) { $this->setContent($value); $this->setAttributesNS($namespacedAttributes); } - /** - * Validate the content of the element. - * - * @param string $content The value to go in the XML textContent - * @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure - * @return void - */ - protected function validateContent(string $content): void - { - $content = intval($content); - Assert::natural($content, SchemaViolationException::class); - Assert::range($content, 0, 18446744073709551615, SchemaViolationException::class); - } - - /** * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -71,7 +60,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static($xml->textContent, self::getAttributesNSFromXML($xml)); + return new static(UnsignedLongValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); } @@ -84,7 +73,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsa_200508/AbstractEndpointReferenceType.php b/src/XML/wsa_200508/AbstractEndpointReferenceType.php index 1dd43417..f7b585fe 100644 --- a/src/XML/wsa_200508/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200508/AbstractEndpointReferenceType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; @@ -101,9 +101,9 @@ public function getMetadata(): ?Metadata * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong - * @throws \SimpleSAML\XML\Exception\MissingAttributeException + * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException * if the supplied element is missing any of the mandatory attributes */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200508/AbstractProblemActionType.php b/src/XML/wsa_200508/AbstractProblemActionType.php index 6914e62d..52141c33 100644 --- a/src/XML/wsa_200508/AbstractProblemActionType.php +++ b/src/XML/wsa_200508/AbstractProblemActionType.php @@ -6,7 +6,7 @@ use DOMElement; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing WS-addressing ProblemActionType. diff --git a/src/XML/wsa_200508/Action.php b/src/XML/wsa_200508/Action.php index 43086f34..e872d73f 100644 --- a/src/XML/wsa_200508/Action.php +++ b/src/XML/wsa_200508/Action.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI diff --git a/src/XML/wsa_200508/EndpointReference.php b/src/XML/wsa_200508/EndpointReference.php index ec7a0ba2..c3aa7b75 100644 --- a/src/XML/wsa_200508/EndpointReference.php +++ b/src/XML/wsa_200508/EndpointReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200508/FaultTo.php b/src/XML/wsa_200508/FaultTo.php index db9d6e7a..e085ce43 100644 --- a/src/XML/wsa_200508/FaultTo.php +++ b/src/XML/wsa_200508/FaultTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200508/From.php b/src/XML/wsa_200508/From.php index 997f0194..ac94d599 100644 --- a/src/XML/wsa_200508/From.php +++ b/src/XML/wsa_200508/From.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200508/MessageID.php b/src/XML/wsa_200508/MessageID.php index 8ccf1d0b..0f8bdea1 100644 --- a/src/XML/wsa_200508/MessageID.php +++ b/src/XML/wsa_200508/MessageID.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI diff --git a/src/XML/wsa_200508/Metadata.php b/src/XML/wsa_200508/Metadata.php index 687ef12c..54840cf1 100644 --- a/src/XML/wsa_200508/Metadata.php +++ b/src/XML/wsa_200508/Metadata.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsa:Metadata element. @@ -50,7 +51,7 @@ public function __construct(array $children = [], array $namespacedAttributes = */ public function isEmptyElement(): bool { - return empty($this->elements) && empty($this->namespacedAttributes); + return empty($this->getElements()) && empty($this->getAttributesNS()); } @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200508/ProblemAction.php b/src/XML/wsa_200508/ProblemAction.php index 326c82c3..f32d4708 100644 --- a/src/XML/wsa_200508/ProblemAction.php +++ b/src/XML/wsa_200508/ProblemAction.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use function array_pop; @@ -27,7 +28,7 @@ final class ProblemAction extends AbstractProblemActionType implements SchemaVal * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200508/ProblemHeaderQName.php b/src/XML/wsa_200508/ProblemHeaderQName.php index 14063655..df0a820b 100644 --- a/src/XML/wsa_200508/ProblemHeaderQName.php +++ b/src/XML/wsa_200508/ProblemHeaderQName.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed QName diff --git a/src/XML/wsa_200508/ProblemIRI.php b/src/XML/wsa_200508/ProblemIRI.php index fc099ecf..8d4a9031 100644 --- a/src/XML/wsa_200508/ProblemIRI.php +++ b/src/XML/wsa_200508/ProblemIRI.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI diff --git a/src/XML/wsa_200508/ReferenceParameters.php b/src/XML/wsa_200508/ReferenceParameters.php index 54941706..8fa28fe1 100644 --- a/src/XML/wsa_200508/ReferenceParameters.php +++ b/src/XML/wsa_200508/ReferenceParameters.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsa:ReferenceParameters element. @@ -50,7 +51,7 @@ public function __construct(array $children = [], array $namespacedAttributes = */ public function isEmptyElement(): bool { - return empty($this->elements) && empty($this->namespacedAttributes); + return empty($this->getElements()) && empty($this->getAttributesNS()); } @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsa_200508/RelatesTo.php b/src/XML/wsa_200508/RelatesTo.php index 1d9e5a91..b76da147 100644 --- a/src/XML/wsa_200508/RelatesTo.php +++ b/src/XML/wsa_200508/RelatesTo.php @@ -6,12 +6,14 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsa:RelatesTo element. @@ -22,7 +24,10 @@ final class RelatesTo extends AbstractWsaElement implements SchemaValidatableEle { use ExtendableAttributesTrait; use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -31,17 +36,15 @@ final class RelatesTo extends AbstractWsaElement implements SchemaValidatableEle /** * Initialize a wsa:RelatesTo * - * @param string $content - * @param string|null $RelationshipType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $content + * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $RelationshipType * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( - string $content, - protected ?string $RelationshipType = 'http://www.w3.org/2005/08/addressing/reply', + AnyURIValue $content, + protected ?QNameValue $RelationshipType, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($RelationshipType, SchemaViolationException::class); - $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } @@ -50,9 +53,9 @@ public function __construct( /** * Collect the value of the RelationshipType property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\QNameValue|null */ - public function getRelationshipType(): ?string + public function getRelationshipType(): ?QNameValue { return $this->RelationshipType; } @@ -64,7 +67,7 @@ public function getRelationshipType(): ?string * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -73,8 +76,10 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, RelatesTo::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - self::getOptionalAttribute($xml, 'RelationshipType', null), + AnyURIValue::fromString($xml->textContent), + $xml->hasAttribute('RelationshipType') + ? QNameValue::fromDocument($xml->getAttribute('RelationshipType'), $xml) + : null, self::getAttributesNSFromXML($xml), ); } @@ -89,10 +94,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getRelationshipType() !== null) { - $e->setAttribute('RelationshipType', $this->getRelationshipType()); + $e->setAttribute('RelationshipType', $this->getRelationshipType()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsa_200508/ReplyTo.php b/src/XML/wsa_200508/ReplyTo.php index bf6eec29..20928647 100644 --- a/src/XML/wsa_200508/ReplyTo.php +++ b/src/XML/wsa_200508/ReplyTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An endpoint reference diff --git a/src/XML/wsa_200508/RetryAfter.php b/src/XML/wsa_200508/RetryAfter.php index a304fad5..c324d227 100644 --- a/src/XML/wsa_200508/RetryAfter.php +++ b/src/XML/wsa_200508/RetryAfter.php @@ -4,14 +4,15 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed long * * @package simplesamlphp/ws-security */ -final class RetryAfter extends AbstractAttributedLongType implements SchemaValidatableElementInterface +final class RetryAfter extends AbstractAttributedUnsignedLongType implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; } diff --git a/src/XML/wsa_200508/SoapAction.php b/src/XML/wsa_200508/SoapAction.php index 16fca55c..96f11e16 100644 --- a/src/XML/wsa_200508/SoapAction.php +++ b/src/XML/wsa_200508/SoapAction.php @@ -4,59 +4,17 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * @package simplesamlphp/ws-security */ final class SoapAction extends AbstractWsaElement { - use URIElementTrait; + use TypedTextContentTrait; - /** - * Initialize a wsa:SoapAction - * - * @param string $value - */ - public function __construct(string $value) - { - $this->setContent($value); - } - - - /** - * Convert XML into a wsa:SoapAction - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, 'SoapAction', InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, SoapAction::NS, InvalidDOMElementException::class); - - return new static($xml->textContent); - } - - - /** - * Convert this element to XML. - * - * @param \DOMElement|null $parent The element we should append this element to. - * @return \DOMElement - */ - public function toXML(?DOMElement $parent = null): DOMElement - { - $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); - - return $e; - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wsa_200508/To.php b/src/XML/wsa_200508/To.php index 6a7e11dd..c3507427 100644 --- a/src/XML/wsa_200508/To.php +++ b/src/XML/wsa_200508/To.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsa_200508; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An attributed URI From dd6227004d0445fe4cab7ec46b922fbe9213aeef Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 21 Oct 2025 00:02:23 +0200 Subject: [PATCH 06/34] Update .gitattributes --- .gitattributes | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 3b911a49..90edfbd5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,8 +5,10 @@ codecov.yml export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -psalm.xml export-ignore -psalm-dev.xml export-ignore +phpstan-baseline.neon export-ignore +phpstan-baseline-dev.neon export-ignore +phpstan.neon export-ignore +phpstan-dev.neon export-ignore phpcs.xml export-ignore phpunit.xml export-ignore .php_cs.dist export-ignore From cb7b01c291afe07b5cd2c13d2bef6a6e110cf20c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 21 Oct 2025 23:46:46 +0200 Subject: [PATCH 07/34] Start testing on PHP 8.5 --- .github/workflows/php.yml | 18 +++++++++--------- composer.json | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 51f7c2d8..66e24b37 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2', '8.3', '8.4'] + php-version: ['8.2', '8.3', '8.4', '8.5'] uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.3 with: @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4', '8.5'] steps: - name: Setup PHP, with composer and extensions @@ -85,15 +85,15 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Run unit tests with coverage - if: ${{ matrix.php-versions == '8.4' }} + if: ${{ matrix.php-versions == '8.5' }} run: vendor/bin/phpunit - name: Run unit tests (no coverage) - if: ${{ matrix.php-versions != '8.4' }} + if: ${{ matrix.php-versions != '8.5' }} run: vendor/bin/phpunit --no-coverage - name: Save coverage data - if: ${{ matrix.php-versions == '8.4' }} + if: ${{ matrix.php-versions == '8.5' }} uses: actions/upload-artifact@v5 with: name: coverage-data @@ -107,7 +107,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4', '8.5'] steps: - name: Setup PHP, with composer and extensions @@ -160,7 +160,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the higest supported version, so we can use the newest tools - php-version: '8.4' + php-version: '8.5' tools: composer, composer-require-checker, composer-unused, phpcs extensions: ctype, date, dom, filter, pcre, soap, spl, xml coverage: none @@ -193,7 +193,7 @@ jobs: run: composer-unused - name: PHP Code Sniffer - run: phpcs + run: vendor/bin/phpcs - name: PHPStan run: | @@ -212,7 +212,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the lowest supported version - php-version: '8.1' + php-version: '8.2' extensions: ctype, date, dom, filter, pcre, soap, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index 2fad8f83..9e11a0f4 100644 --- a/composer.json +++ b/composer.json @@ -10,18 +10,18 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "ext-dom": "*", "ext-spl": "*", "simplesamlphp/assert": "~1.9.2", "simplesamlphp/saml2": "dev-feature/xsd-types", - "simplesamlphp/xml-common": "~2.0.3", - "simplesamlphp/xml-security": "~2.0.3", - "simplesamlphp/xml-soap": "~2.0.1" + "simplesamlphp/xml-common": "~2.1.2", + "simplesamlphp/xml-security": "~2.0.5", + "simplesamlphp/xml-soap": "~2.0.5" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.9.3" + "simplesamlphp/simplesamlphp-test-framework": "~1.10.3" }, "autoload": { "psr-4": { From 84f42ffa1f05ab78825592f3d9188fe1c2a15d13 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 27 Oct 2025 23:05:44 +0100 Subject: [PATCH 08/34] Fix CI --- .github/workflows/php.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 66e24b37..da02c73a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -151,6 +151,7 @@ jobs: quality: name: Quality control + needs: [unit-tests-linux] runs-on: [ubuntu-latest] steps: @@ -205,7 +206,9 @@ jobs: security: name: Security checks + needs: [unit-tests-linux] runs-on: [ubuntu-latest] + steps: - name: Setup PHP, with composer and extensions # https://github.com/shivammathur/setup-php From b69be1cd7f5441c37afbbe599cfdbd7de7370f33 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 12 Nov 2025 22:59:26 +0100 Subject: [PATCH 09/34] Replace attribute-creation with MustUnderstandValue from soap-lib --- .../WSSecurity/XML/wsa_200508/MessageIDTest.php | 6 +++--- .../XML/wst_200502/AuthenticatorTest.php | 7 +++---- .../XML/wst_200502/CancelTargetTest.php | 7 +++---- tests/WSSecurity/XML/wst_200502/ClaimsTest.php | 8 ++++---- .../WSSecurity/XML/wst_200502/DelegateToTest.php | 7 +++---- .../WSSecurity/XML/wst_200502/EncryptionTest.php | 7 +++---- tests/WSSecurity/XML/wst_200502/EntropyTest.php | 8 ++++---- .../XML/wst_200502/IssuedTokensTest.php | 14 +++++++------- .../XML/wst_200502/KeyExchangeTokenTest.php | 7 +++---- .../WSSecurity/XML/wst_200502/OnBehalfOfTest.php | 7 +++---- .../XML/wst_200502/ParticipantTest.php | 7 +++---- .../XML/wst_200502/ParticipantsTest.php | 7 +++---- tests/WSSecurity/XML/wst_200502/PrimaryTest.php | 7 +++---- .../XML/wst_200502/ProofEncryptionTest.php | 7 +++---- .../XML/wst_200502/RenewTargetTest.php | 7 +++---- ...equestSecurityTokenResponseCollectionTest.php | 14 +++++++------- .../RequestSecurityTokenResponseTest.php | 16 ++++++++-------- .../XML/wst_200502/RequestSecurityTokenTest.php | 16 ++++++++-------- .../XML/wst_200502/RequestedProofTokenTest.php | 7 +++---- .../wst_200502/RequestedSecurityTokenTest.php | 7 +++---- .../XML/wst_200502/SignChallengeResponseTest.php | 10 +++++----- .../XML/wst_200502/SignChallengeTest.php | 10 +++++----- tests/WSSecurity/XML/wst_200502/UseKeyTest.php | 7 +++---- .../XML/wst_200512/AuthenticatorTest.php | 7 +++---- .../XML/wst_200512/CancelTargetTest.php | 7 +++---- tests/WSSecurity/XML/wst_200512/ClaimsTest.php | 8 ++++---- .../WSSecurity/XML/wst_200512/DelegateToTest.php | 7 +++---- .../WSSecurity/XML/wst_200512/EncryptionTest.php | 7 +++---- tests/WSSecurity/XML/wst_200512/EntropyTest.php | 8 ++++---- .../XML/wst_200512/IssuedTokensTest.php | 14 +++++++------- .../XML/wst_200512/KeyExchangeTokenTest.php | 7 +++---- .../WSSecurity/XML/wst_200512/OnBehalfOfTest.php | 7 +++---- .../XML/wst_200512/ParticipantTest.php | 7 +++---- .../XML/wst_200512/ParticipantsTest.php | 7 +++---- tests/WSSecurity/XML/wst_200512/PrimaryTest.php | 7 +++---- .../XML/wst_200512/ProofEncryptionTest.php | 7 +++---- .../XML/wst_200512/RenewTargetTest.php | 7 +++---- .../RequestSecurityTokenCollectionTest.php | 16 ++++++++-------- ...equestSecurityTokenResponseCollectionTest.php | 14 +++++++------- .../RequestSecurityTokenResponseTest.php | 10 +++++----- .../XML/wst_200512/RequestSecurityTokenTest.php | 16 ++++++++-------- .../XML/wst_200512/RequestedProofTokenTest.php | 7 +++---- .../wst_200512/RequestedSecurityTokenTest.php | 7 +++---- .../XML/wst_200512/SignChallengeResponseTest.php | 10 +++++----- .../XML/wst_200512/SignChallengeTest.php | 10 +++++----- tests/WSSecurity/XML/wst_200512/UseKeyTest.php | 7 +++---- .../XML/wst_200512/ValidateTargetTest.php | 7 +++---- 47 files changed, 191 insertions(+), 220 deletions(-) diff --git a/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php b/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php index d26a3882..b6934b6c 100644 --- a/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php +++ b/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as C; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractAttributedURIType; use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; @@ -54,8 +54,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute(C::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php b/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php index 8e15f5e2..50aab6c6 100644 --- a/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php +++ b/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php @@ -7,13 +7,12 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractAuthenticatorType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\Authenticator; use SimpleSAML\WSSecurity\XML\wst_200502\CombinedHash; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -57,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); $authenticator = new Authenticator($combinedHash, [$msgId]); diff --git a/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php b/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php index 9aa39757..c2a7f075 100644 --- a/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php +++ b/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractCancelTargetType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\CancelTarget; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $cancelTarget = new CancelTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ClaimsTest.php b/tests/WSSecurity/XML/wst_200502/ClaimsTest.php index e5a994b2..166b0b15 100644 --- a/tests/WSSecurity/XML/wst_200502/ClaimsTest.php +++ b/tests/WSSecurity/XML/wst_200502/ClaimsTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractClaimsType; @@ -57,10 +57,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr2]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); $claims = new Claims(C::NAMESPACE, [$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/DelegateToTest.php b/tests/WSSecurity/XML/wst_200502/DelegateToTest.php index b4325e9c..c3a1862b 100644 --- a/tests/WSSecurity/XML/wst_200502/DelegateToTest.php +++ b/tests/WSSecurity/XML/wst_200502/DelegateToTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractDelegateToType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\DelegateTo; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $delegateTo = new DelegateTo($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/EncryptionTest.php b/tests/WSSecurity/XML/wst_200502/EncryptionTest.php index e733095e..ffab0a82 100644 --- a/tests/WSSecurity/XML/wst_200502/EncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200502/EncryptionTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractEncryptionType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\Encryption; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $encryption = new Encryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/EntropyTest.php b/tests/WSSecurity/XML/wst_200502/EntropyTest.php index 43cf49b2..d3fdae91 100644 --- a/tests/WSSecurity/XML/wst_200502/EntropyTest.php +++ b/tests/WSSecurity/XML/wst_200502/EntropyTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractEntropyType; @@ -57,10 +57,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr2]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); $entropy = new Entropy([$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php b/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php index 6dfdb8d3..3a627898 100644 --- a/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php +++ b/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\AbstractEndpointReferenceType; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; @@ -58,16 +58,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); $issuedTokens = new IssuedTokens( [$requestSecurityTokenResponse], - [$attr3], + [$attr2], ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php b/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php index 109fc2de..42da4eaa 100644 --- a/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractKeyExchangeTokenType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\KeyExchangeToken; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $keyExchangeToken = new KeyExchangeToken([$msgId]); diff --git a/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php b/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php index 745080ce..e8d9bfd4 100644 --- a/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php +++ b/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractOnBehalfOfType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\OnBehalfOf; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $onBehalfOf = new OnBehalfOf($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ParticipantTest.php b/tests/WSSecurity/XML/wst_200502/ParticipantTest.php index b73803ed..9b0acf8f 100644 --- a/tests/WSSecurity/XML/wst_200502/ParticipantTest.php +++ b/tests/WSSecurity/XML/wst_200502/ParticipantTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractParticipantType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\Participant; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -52,8 +51,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php b/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php index 97af1c63..cf95be7b 100644 --- a/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php +++ b/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractParticipantsType; @@ -15,7 +15,6 @@ use SimpleSAML\WSSecurity\XML\wst_200502\Participant; use SimpleSAML\WSSecurity\XML\wst_200502\Participants; use SimpleSAML\WSSecurity\XML\wst_200502\Primary; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -59,8 +58,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $primary = new Primary($msgId); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/PrimaryTest.php b/tests/WSSecurity/XML/wst_200502/PrimaryTest.php index 7aa94f55..168766c3 100644 --- a/tests/WSSecurity/XML/wst_200502/PrimaryTest.php +++ b/tests/WSSecurity/XML/wst_200502/PrimaryTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractParticipantType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\Primary; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -52,8 +51,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $primary = new Primary($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php b/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php index 2748339c..bd4d52ef 100644 --- a/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractProofEncryptionType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\ProofEncryption; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $proofEncryption = new ProofEncryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php b/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php index 03e97983..dc048ebc 100644 --- a/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php +++ b/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRenewTargetType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\RenewTarget; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $renewTarget = new RenewTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php index 582232f2..2644b14d 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestSecurityTokenResponseCollectionType; @@ -58,16 +58,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); $requestSecurityTokenResponseCollection = new RequestSecurityTokenResponseCollection( [$requestSecurityTokenResponse], - [$attr3], + [$attr2], ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php index 3ae0f45b..843a56c7 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestSecurityTokenResponseType; @@ -57,15 +57,15 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $RequestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($RequestSecurityTokenResponse), + strval($requestSecurityTokenResponse), ); } @@ -75,8 +75,8 @@ public function testMarshalling(): void */ public function testMarshallingEmpty(): void { - $RequestSecurityTokenResponse = new RequestSecurityTokenResponse(); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse(); - $this->assertTrue($RequestSecurityTokenResponse->isEmptyElement()); + $this->assertTrue($requestSecurityTokenResponse->isEmptyElement()); } } diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php index 6308484d..4e78b5fd 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestSecurityTokenType; @@ -57,15 +57,15 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $RequestSecurityToken = new RequestSecurityToken(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $requestSecurityToken = new RequestSecurityToken(C::NAMESPACE, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($RequestSecurityToken), + strval($requestSecurityToken), ); } @@ -75,8 +75,8 @@ public function testMarshalling(): void */ public function testMarshallingEmpty(): void { - $RequestSecurityToken = new RequestSecurityToken(); + $requestSecurityToken = new RequestSecurityToken(); - $this->assertTrue($RequestSecurityToken->isEmptyElement()); + $this->assertTrue($requestSecurityToken->isEmptyElement()); } } diff --git a/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php index fd6ee803..b6282ec1 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestedProofTokenType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\RequestedProofToken; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $requestedProofToken = new RequestedProofToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php index 949cecba..97ba0448 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestedSecurityTokenType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\RequestedSecurityToken; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $requestedSecurityToken = new RequestedSecurityToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php b/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php index 59ee1f1f..e6ca142a 100644 --- a/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php +++ b/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractSignChallengeType; @@ -58,13 +58,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $challenge = new Challenge('accepted'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $signChallengeResponse = new SignChallengeResponse($challenge, [$msgId], [$attr2]); + $signChallengeResponse = new SignChallengeResponse($challenge, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php b/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php index fe5999de..6a01d576 100644 --- a/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php +++ b/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractSignChallengeType; @@ -58,12 +58,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $challenge = new Challenge('accepted'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $signChallenge = new SignChallenge($challenge, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $signChallenge = new SignChallenge($challenge, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/UseKeyTest.php b/tests/WSSecurity/XML/wst_200502/UseKeyTest.php index b28ac832..01722d1e 100644 --- a/tests/WSSecurity/XML/wst_200502/UseKeyTest.php +++ b/tests/WSSecurity/XML/wst_200502/UseKeyTest.php @@ -7,13 +7,12 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractUseKeyType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\UseKey; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -57,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $useKey = new UseKey($msgId, C::NAMESPACE); diff --git a/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php b/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php index 0d03fe34..03f79740 100644 --- a/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php +++ b/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php @@ -7,13 +7,12 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractAuthenticatorType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\Authenticator; use SimpleSAML\WSSecurity\XML\wst_200512\CombinedHash; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -55,8 +54,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); $authenticator = new Authenticator($combinedHash, [$msgId]); diff --git a/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php b/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php index 02e77a84..5d2f653d 100644 --- a/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php +++ b/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractCancelTargetType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\CancelTarget; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $cancelTarget = new CancelTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ClaimsTest.php b/tests/WSSecurity/XML/wst_200512/ClaimsTest.php index b008bad1..24b0be02 100644 --- a/tests/WSSecurity/XML/wst_200512/ClaimsTest.php +++ b/tests/WSSecurity/XML/wst_200512/ClaimsTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractClaimsType; @@ -55,10 +55,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr2]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); $claims = new Claims(C::NAMESPACE, [$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/DelegateToTest.php b/tests/WSSecurity/XML/wst_200512/DelegateToTest.php index 5af350c4..180318e3 100644 --- a/tests/WSSecurity/XML/wst_200512/DelegateToTest.php +++ b/tests/WSSecurity/XML/wst_200512/DelegateToTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractDelegateToType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\DelegateTo; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $delegateTo = new DelegateTo($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/EncryptionTest.php b/tests/WSSecurity/XML/wst_200512/EncryptionTest.php index a013c61a..835c89cc 100644 --- a/tests/WSSecurity/XML/wst_200512/EncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200512/EncryptionTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractEncryptionType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\Encryption; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $encryption = new Encryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/EntropyTest.php b/tests/WSSecurity/XML/wst_200512/EntropyTest.php index a14e9901..97ec79aa 100644 --- a/tests/WSSecurity/XML/wst_200512/EntropyTest.php +++ b/tests/WSSecurity/XML/wst_200512/EntropyTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractEntropyType; @@ -55,10 +55,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr2]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); $entropy = new Entropy([$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php b/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php index 69c6ba86..a29f9b6e 100644 --- a/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php +++ b/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractEndpointReferenceType; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; @@ -56,16 +56,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); $issuedTokens = new IssuedTokens( [$requestSecurityTokenResponse], - [$attr3], + [$attr2], ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php b/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php index 7a9f4885..00fc5dab 100644 --- a/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractKeyExchangeTokenType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\KeyExchangeToken; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $keyExchangeToken = new KeyExchangeToken([$msgId]); diff --git a/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php b/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php index 91361557..90f2fbc1 100644 --- a/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php +++ b/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractOnBehalfOfType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\OnBehalfOf; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $onBehalfOf = new OnBehalfOf($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ParticipantTest.php b/tests/WSSecurity/XML/wst_200512/ParticipantTest.php index 89aa30da..2ccc96e0 100644 --- a/tests/WSSecurity/XML/wst_200512/ParticipantTest.php +++ b/tests/WSSecurity/XML/wst_200512/ParticipantTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractParticipantType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\Participant; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -52,8 +51,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php b/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php index adb70862..7e56186e 100644 --- a/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php +++ b/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractParticipantsType; @@ -15,7 +15,6 @@ use SimpleSAML\WSSecurity\XML\wst_200512\Participant; use SimpleSAML\WSSecurity\XML\wst_200512\Participants; use SimpleSAML\WSSecurity\XML\wst_200512\Primary; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -57,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $primary = new Primary($msgId); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/PrimaryTest.php b/tests/WSSecurity/XML/wst_200512/PrimaryTest.php index 46ba105f..8476f3f5 100644 --- a/tests/WSSecurity/XML/wst_200512/PrimaryTest.php +++ b/tests/WSSecurity/XML/wst_200512/PrimaryTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractParticipantType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\Primary; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -52,8 +51,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $primary = new Primary($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php b/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php index 23dd4877..5b254d3f 100644 --- a/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractProofEncryptionType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\ProofEncryption; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $proofEncryption = new ProofEncryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php b/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php index 79f80d76..c4c9f2b6 100644 --- a/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php +++ b/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRenewTargetType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\RenewTarget; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $renewTarget = new RenewTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php index 31a29747..29dd3e93 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestSecurityTokenCollectionType; @@ -56,14 +56,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $msgId1 = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); - $msgId2 = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId1 = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId2 = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df', [$mustUnderstand->toAttribute()]); - $requestSecurityToken1 = new RequestSecurityToken(C::NAMESPACE, [$msgId1], [$attr2]); - $requestSecurityToken2 = new RequestSecurityToken(C::NAMESPACE, [$msgId2], [$attr3]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $requestSecurityToken1 = new RequestSecurityToken(C::NAMESPACE, [$msgId1], [$attr1]); + $requestSecurityToken2 = new RequestSecurityToken(C::NAMESPACE, [$msgId2], [$attr2]); $requestSecurityTokenCollection = new RequestSecurityTokenCollection([ $requestSecurityToken1, diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php index acff6f7e..a3b03b79 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestSecurityTokenResponseCollectionType; @@ -56,16 +56,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); $requestSecurityTokenResponseCollection = new RequestSecurityTokenResponseCollection( [$requestSecurityTokenResponse], - [$attr3], + [$attr2], ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php index 0a789498..acf14712 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestSecurityTokenResponseType; @@ -55,11 +55,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $RequestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]); + $RequestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php index d05a3919..97099291 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestSecurityTokenType; @@ -55,15 +55,15 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $RequestSecurityToken = new RequestSecurityToken(C::NAMESPACE, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $requestSecurityToken = new RequestSecurityToken(C::NAMESPACE, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($RequestSecurityToken), + strval($requestSecurityToken), ); } @@ -73,8 +73,8 @@ public function testMarshalling(): void */ public function testMarshallingEmpty(): void { - $RequestSecurityToken = new RequestSecurityToken(); + $requestSecurityToken = new RequestSecurityToken(); - $this->assertTrue($RequestSecurityToken->isEmptyElement()); + $this->assertTrue($requestSecurityToken->isEmptyElement()); } } diff --git a/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php b/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php index 9177ea78..60a412fc 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestedProofTokenType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\RequestedProofToken; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $requestedProofToken = new RequestedProofToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php index ea0743cf..ef012a79 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestedSecurityTokenType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\RequestedSecurityToken; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $requestedSecurityToken = new RequestedSecurityToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php b/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php index 4fb5fdc8..fe3b5274 100644 --- a/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php +++ b/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractSignChallengeType; @@ -56,13 +56,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $challenge = new Challenge('accepted'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $signChallengeResponse = new SignChallengeResponse($challenge, [$msgId], [$attr2]); + $signChallengeResponse = new SignChallengeResponse($challenge, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php b/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php index 21cb8657..4e24b80e 100644 --- a/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php +++ b/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractSignChallengeType; @@ -56,12 +56,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $challenge = new Challenge('accepted'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $signChallenge = new SignChallenge($challenge, [$msgId], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $signChallenge = new SignChallenge($challenge, [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/UseKeyTest.php b/tests/WSSecurity/XML/wst_200512/UseKeyTest.php index 99ef39c9..19a98ec7 100644 --- a/tests/WSSecurity/XML/wst_200512/UseKeyTest.php +++ b/tests/WSSecurity/XML/wst_200512/UseKeyTest.php @@ -7,13 +7,12 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractUseKeyType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\UseKey; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -55,8 +54,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $useKey = new UseKey($msgId, C::NAMESPACE); diff --git a/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php b/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php index 780eaacc..f1ff37f7 100644 --- a/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php +++ b/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php @@ -7,12 +7,11 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\SOAP\Constants as SOAP; +use SimpleSAML\SOAP11\Type\MustUnderstandValue; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractValidateTargetType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\ValidateTarget; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1'); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]); + $mustUnderstand = MustUnderstandValue::fromBoolean(true); + $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); $validateTarget = new ValidateTarget($msgId); From 251c073df4cc83b7ec13b784f205af1f121dc59a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 12 Nov 2025 23:02:51 +0100 Subject: [PATCH 10/34] Fix version constraint --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9e11a0f4..d83bbebd 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "ext-spl": "*", - "simplesamlphp/assert": "~1.9.2", + "simplesamlphp/assert": "~1.9.1", "simplesamlphp/saml2": "dev-feature/xsd-types", "simplesamlphp/xml-common": "~2.1.2", "simplesamlphp/xml-security": "~2.0.5", From 06ce0aa4cc2bdcdc23d51505db6e43222619fee2 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 12 Nov 2025 23:27:40 +0100 Subject: [PATCH 11/34] Migrate wsaw to xsd-types --- src/XML/wsaw/AbstractAttributedQNameType.php | 14 +++++++---- src/XML/wsaw/AbstractServiceNameType.php | 25 +++++++++++-------- src/XML/wsaw/ActionTrait.php | 14 +++++------ src/XML/wsaw/Anonymous.php | 3 ++- src/XML/wsaw/InterfaceName.php | 3 ++- src/XML/wsaw/ServiceName.php | 3 ++- src/XML/wsaw/UsingAddressing.php | 3 ++- .../WSSecurity/XML/wsaw/InterfaceNameTest.php | 3 ++- tests/WSSecurity/XML/wsaw/ServiceNameTest.php | 3 ++- 9 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/XML/wsaw/AbstractAttributedQNameType.php b/src/XML/wsaw/AbstractAttributedQNameType.php index e5fa6a29..c59ebfff 100644 --- a/src/XML/wsaw/AbstractAttributedQNameType.php +++ b/src/XML/wsaw/AbstractAttributedQNameType.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\QNameElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * Abstract class defining the AttributedQName type @@ -17,20 +18,23 @@ abstract class AbstractAttributedQNameType extends AbstractWsawElement { use ExtendableAttributesTrait; - use QNameElementTrait; + use TypedTextContentTrait; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** @var string */ + public const TEXTCONTENT_TYPE = QNameValue::class; + /** * AbstractAttributedQNameType constructor * - * @param string $value + * @param \SimpleSAML\XMLSchema\Type\QNameValue $value * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ public function __construct( - string $value, + QNameValue $value, array $namespacedAttributes = [], ) { $this->setContent($value); @@ -47,7 +51,7 @@ public function __construct( public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsaw/AbstractServiceNameType.php b/src/XML/wsaw/AbstractServiceNameType.php index 9790c6a9..3e9d99ea 100644 --- a/src/XML/wsaw/AbstractServiceNameType.php +++ b/src/XML/wsaw/AbstractServiceNameType.php @@ -8,8 +8,10 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\QNameElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * Abstract class defining the ServiceNameType type @@ -19,26 +21,27 @@ abstract class AbstractServiceNameType extends AbstractWsawElement { use ExtendableAttributesTrait; - use QNameElementTrait; + use TypedTextContentTrait; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** @var string */ + public const TEXTCONTENT_TYPE = QNameValue::class; + /** * AbstractServiceName constructor * - * @param string $value - * @param string|null $endpointName + * @param \SimpleSAML\XMLSchema\Type\QNameValue $value + * @param \SimpleSAML\XMLSchema\Type\NCNameValue|null $endpointName * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ public function __construct( - string $value, + QNameValue $value, protected ?string $endpointName = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($endpointName, SchemaViolationException::class); - $this->setContent($value); $this->setAttributesNS($namespacedAttributes); } @@ -47,9 +50,9 @@ public function __construct( /** * Collect the value of the endpointName property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\NCNameValue|null */ - public function getEndpointName(): ?string + public function getEndpointName(): ?NCNameValue { return $this->endpointName; } @@ -64,10 +67,10 @@ public function getEndpointName(): ?string public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getEndpointName() !== null) { - $e->setAttribute('EndpointName', $this->getEndpointName()); + $e->setAttribute('EndpointName', $this->getEndpointName()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsaw/ActionTrait.php b/src/XML/wsaw/ActionTrait.php index d8818fb5..b5fdab21 100644 --- a/src/XML/wsaw/ActionTrait.php +++ b/src/XML/wsaw/ActionTrait.php @@ -6,6 +6,7 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * Trait adding methods to handle elements that define the action-attribute. @@ -15,17 +16,17 @@ trait ActionTrait { /** - * @var string|null + * @var \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - protected ?string $action; + protected ?AnyURIValue $action; /** * Collect the value of the action property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getAction(): ?string + public function getAction(): ?AnyURIValue { return $this->action; } @@ -34,12 +35,11 @@ public function getAction(): ?string /** * Set the value of the action property. * - * @param string|null $action + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $action * @throws \SimpleSAML\XML\Exception\SchemViolationException */ - protected function setAction(?string $action): void + protected function setAction(?AnyURIValue $action): void { - Assert::nullOrValidURI($action, SchemaViolationException::class); $this->action = $action; } } diff --git a/src/XML/wsaw/Anonymous.php b/src/XML/wsaw/Anonymous.php index d99828db..c37e696c 100644 --- a/src/XML/wsaw/Anonymous.php +++ b/src/XML/wsaw/Anonymous.php @@ -9,7 +9,8 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\XsNamespace as NS; use ValueError; diff --git a/src/XML/wsaw/InterfaceName.php b/src/XML/wsaw/InterfaceName.php index 7b7bf730..625d710d 100644 --- a/src/XML/wsaw/InterfaceName.php +++ b/src/XML/wsaw/InterfaceName.php @@ -7,7 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the InterfaceName element diff --git a/src/XML/wsaw/ServiceName.php b/src/XML/wsaw/ServiceName.php index 9ee03f86..abc470e1 100644 --- a/src/XML/wsaw/ServiceName.php +++ b/src/XML/wsaw/ServiceName.php @@ -7,7 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the ServiceName element diff --git a/src/XML/wsaw/UsingAddressing.php b/src/XML/wsaw/UsingAddressing.php index 9a090578..a673d82c 100644 --- a/src/XML/wsaw/UsingAddressing.php +++ b/src/XML/wsaw/UsingAddressing.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\XsNamespace as NS; /** diff --git a/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php b/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php index c21c00c7..f07a86db 100644 --- a/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php +++ b/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\QNameValue; use function dirname; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $interfaceName = new InterfaceName('ssp:Chunk', [$attr]); + $interfaceName = new InterfaceName(QNameValue('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsaw/ServiceNameTest.php b/tests/WSSecurity/XML/wsaw/ServiceNameTest.php index 8e0a2b22..e8b5a2ef 100644 --- a/tests/WSSecurity/XML/wsaw/ServiceNameTest.php +++ b/tests/WSSecurity/XML/wsaw/ServiceNameTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\QNameValue; use function dirname; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr]); + $serviceName = new ServiceName(QNameValue('{urn:x-simplesamlphp:namespace}ssp:Chunk'), 'PHPUnit', [$attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), From 10c49cf5e0a531e87ec09e0b2fb34b355b181b3a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 13 Nov 2025 00:23:50 +0100 Subject: [PATCH 12/34] Migrate wsse to xsd-types --- src/XML/wsse/AbstractAttributedString.php | 26 ++++++++------ .../wsse/AbstractBinarySecurityTokenType.php | 33 +++++++++--------- src/XML/wsse/AbstractEmbeddedType.php | 17 +++++----- src/XML/wsse/AbstractEncodedString.php | 23 +++++++------ src/XML/wsse/AbstractKeyIdentifierType.php | 34 +++++++++---------- src/XML/wsse/AbstractPasswordString.php | 27 ++++++++------- src/XML/wsse/AbstractReferenceType.php | 30 ++++++++-------- src/XML/wsse/AbstractSecurityHeaderType.php | 1 + .../AbstractSecurityTokenReferenceType.php | 31 +++++++++++------ .../AbstractTransformationParametersType.php | 1 + src/XML/wsse/AbstractUsernameTokenType.php | 19 +++++++---- src/XML/wsse/BinarySecurityToken.php | 3 +- src/XML/wsse/Embedded.php | 3 +- src/XML/wsse/KeyIdentifier.php | 3 +- src/XML/wsse/Nonce.php | 3 +- src/XML/wsse/Password.php | 3 +- src/XML/wsse/Reference.php | 3 +- src/XML/wsse/Security.php | 3 +- src/XML/wsse/SecurityTokenReference.php | 3 +- src/XML/wsse/TransformationParameters.php | 3 +- src/XML/wsse/UsageTrait.php | 14 ++++---- src/XML/wsse/UsernameToken.php | 3 +- .../WSSecurity/XML/wsaw/InterfaceNameTest.php | 5 ++- tests/WSSecurity/XML/wsaw/ServiceNameTest.php | 6 +++- 24 files changed, 167 insertions(+), 130 deletions(-) diff --git a/src/XML/wsse/AbstractAttributedString.php b/src/XML/wsse/AbstractAttributedString.php index 80505d28..be271e2c 100644 --- a/src/XML/wsse/AbstractAttributedString.php +++ b/src/XML/wsse/AbstractAttributedString.php @@ -10,8 +10,10 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_unshift; @@ -25,35 +27,37 @@ abstract class AbstractAttributedString extends AbstractWsseElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; + /** * AbstractAttributedString constructor * - * @param string $content - * @param string|null $Id + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( - string $content, - protected ?string $Id = null, + StringValue $content, + protected ?IDValue $Id = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($Id); - $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\IDValue|null */ - public function getId(): ?string + public function getId(): ?IDValue { return $this->Id; } @@ -95,7 +99,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); $attributes = $this->getAttributesNS(); if ($this->getId() !== null) { diff --git a/src/XML/wsse/AbstractBinarySecurityTokenType.php b/src/XML/wsse/AbstractBinarySecurityTokenType.php index 6eb06d01..4b960cd9 100644 --- a/src/XML/wsse/AbstractBinarySecurityTokenType.php +++ b/src/XML/wsse/AbstractBinarySecurityTokenType.php @@ -8,8 +8,10 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Class defining the BinarySecurityTokenType element @@ -25,29 +27,28 @@ abstract class AbstractBinarySecurityTokenType extends AbstractEncodedString /** * AbstractBinarySecurityTokenType constructor * - * @param string $content - * @param string|null $valueType - * @param string|null $Id - * @param string|null $EncodingType + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $content, - protected ?string $valueType = null, - ?string $Id = null, + StringValue $content, + protected ?AnyURIValue $valueType = null, + ?IDValue $Id = null, ?string $EncodingType = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($valueType, SchemaViolationException::class); - + Assert::validBase64Binary($content->getValue()); parent::__construct($content, $Id, $EncodingType, $namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getValueType(): ?string + public function getValueType(): ?AnyURIValue { return $this->valueType; } @@ -79,10 +80,10 @@ public static function fromXML(DOMElement $xml): static } return new static( - $xml->textContent, - self::getOptionalAttribute($xml, 'ValueType', null), + StringValue::fromString($xml->textContent), + self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), $Id, - self::getOptionalAttribute($xml, 'EncodingType', null), + self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), $nsAttributes, ); } @@ -99,7 +100,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::toXML($parent); if ($this->getValueType() !== null) { - $e->setAttribute('ValueType', $this->getValueType()); + $e->setAttribute('ValueType', $this->getValueType()->getValue()); } return $e; diff --git a/src/XML/wsse/AbstractEmbeddedType.php b/src/XML/wsse/AbstractEmbeddedType.php index 20310363..7c7de5de 100644 --- a/src/XML/wsse/AbstractEmbeddedType.php +++ b/src/XML/wsse/AbstractEmbeddedType.php @@ -7,10 +7,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * Class defining the EmbeddedType element @@ -22,6 +22,7 @@ abstract class AbstractEmbeddedType extends AbstractWsseElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -32,26 +33,24 @@ abstract class AbstractEmbeddedType extends AbstractWsseElement /** * AbstractEmbeddedType constructor * - * @param string|null $valueType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $valueType = null, + protected ?AnyURIValue $valueType = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($valueType, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getValueType(): ?string + public function getValueType(): ?AnyURIValue { return $this->valueType; } @@ -85,7 +84,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'ValueType', null), + self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +102,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getValueType() !== null) { - $e->setAttribute('ValueType', $this->getValueType()); + $e->setAttribute('ValueType', $this->getValueType()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsse/AbstractEncodedString.php b/src/XML/wsse/AbstractEncodedString.php index 85e0fcba..9adc7dc3 100644 --- a/src/XML/wsse/AbstractEncodedString.php +++ b/src/XML/wsse/AbstractEncodedString.php @@ -8,6 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Abstract class defining the EncodedString type @@ -21,27 +24,25 @@ abstract class AbstractEncodedString extends AbstractAttributedString /** * AbstractEncodedString constructor * - * @param string $content - * @param string|null $Id - * @param string|null $EncodingType + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( - string $content, - ?string $Id = null, - protected ?string $EncodingType = null, + StringValue $content, + ?IDValue $Id = null, + protected ?AnyURIValue $EncodingType = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($EncodingType); - parent::__construct($content, $Id, $namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getEncodingType(): ?string + public function getEncodingType(): ?AnyURIValue { return $this->EncodingType; } @@ -90,7 +91,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::toXML($parent); if ($this->getEncodingType() !== null) { - $e->setAttribute('EncodingType', $this->getEncodingType()); + $e->setAttribute('EncodingType', $this->getEncodingType()->getValue()); } return $e; diff --git a/src/XML/wsse/AbstractKeyIdentifierType.php b/src/XML/wsse/AbstractKeyIdentifierType.php index 55f46b47..045f940a 100644 --- a/src/XML/wsse/AbstractKeyIdentifierType.php +++ b/src/XML/wsse/AbstractKeyIdentifierType.php @@ -8,7 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Class defining the KeyIdentifierType element @@ -20,29 +22,27 @@ abstract class AbstractKeyIdentifierType extends AbstractEncodedString /** * AbstractKeyIdentifierType constructor * - * @param string $content - * @param string|null $valueType - * @param string|null $Id - * @param string|null $EncodingType + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $content, - protected ?string $valueType = null, - ?string $Id = null, - ?string $EncodingType = null, + StringValue $content, + protected ?AnyURIValue $valueType = null, + ?IDValue $Id = null, + ?AnyURIValue $EncodingType = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($valueType, SchemaViolationException::class); - parent::__construct($content, $Id, $EncodingType, $namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getValueType(): ?string + public function getValueType(): ?AnyURIValue { return $this->valueType; } @@ -74,10 +74,10 @@ public static function fromXML(DOMElement $xml): static } return new static( - $xml->textContent, - self::getOptionalAttribute($xml, 'ValueType', null), + StringValue::fromString($xml->textContent), + self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), $Id, - self::getOptionalAttribute($xml, 'EncodingType', null), + self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), $nsAttributes, ); } @@ -94,7 +94,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::toXML($parent); if ($this->getValueType() !== null) { - $e->setAttribute('ValueType', $this->getValueType()); + $e->setAttribute('ValueType', $this->getValueType()->getValue()); } return $e; diff --git a/src/XML/wsse/AbstractPasswordString.php b/src/XML/wsse/AbstractPasswordString.php index 0664ee3d..fb46590b 100644 --- a/src/XML/wsse/AbstractPasswordString.php +++ b/src/XML/wsse/AbstractPasswordString.php @@ -8,6 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Abstract class defining the PasswordString type @@ -19,28 +22,26 @@ abstract class AbstractPasswordString extends AbstractAttributedString /** * AbstractPasswordString constructor * - * @param string $content - * @param string|null $Id - * @param string|null $Type + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Type * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( #[\SensitiveParameter] - string $content, - ?string $Id = null, - protected ?string $Type = null, + StringValue $content, + ?IDValue $Id = null, + protected ?AnyURIValue $Type = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($Type); - parent::__construct($content, $Id, $namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getType(): ?string + public function getType(): ?AnyURIValue { return $this->Type; } @@ -72,9 +73,9 @@ public static function fromXML(DOMElement $xml): static } return new static( - $xml->textContent, + StringValue::fromString($xml->textContent), $Id, - self::getOptionalAttribute($xml, 'Type', null), + self::getOptionalAttribute($xml, 'Type', AnyURIValue::class, null), $nsAttributes, ); } @@ -89,7 +90,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::toXML($parent); if ($this->getType() !== null) { - $e->setAttribute('Type', $this->getType()); + $e->setAttribute('Type', $this->getType()->getValue()); } return $e; diff --git a/src/XML/wsse/AbstractReferenceType.php b/src/XML/wsse/AbstractReferenceType.php index 84887ba5..2e6f6d31 100644 --- a/src/XML/wsse/AbstractReferenceType.php +++ b/src/XML/wsse/AbstractReferenceType.php @@ -7,9 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * Class defining the ReferenceType element @@ -20,6 +20,7 @@ abstract class AbstractReferenceType extends AbstractWsseElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -27,35 +28,32 @@ abstract class AbstractReferenceType extends AbstractWsseElement /** * AbstractReferenceType constructor * - * @param string|null $URI - * @param string|null $valueType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $URI + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $URI = null, - protected ?string $valueType = null, + protected ?AnyURIValue $URI = null, + protected ?AnyURIValue $valueType = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($URI, SchemaViolationException::class); - Assert::nullOrValidURI($valueType, SchemaViolationException::class); - $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getValueType(): ?string + public function getValueType(): ?AnyURIValue { return $this->valueType; } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getURI(): ?string + public function getURI(): ?AnyURIValue { return $this->URI; } @@ -76,8 +74,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'URI', null), - self::getOptionalAttribute($xml, 'ValueType', null), + self::getOptionalAttribute($xml, 'URI', AnyURIValue::class, null), + self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), self::getAttributesNSFromXML($xml), ); } @@ -94,11 +92,11 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getURI() !== null) { - $e->setAttribute('URI', $this->getURI()); + $e->setAttribute('URI', $this->getURI()->getValue()); } if ($this->getValueType() !== null) { - $e->setAttribute('ValueType', $this->getValueType()); + $e->setAttribute('ValueType', $this->getValueType()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsse/AbstractSecurityHeaderType.php b/src/XML/wsse/AbstractSecurityHeaderType.php index e5e8fc83..7072fa26 100644 --- a/src/XML/wsse/AbstractSecurityHeaderType.php +++ b/src/XML/wsse/AbstractSecurityHeaderType.php @@ -21,6 +21,7 @@ abstract class AbstractSecurityHeaderType extends AbstractWsseElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index 971f6eb4..d558abdf 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -12,6 +12,8 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\IDValue; use function array_unshift; @@ -26,6 +28,7 @@ abstract class AbstractSecurityTokenReferenceType extends AbstractWsseElement use ExtendableElementTrait; use UsageTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -41,19 +44,17 @@ abstract class AbstractSecurityTokenReferenceType extends AbstractWsseElement /** * AbstractSecurityReferenceType constructor * - * @param string|null $Id - * @param string|null $Usage + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Usage * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $Id = null, - ?string $Usage = null, + protected ?IDValue $Id = null, + ?AnyURIValue $Usage = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($Id); - $this->setUsage($Usage); $this->setElements($children); $this->setAttributesNS($namespacedAttributes); @@ -61,9 +62,9 @@ final public function __construct( /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\IDValue|null */ - public function getId(): ?string + public function getId(): ?IDValue { return $this->Id; } @@ -97,9 +98,19 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + $Id = null; + if ($xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id')) { + $Id = IDValue::fromString($xml->getAttributeNS(C::NS_SEC_UTIL, 'Id')); + } + + $Usage = null; + if ($xml->hasAttributeNS(C::NS_SEC_EXT, 'Usage')) { + $Usage = AnyURIValue::fromString($xml->getAttributeNS(C::NS_SEC_EXT, 'Usage')); + } + return new static( - $xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id') ? $xml->getAttributeNS(C::NS_SEC_UTIL, 'Id') : null, - $xml->hasAttributeNS(C::NS_SEC_EXT, 'Usage') ? $xml->getAttributeNS(C::NS_SEC_EXT, 'Usage') : null, + $Id, + $Usage, self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/wsse/AbstractTransformationParametersType.php b/src/XML/wsse/AbstractTransformationParametersType.php index 451455a2..078678a2 100644 --- a/src/XML/wsse/AbstractTransformationParametersType.php +++ b/src/XML/wsse/AbstractTransformationParametersType.php @@ -21,6 +21,7 @@ abstract class AbstractTransformationParametersType extends AbstractWsseElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsse/AbstractUsernameTokenType.php b/src/XML/wsse/AbstractUsernameTokenType.php index 1eb48081..4ead4f88 100644 --- a/src/XML/wsse/AbstractUsernameTokenType.php +++ b/src/XML/wsse/AbstractUsernameTokenType.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\IDValue; use function array_pop; use function array_unshift; @@ -28,6 +29,7 @@ abstract class AbstractUsernameTokenType extends AbstractWsseElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -49,27 +51,25 @@ abstract class AbstractUsernameTokenType extends AbstractWsseElement * AbstractUsernameTokenType constructor * * @param \SimpleSAML\WSSecurity\XML\wsse\Username $username - * @param string|null $Id + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id * @param \SimpleSAML\XML\SerializableElementInterface[] $children * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ final public function __construct( protected Username $username, - protected ?string $Id = null, + protected ?IDValue $Id = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($Id); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\IDValue|null */ - public function getId(): ?string + public function getId(): ?IDValue { return $this->Id; } @@ -102,9 +102,14 @@ public static function fromXML(DOMElement $xml): static Assert::minCount($username, 1, MissingElementException::class); Assert::maxCount($username, 1, TooManyElementsException::class); + $Id = null; + if ($xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id')) { + $ID = $xml->getAttributeNS(C::NS_SEC_UTIL, 'Id'); + } + return new static( array_pop($username), - $xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id') ? $xml->getAttributeNS(C::NS_SEC_UTIL, 'Id') : null, + $Id, self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/wsse/BinarySecurityToken.php b/src/XML/wsse/BinarySecurityToken.php index b100f9b8..0f99b32f 100644 --- a/src/XML/wsse/BinarySecurityToken.php +++ b/src/XML/wsse/BinarySecurityToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the BinarySecurityToken element diff --git a/src/XML/wsse/Embedded.php b/src/XML/wsse/Embedded.php index f3e439c0..8343a8f3 100644 --- a/src/XML/wsse/Embedded.php +++ b/src/XML/wsse/Embedded.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Embedded element diff --git a/src/XML/wsse/KeyIdentifier.php b/src/XML/wsse/KeyIdentifier.php index 47f443c7..c735bc9f 100644 --- a/src/XML/wsse/KeyIdentifier.php +++ b/src/XML/wsse/KeyIdentifier.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the KeyIdentifier element diff --git a/src/XML/wsse/Nonce.php b/src/XML/wsse/Nonce.php index c5139790..33d92d49 100644 --- a/src/XML/wsse/Nonce.php +++ b/src/XML/wsse/Nonce.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Nonce element diff --git a/src/XML/wsse/Password.php b/src/XML/wsse/Password.php index 3e2fd6e9..c6bf78f0 100644 --- a/src/XML/wsse/Password.php +++ b/src/XML/wsse/Password.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Password element diff --git a/src/XML/wsse/Reference.php b/src/XML/wsse/Reference.php index b5666db4..6379a043 100644 --- a/src/XML/wsse/Reference.php +++ b/src/XML/wsse/Reference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Reference element diff --git a/src/XML/wsse/Security.php b/src/XML/wsse/Security.php index 7cedb489..15323f30 100644 --- a/src/XML/wsse/Security.php +++ b/src/XML/wsse/Security.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Security element diff --git a/src/XML/wsse/SecurityTokenReference.php b/src/XML/wsse/SecurityTokenReference.php index c474eea1..6e4a63cb 100644 --- a/src/XML/wsse/SecurityTokenReference.php +++ b/src/XML/wsse/SecurityTokenReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SecurityTokenReference element diff --git a/src/XML/wsse/TransformationParameters.php b/src/XML/wsse/TransformationParameters.php index e5370751..b2a7e0f9 100644 --- a/src/XML/wsse/TransformationParameters.php +++ b/src/XML/wsse/TransformationParameters.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the TransformationParameters element diff --git a/src/XML/wsse/UsageTrait.php b/src/XML/wsse/UsageTrait.php index 0774bada..18c68724 100644 --- a/src/XML/wsse/UsageTrait.php +++ b/src/XML/wsse/UsageTrait.php @@ -4,33 +4,31 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * @package simplesamlphp/ws-security */ trait UsageTrait { - /** @var string|null */ + /** @var \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ protected ?string $usage; /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getUsage(): ?string + public function getUsage(): ?AnyURIValue { return $this->usage; } /** - * @param string $usage|null + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $usage|null */ - private function setUsage(?string $usage): void + private function setUsage(?AnyURIValue $usage): void { - Assert::nullOrValidURI($usage, SchemaViolationException::class); $this->usage = $usage; } } diff --git a/src/XML/wsse/UsernameToken.php b/src/XML/wsse/UsernameToken.php index f339d9e6..0a08449f 100644 --- a/src/XML/wsse/UsernameToken.php +++ b/src/XML/wsse/UsernameToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsse; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the UsernameToken element diff --git a/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php b/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php index f07a86db..1f0129ce 100644 --- a/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php +++ b/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php @@ -55,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $interfaceName = new InterfaceName(QNameValue('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr]); + $interfaceName = new InterfaceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsaw/ServiceNameTest.php b/tests/WSSecurity/XML/wsaw/ServiceNameTest.php index e8b5a2ef..84dbfa5d 100644 --- a/tests/WSSecurity/XML/wsaw/ServiceNameTest.php +++ b/tests/WSSecurity/XML/wsaw/ServiceNameTest.php @@ -55,7 +55,11 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $serviceName = new ServiceName(QNameValue('{urn:x-simplesamlphp:namespace}ssp:Chunk'), 'PHPUnit', [$attr]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + 'PHPUnit', + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), From da2e27881116966aa9daf0b56def5c6340b01c84 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 14 Nov 2025 01:10:35 +0100 Subject: [PATCH 13/34] Migrate wst_200502 to xsd-types --- composer.json | 2 +- .../wst_200502/AbstractAuthenticatorType.php | 7 +-- .../wst_200502/AbstractBinaryExchangeType.php | 52 ++++++++++--------- .../wst_200502/AbstractBinarySecretType.php | 29 +++++++---- .../wst_200502/AbstractCancelTargetType.php | 11 ++-- src/XML/wst_200502/AbstractClaimsType.php | 23 ++++---- .../AbstractComputedKeyOpenEnum.php | 17 +++--- src/XML/wst_200502/AbstractDelegateToType.php | 11 ++-- src/XML/wst_200502/AbstractEncryptionType.php | 11 ++-- src/XML/wst_200502/AbstractEntropyType.php | 7 +-- .../AbstractKeyExchangeTokenType.php | 7 +-- .../wst_200502/AbstractKeyTypeOpenEnum.php | 17 +++--- src/XML/wst_200502/AbstractLifetimeType.php | 6 +-- src/XML/wst_200502/AbstractOnBehalfOfType.php | 11 ++-- .../wst_200502/AbstractParticipantType.php | 11 ++-- .../wst_200502/AbstractParticipantsType.php | 9 ++-- .../AbstractProofEncryptionType.php | 11 ++-- .../wst_200502/AbstractRenewTargetType.php | 11 ++-- src/XML/wst_200502/AbstractRenewingType.php | 29 ++++++----- ...estSecurityTokenResponseCollectionType.php | 11 ++-- ...stractRequestSecurityTokenResponseType.php | 23 ++++---- .../AbstractRequestSecurityTokenType.php | 23 ++++---- .../AbstractRequestTypeOpenEnum.php | 17 +++--- .../AbstractRequestedProofTokenType.php | 11 ++-- .../AbstractRequestedReferenceType.php | 8 +-- .../AbstractRequestedSecurityTokenType.php | 11 ++-- .../wst_200502/AbstractSignChallengeType.php | 7 +-- .../wst_200502/AbstractStatusCodeOpenEnum.php | 17 +++--- src/XML/wst_200502/AbstractStatusType.php | 8 +-- src/XML/wst_200502/AbstractUseKeyType.php | 25 +++++---- src/XML/wst_200502/AllowPostdating.php | 8 +-- src/XML/wst_200502/AuthenticationType.php | 17 +++--- src/XML/wst_200502/Authenticator.php | 3 +- src/XML/wst_200502/BinaryExchange.php | 3 +- src/XML/wst_200502/BinarySecret.php | 3 +- src/XML/wst_200502/CancelTarget.php | 3 +- .../wst_200502/CanonicalizationAlgorithm.php | 17 +++--- src/XML/wst_200502/Challenge.php | 17 +++--- src/XML/wst_200502/Claims.php | 3 +- src/XML/wst_200502/CombinedHash.php | 17 +++--- src/XML/wst_200502/ComputedKey.php | 3 +- src/XML/wst_200502/ComputedKeyAlgorithm.php | 17 +++--- src/XML/wst_200502/Delegatable.php | 17 +++--- src/XML/wst_200502/DelegateTo.php | 3 +- src/XML/wst_200502/EncryptWith.php | 17 +++--- src/XML/wst_200502/Encryption.php | 3 +- src/XML/wst_200502/EncryptionAlgorithm.php | 17 +++--- src/XML/wst_200502/Entropy.php | 3 +- src/XML/wst_200502/Forwardable.php | 17 +++--- src/XML/wst_200502/IssuedTokens.php | 3 +- src/XML/wst_200502/Issuer.php | 4 +- src/XML/wst_200502/KeyExchangeToken.php | 3 +- src/XML/wst_200502/KeySize.php | 35 +++---------- src/XML/wst_200502/KeyType.php | 3 +- src/XML/wst_200502/Lifetime.php | 3 +- src/XML/wst_200502/OnBehalfOf.php | 3 +- src/XML/wst_200502/Participants.php | 3 +- src/XML/wst_200502/ProofEncryption.php | 3 +- src/XML/wst_200502/Reason.php | 14 ++--- src/XML/wst_200502/RenewTarget.php | 3 +- src/XML/wst_200502/Renewing.php | 3 +- src/XML/wst_200502/RequestKET.php | 8 +-- src/XML/wst_200502/RequestSecurityToken.php | 3 +- .../RequestSecurityTokenResponse.php | 3 +- ...RequestSecurityTokenResponseCollection.php | 3 +- src/XML/wst_200502/RequestType.php | 3 +- .../wst_200502/RequestedAttachedReference.php | 3 +- src/XML/wst_200502/RequestedProofToken.php | 3 +- src/XML/wst_200502/RequestedSecurityToken.php | 3 +- .../wst_200502/RequestedTokenCancelled.php | 8 +-- .../RequestedUnattachedReference.php | 3 +- src/XML/wst_200502/SignChallenge.php | 3 +- src/XML/wst_200502/SignChallengeResponse.php | 3 +- src/XML/wst_200502/SignWith.php | 17 +++--- src/XML/wst_200502/SignatureAlgorithm.php | 17 +++--- src/XML/wst_200502/Status.php | 3 +- src/XML/wst_200502/TokenType.php | 17 +++--- src/XML/wst_200502/UseKey.php | 3 +- 78 files changed, 416 insertions(+), 398 deletions(-) diff --git a/composer.json b/composer.json index d83bbebd..a06a8a0d 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "simplesamlphp/assert": "~1.9.1", "simplesamlphp/saml2": "dev-feature/xsd-types", - "simplesamlphp/xml-common": "~2.1.2", + "simplesamlphp/xml-common": "~2.2.0", "simplesamlphp/xml-security": "~2.0.5", "simplesamlphp/xml-soap": "~2.0.5" }, diff --git a/src/XML/wst_200502/AbstractAuthenticatorType.php b/src/XML/wst_200502/AbstractAuthenticatorType.php index cd716c9a..bb2c3668 100644 --- a/src/XML/wst_200502/AbstractAuthenticatorType.php +++ b/src/XML/wst_200502/AbstractAuthenticatorType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -21,6 +21,7 @@ abstract class AbstractAuthenticatorType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; @@ -66,7 +67,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractBinaryExchangeType.php b/src/XML/wst_200502/AbstractBinaryExchangeType.php index f4edb9ca..a386df36 100644 --- a/src/XML/wst_200502/AbstractBinaryExchangeType.php +++ b/src/XML/wst_200502/AbstractBinaryExchangeType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A BinaryExchangeType element @@ -20,27 +21,28 @@ abstract class AbstractBinaryExchangeType extends AbstractWstElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; + /** - * @param string $content - * @param string $valueType - * @param string $encodingType + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $valueType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $encodingType * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $content, - protected string $valueType, - protected string $encodingType, + StringValue $content, + protected AnyURIValue $valueType, + protected AnyURIValue $encodingType, array $namespacedAttributes, ) { - Assert::validURI($valueType, SchemaViolationException::class); - Assert::validURI($encodingType, SchemaViolationException::class); - $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } @@ -49,9 +51,9 @@ final public function __construct( /** * Get the valueType property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getValueType(): string + public function getValueType(): AnyURIValue { return $this->valueType; } @@ -60,9 +62,9 @@ public function getValueType(): string /** * Get the valueType property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getEncodingType(): string + public function getEncodingType(): AnyURIValue { return $this->encodingType; } @@ -74,7 +76,7 @@ public function getEncodingType(): string * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -83,9 +85,9 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - self::getAttribute($xml, 'ValueType'), - self::getAttribute($xml, 'EncodingType'), + StringValue::fromString($xml->textContent), + self::getAttribute($xml, 'ValueType', AnyURIValue::class), + self::getAttribute($xml, 'EncodingType', AnyURIValue::class), self::getAttributesNSFromXML($xml), ); } @@ -100,10 +102,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); - $e->setAttribute('ValueType', $this->getValueType()); - $e->setAttribute('EncodingType', $this->getEncodingType()); + $e->setAttribute('ValueType', $this->getValueType()->getValue()); + $e->setAttribute('EncodingType', $this->getEncodingType()->getValue()); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wst_200502/AbstractBinarySecretType.php b/src/XML/wst_200502/AbstractBinarySecretType.php index 7c4c2c13..1cc478b8 100644 --- a/src/XML/wst_200502/AbstractBinarySecretType.php +++ b/src/XML/wst_200502/AbstractBinarySecretType.php @@ -6,11 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Base64ElementTrait; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_map; use function explode; @@ -23,23 +25,28 @@ */ abstract class AbstractBinarySecretType extends AbstractWstElement { - use Base64ElementTrait; use ExtendableAttributesTrait; + use TypedTextContentTrait; + /** @var string|\SimpleSAML\XML\XsNamespace */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** @var string */ + public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + + /** @var string[]|null */ protected ?array $Type; /** - * @param string $content + * @param \SimpleSAML\XMLSchema\Type\Base64BinaryValue $content * @param (\SimpleSAML\WSSecurity\XML\wst_200502\BinarySecretTypeEnum|string)[]|null $Type * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $content, + Base64BinaryValue $content, ?array $Type = null, array $namespacedAttributes = [], ) { @@ -76,7 +83,7 @@ public function getType(): ?array * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -85,8 +92,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - explode(' ', self::getAttribute($xml, 'Type')), + Base64BinaryValue::fromString($xml->textContent), + explode(' ', self::getAttribute($xml, 'Type', StringValue::class)->getValue()), self::getAttributesNSFromXML($xml), ); } @@ -101,7 +108,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getType() !== null) { $e->setAttribute('Type', implode(' ', $this->getType())); diff --git a/src/XML/wst_200502/AbstractCancelTargetType.php b/src/XML/wst_200502/AbstractCancelTargetType.php index bf38a4e8..12cb873e 100644 --- a/src/XML/wst_200502/AbstractCancelTargetType.php +++ b/src/XML/wst_200502/AbstractCancelTargetType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -24,6 +24,7 @@ abstract class AbstractCancelTargetType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; @@ -46,7 +47,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractClaimsType.php b/src/XML/wst_200502/AbstractClaimsType.php index 8d2c1da8..169768ce 100644 --- a/src/XML/wst_200502/AbstractClaimsType.php +++ b/src/XML/wst_200502/AbstractClaimsType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ClaimsType element @@ -22,6 +22,7 @@ abstract class AbstractClaimsType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -32,26 +33,24 @@ abstract class AbstractClaimsType extends AbstractWstElement /** * AbstractClaimsType constructor * - * @param string|null $dialect + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $dialect * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $dialect = null, + protected ?AnyURIValue $dialect = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($dialect, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getDialect(): ?string + public function getDialect(): ?AnyURIValue { return $this->dialect; } @@ -76,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -85,7 +84,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Dialect', null), + self::getOptionalAttribute($xml, 'Dialect', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +102,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getDialect() !== null) { - $e->setAttribute('Dialect', $this->getDialect()); + $e->setAttribute('Dialect', $this->getDialect()->getValue()); } foreach ($this->getElements() as $child) { diff --git a/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php index 37ba2933..e042560c 100644 --- a/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,11 @@ */ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** @@ -39,7 +44,7 @@ function (ComputedKeyEnum|string $v): string { ); Assert::allValidURI($values, SchemaViolationException::class); - $this->setContent(implode(' ', $values)); + $this->setContent(StringValue::fromString(implode(' ', $values))); } @@ -49,7 +54,7 @@ function (ComputedKeyEnum|string $v): string { * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractDelegateToType.php b/src/XML/wst_200502/AbstractDelegateToType.php index ab8915a5..68fede06 100644 --- a/src/XML/wst_200502/AbstractDelegateToType.php +++ b/src/XML/wst_200502/AbstractDelegateToType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the DelegateToType element @@ -22,6 +22,7 @@ abstract class AbstractDelegateToType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -44,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractEncryptionType.php b/src/XML/wst_200502/AbstractEncryptionType.php index 1d45d29a..f2c37191 100644 --- a/src/XML/wst_200502/AbstractEncryptionType.php +++ b/src/XML/wst_200502/AbstractEncryptionType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the EncryptionType element @@ -22,6 +22,7 @@ abstract class AbstractEncryptionType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -44,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractEntropyType.php b/src/XML/wst_200502/AbstractEntropyType.php index 5c142cd0..f2d8f5e8 100644 --- a/src/XML/wst_200502/AbstractEntropyType.php +++ b/src/XML/wst_200502/AbstractEntropyType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the EntropyType element @@ -21,6 +21,7 @@ abstract class AbstractEntropyType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -61,7 +62,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractKeyExchangeTokenType.php b/src/XML/wst_200502/AbstractKeyExchangeTokenType.php index be125e6e..51088735 100644 --- a/src/XML/wst_200502/AbstractKeyExchangeTokenType.php +++ b/src/XML/wst_200502/AbstractKeyExchangeTokenType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the KeyExchangeTokenType element @@ -19,6 +19,7 @@ abstract class AbstractKeyExchangeTokenType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -52,7 +53,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php b/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php index 70092454..567bd22c 100644 --- a/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php +++ b/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,11 @@ */ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** @@ -39,7 +44,7 @@ function (KeyTypeEnum|string $v): string { ); Assert::allValidURI($values, SchemaViolationException::class); - $this->setContent(implode(' ', $values)); + $this->setContent(StringValue::fromString(implode(' ', $values))); } @@ -49,7 +54,7 @@ function (KeyTypeEnum|string $v): string { * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractLifetimeType.php b/src/XML/wst_200502/AbstractLifetimeType.php index b3184ba6..0bbfdf0b 100644 --- a/src/XML/wst_200502/AbstractLifetimeType.php +++ b/src/XML/wst_200502/AbstractLifetimeType.php @@ -8,8 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsu\Created; use SimpleSAML\WSSecurity\XML\wsu\Expires; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; /** * Class defining the LifetimeType element @@ -67,7 +67,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractOnBehalfOfType.php b/src/XML/wst_200502/AbstractOnBehalfOfType.php index 93aff7b5..82a6064d 100644 --- a/src/XML/wst_200502/AbstractOnBehalfOfType.php +++ b/src/XML/wst_200502/AbstractOnBehalfOfType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the OnBehalfOfType element @@ -22,6 +22,7 @@ abstract class AbstractOnBehalfOfType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -44,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractParticipantType.php b/src/XML/wst_200502/AbstractParticipantType.php index ecfe24e4..0c78fa9b 100644 --- a/src/XML/wst_200502/AbstractParticipantType.php +++ b/src/XML/wst_200502/AbstractParticipantType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ParticipantType element @@ -22,6 +22,7 @@ abstract class AbstractParticipantType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -44,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractParticipantsType.php b/src/XML/wst_200502/AbstractParticipantsType.php index ab9da0eb..149e715e 100644 --- a/src/XML/wst_200502/AbstractParticipantsType.php +++ b/src/XML/wst_200502/AbstractParticipantsType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ParticipantsType element @@ -20,6 +20,7 @@ abstract class AbstractParticipantsType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; @@ -77,7 +78,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractProofEncryptionType.php b/src/XML/wst_200502/AbstractProofEncryptionType.php index f5c87b4e..7e0223bd 100644 --- a/src/XML/wst_200502/AbstractProofEncryptionType.php +++ b/src/XML/wst_200502/AbstractProofEncryptionType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ProofEncryptionType element @@ -22,6 +22,7 @@ abstract class AbstractProofEncryptionType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -44,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractRenewTargetType.php b/src/XML/wst_200502/AbstractRenewTargetType.php index e7d9c42b..d25be8c3 100644 --- a/src/XML/wst_200502/AbstractRenewTargetType.php +++ b/src/XML/wst_200502/AbstractRenewTargetType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -24,6 +24,7 @@ abstract class AbstractRenewTargetType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; @@ -46,7 +47,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractRenewingType.php b/src/XML/wst_200502/AbstractRenewingType.php index ad238314..178cf199 100644 --- a/src/XML/wst_200502/AbstractRenewingType.php +++ b/src/XML/wst_200502/AbstractRenewingType.php @@ -6,7 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * Class defining the RenewingType element @@ -18,29 +19,29 @@ abstract class AbstractRenewingType extends AbstractWstElement /** * AbstractRenewingType constructor * - * @param bool|null $allow - * @param bool|null $ok + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $allow + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $ok */ final public function __construct( - protected ?bool $allow = null, - protected ?bool $ok = null, + protected ?BooleanValue $allow = null, + protected ?BooleanValue $ok = null, ) { } /** - * @return bool|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ - public function getAllow(): ?bool + public function getAllow(): ?BooleanValue { return $this->allow; } /** - * @return bool|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ - public function getOk(): ?bool + public function getOk(): ?BooleanValue { return $this->ok; } @@ -64,7 +65,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -73,8 +74,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalBooleanAttribute($xml, 'Allow', null), - self::getOptionalBooleanAttribute($xml, 'OK', null), + self::getOptionalAttribute($xml, 'Allow', BooleanValue::class, null), + self::getOptionalAttribute($xml, 'OK', BooleanValue::class, null), ); } @@ -90,11 +91,11 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getAllow() !== null) { - $e->setAttribute('Allow', $this->getAllow() ? 'true' : 'false'); + $e->setAttribute('Allow', $this->getAllow()->getValue()); } if ($this->getOk() !== null) { - $e->setAttribute('OK', $this->getOk() ? 'true' : 'false'); + $e->setAttribute('OK', $this->getOk()->getValue()); } return $e; diff --git a/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php index ebb3a7cd..701f8018 100644 --- a/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php +++ b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A RequestSecurityTokenResponseCollectionType element @@ -21,6 +21,7 @@ abstract class AbstractRequestSecurityTokenResponseCollectionType extends Abstra { use ExtendableAttributesTrait; + /** @var string|\SimpleSAML\XML\XsNamespace */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -61,7 +62,7 @@ public function getRequestSecurityTokenResponse(): array * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php index 9c1f5346..41683e9d 100644 --- a/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php +++ b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestSecurityTokenResponseType element @@ -22,6 +22,7 @@ abstract class AbstractRequestSecurityTokenResponseType extends AbstractWstEleme use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -32,26 +33,24 @@ abstract class AbstractRequestSecurityTokenResponseType extends AbstractWstEleme /** * AbstractRequestSecurityTokenResponseType constructor * - * @param string|null $context + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $context * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $context = null, + protected ?AnyURIValue $context = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($context, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getContext(): ?string + public function getContext(): ?AnyURIValue { return $this->context; } @@ -76,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -85,7 +84,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Context'), + self::getOptionalAttribute($xml, 'Context', AnyURIValue::class), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +102,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getContext() !== null) { - $e->setAttribute('Context', $this->getContext()); + $e->setAttribute('Context', $this->getContext()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wst_200502/AbstractRequestSecurityTokenType.php b/src/XML/wst_200502/AbstractRequestSecurityTokenType.php index 985ce419..d18deb2c 100644 --- a/src/XML/wst_200502/AbstractRequestSecurityTokenType.php +++ b/src/XML/wst_200502/AbstractRequestSecurityTokenType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestSecurityTokenType element @@ -24,6 +24,7 @@ abstract class AbstractRequestSecurityTokenType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -34,26 +35,24 @@ abstract class AbstractRequestSecurityTokenType extends AbstractWstElement /** * AbstractRequestSecurityTokenType constructor * - * @param string|null $context + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $context * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $context = null, + protected ?AnyURIValue $context = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($context, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getContext(): ?string + public function getContext(): ?AnyURIValue { return $this->context; } @@ -78,7 +77,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -87,7 +86,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Context'), + self::getOptionalAttribute($xml, 'Context', AnyURIValue::class), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -105,7 +104,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getContext() !== null) { - $e->setAttribute('Context', $this->getContext()); + $e->setAttribute('Context', $this->getContext()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php b/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php index a5c5611b..3ff914a7 100644 --- a/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php +++ b/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,11 @@ */ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** @@ -39,7 +44,7 @@ function (RequestTypeEnum|string $v): string { ); Assert::allValidURI($values, SchemaViolationException::class); - $this->setContent(implode(' ', $values)); + $this->setContent(StringValue::fromString(implode(' ', $values))); } @@ -49,7 +54,7 @@ function (RequestTypeEnum|string $v): string { * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractRequestedProofTokenType.php b/src/XML/wst_200502/AbstractRequestedProofTokenType.php index b9bde6b0..620d27a2 100644 --- a/src/XML/wst_200502/AbstractRequestedProofTokenType.php +++ b/src/XML/wst_200502/AbstractRequestedProofTokenType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestedProofTokenType element @@ -22,6 +22,7 @@ abstract class AbstractRequestedProofTokenType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -44,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractRequestedReferenceType.php b/src/XML/wst_200502/AbstractRequestedReferenceType.php index ed53bef3..a7dd145f 100644 --- a/src/XML/wst_200502/AbstractRequestedReferenceType.php +++ b/src/XML/wst_200502/AbstractRequestedReferenceType.php @@ -7,9 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsse\SecurityTokenReference; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use function array_pop; @@ -48,7 +48,7 @@ public function getSecurityTokenReference(): SecurityTokenReference * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php b/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php index 85254e02..20a65e23 100644 --- a/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php +++ b/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -24,6 +24,7 @@ abstract class AbstractRequestedSecurityTokenType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -46,7 +47,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractSignChallengeType.php b/src/XML/wst_200502/AbstractSignChallengeType.php index fa24fb44..4be05cf2 100644 --- a/src/XML/wst_200502/AbstractSignChallengeType.php +++ b/src/XML/wst_200502/AbstractSignChallengeType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -23,6 +23,7 @@ abstract class AbstractSignChallengeType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -80,7 +81,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php index d84e5c40..b3eeffd7 100644 --- a/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,11 @@ */ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** @@ -39,7 +44,7 @@ function (StatusCodeEnum|string $v): string { ); Assert::allValidURI($values, SchemaViolationException::class); - $this->setContent(implode(' ', $values)); + $this->setContent(StringValue::fromString(implode(' ', $values))); } @@ -49,7 +54,7 @@ function (StatusCodeEnum|string $v): string { * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractStatusType.php b/src/XML/wst_200502/AbstractStatusType.php index 734494e7..c9a10c2d 100644 --- a/src/XML/wst_200502/AbstractStatusType.php +++ b/src/XML/wst_200502/AbstractStatusType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; /** * Class defining the StatusType element @@ -54,7 +54,7 @@ public function getReason(): ?Reason * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AbstractUseKeyType.php b/src/XML/wst_200502/AbstractUseKeyType.php index 62828b49..35d62595 100644 --- a/src/XML/wst_200502/AbstractUseKeyType.php +++ b/src/XML/wst_200502/AbstractUseKeyType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the UseKeyType element @@ -22,6 +22,7 @@ abstract class AbstractUseKeyType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; @@ -30,14 +31,12 @@ abstract class AbstractUseKeyType extends AbstractWstElement * AbstractUseKeyType constructor * * @param \SimpleSAML\XML\SerializableElementInterface|null $child - * @param string|null $Sig + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Sig */ final public function __construct( ?SerializableElementInterface $child = null, - protected ?string $Sig = null, + protected ?AnyURIValue $Sig = null, ) { - Assert::nullOrValidURI($Sig, SchemaViolationException::class); - if ($child !== null) { $this->setElements([$child]); } @@ -45,9 +44,9 @@ final public function __construct( /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getSig(): ?string + public function getSig(): ?AnyURIValue { return $this->Sig; } @@ -71,7 +70,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -84,7 +83,7 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($children), - self::getOptionalAttribute($xml, 'Sig', null), + self::getOptionalAttribute($xml, 'Sig', AnyURIValue::class, null), ); } @@ -100,7 +99,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getSig() !== null) { - $e->setAttribute('Sig', $this->getSig()); + $e->setAttribute('Sig', $this->getSig()->getValue()); } foreach ($this->getElements() as $child) { diff --git a/src/XML/wst_200502/AllowPostdating.php b/src/XML/wst_200502/AllowPostdating.php index eff18e13..d9a967ce 100644 --- a/src/XML/wst_200502/AllowPostdating.php +++ b/src/XML/wst_200502/AllowPostdating.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * A AllowPostdating element @@ -18,13 +19,14 @@ final class AllowPostdating extends AbstractWstElement implements SchemaValidata { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/AuthenticationType.php b/src/XML/wst_200502/AuthenticationType.php index 891a41c7..ce06bed0 100644 --- a/src/XML/wst_200502/AuthenticationType.php +++ b/src/XML/wst_200502/AuthenticationType.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A AuthenticationType element @@ -15,14 +17,9 @@ final class AuthenticationType extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/Authenticator.php b/src/XML/wst_200502/Authenticator.php index b81c906d..3b1eea5f 100644 --- a/src/XML/wst_200502/Authenticator.php +++ b/src/XML/wst_200502/Authenticator.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Authenticator element diff --git a/src/XML/wst_200502/BinaryExchange.php b/src/XML/wst_200502/BinaryExchange.php index 5caa44e4..fb0b5c04 100644 --- a/src/XML/wst_200502/BinaryExchange.php +++ b/src/XML/wst_200502/BinaryExchange.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A BinaryExchange element diff --git a/src/XML/wst_200502/BinarySecret.php b/src/XML/wst_200502/BinarySecret.php index 59a85d34..6ba6fda2 100644 --- a/src/XML/wst_200502/BinarySecret.php +++ b/src/XML/wst_200502/BinarySecret.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A BinarySecret element diff --git a/src/XML/wst_200502/CancelTarget.php b/src/XML/wst_200502/CancelTarget.php index 083dc15e..ecfea63d 100644 --- a/src/XML/wst_200502/CancelTarget.php +++ b/src/XML/wst_200502/CancelTarget.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A CancelTarget element diff --git a/src/XML/wst_200502/CanonicalizationAlgorithm.php b/src/XML/wst_200502/CanonicalizationAlgorithm.php index ab008538..fa6bfd53 100644 --- a/src/XML/wst_200502/CanonicalizationAlgorithm.php +++ b/src/XML/wst_200502/CanonicalizationAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A CanonicalizationAlgorithm element @@ -15,14 +17,9 @@ final class CanonicalizationAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/Challenge.php b/src/XML/wst_200502/Challenge.php index 6ae5d17a..85b85904 100644 --- a/src/XML/wst_200502/Challenge.php +++ b/src/XML/wst_200502/Challenge.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * A Challenge element @@ -15,14 +17,9 @@ final class Challenge extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use StringElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/wst_200502/Claims.php b/src/XML/wst_200502/Claims.php index e7d8ac6e..27253387 100644 --- a/src/XML/wst_200502/Claims.php +++ b/src/XML/wst_200502/Claims.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Claims element diff --git a/src/XML/wst_200502/CombinedHash.php b/src/XML/wst_200502/CombinedHash.php index ca61d5e8..a68fdd20 100644 --- a/src/XML/wst_200502/CombinedHash.php +++ b/src/XML/wst_200502/CombinedHash.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\Base64ElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; /** * A CombinedHash element @@ -14,15 +16,10 @@ */ final class CombinedHash extends AbstractWstElement implements SchemaValidatableElementInterface { - use Base64ElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/wst_200502/ComputedKey.php b/src/XML/wst_200502/ComputedKey.php index dc8172e7..3c54c2e8 100644 --- a/src/XML/wst_200502/ComputedKey.php +++ b/src/XML/wst_200502/ComputedKey.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ComputedKey element diff --git a/src/XML/wst_200502/ComputedKeyAlgorithm.php b/src/XML/wst_200502/ComputedKeyAlgorithm.php index 70284c12..c2904f07 100644 --- a/src/XML/wst_200502/ComputedKeyAlgorithm.php +++ b/src/XML/wst_200502/ComputedKeyAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A ComputedKeyAlgorithm element @@ -15,14 +17,9 @@ final class ComputedKeyAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/Delegatable.php b/src/XML/wst_200502/Delegatable.php index c5fe8de5..6f836c71 100644 --- a/src/XML/wst_200502/Delegatable.php +++ b/src/XML/wst_200502/Delegatable.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\BooleanElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * A Delegatable element @@ -14,15 +16,10 @@ */ final class Delegatable extends AbstractWstElement implements SchemaValidatableElementInterface { - use BooleanElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = BooleanValue::class; } diff --git a/src/XML/wst_200502/DelegateTo.php b/src/XML/wst_200502/DelegateTo.php index 74527186..72d9e3de 100644 --- a/src/XML/wst_200502/DelegateTo.php +++ b/src/XML/wst_200502/DelegateTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A DelegateTo element diff --git a/src/XML/wst_200502/EncryptWith.php b/src/XML/wst_200502/EncryptWith.php index a4aeee17..5e841e3f 100644 --- a/src/XML/wst_200502/EncryptWith.php +++ b/src/XML/wst_200502/EncryptWith.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * An EncryptWith element @@ -15,14 +17,9 @@ final class EncryptWith extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/Encryption.php b/src/XML/wst_200502/Encryption.php index da4c1e08..a578d502 100644 --- a/src/XML/wst_200502/Encryption.php +++ b/src/XML/wst_200502/Encryption.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Encryption element diff --git a/src/XML/wst_200502/EncryptionAlgorithm.php b/src/XML/wst_200502/EncryptionAlgorithm.php index b4bc6f53..5bfee5f2 100644 --- a/src/XML/wst_200502/EncryptionAlgorithm.php +++ b/src/XML/wst_200502/EncryptionAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A EncryptionAlgorithm element @@ -15,14 +17,9 @@ final class EncryptionAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/Entropy.php b/src/XML/wst_200502/Entropy.php index 005e2001..770cadeb 100644 --- a/src/XML/wst_200502/Entropy.php +++ b/src/XML/wst_200502/Entropy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Entropy element diff --git a/src/XML/wst_200502/Forwardable.php b/src/XML/wst_200502/Forwardable.php index 03db3fda..a2a57c04 100644 --- a/src/XML/wst_200502/Forwardable.php +++ b/src/XML/wst_200502/Forwardable.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\BooleanElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * A Forwardable element @@ -14,15 +16,10 @@ */ final class Forwardable extends AbstractWstElement implements SchemaValidatableElementInterface { - use BooleanElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = BooleanValue::class; } diff --git a/src/XML/wst_200502/IssuedTokens.php b/src/XML/wst_200502/IssuedTokens.php index 0d067d8f..45058dea 100644 --- a/src/XML/wst_200502/IssuedTokens.php +++ b/src/XML/wst_200502/IssuedTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A IssuedTokens element diff --git a/src/XML/wst_200502/Issuer.php b/src/XML/wst_200502/Issuer.php index b9bcce98..f8e51fc9 100644 --- a/src/XML/wst_200502/Issuer.php +++ b/src/XML/wst_200502/Issuer.php @@ -6,7 +6,8 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200408\AbstractEndpointReferenceType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Issuer element @@ -17,6 +18,7 @@ final class Issuer extends AbstractEndpointReferenceType implements SchemaValida { use SchemaValidatableElementTrait; + /** @var string */ public const NS = C::NS_TRUST_200502; diff --git a/src/XML/wst_200502/KeyExchangeToken.php b/src/XML/wst_200502/KeyExchangeToken.php index f5660c18..ae67d47d 100644 --- a/src/XML/wst_200502/KeyExchangeToken.php +++ b/src/XML/wst_200502/KeyExchangeToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A KeyEchangeToken element diff --git a/src/XML/wst_200502/KeySize.php b/src/XML/wst_200502/KeySize.php index a249711a..7a4de79d 100644 --- a/src/XML/wst_200502/KeySize.php +++ b/src/XML/wst_200502/KeySize.php @@ -4,10 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\IntegerElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\UnsignedIntValue; /** * Class representing WS-trust KeySize. @@ -16,31 +16,10 @@ */ final class KeySize extends AbstractWstElement implements SchemaValidatableElementInterface { - use IntegerElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * KeySize constructor. - * - * @param string $value The long. - */ - final public function __construct(string $value) - { - $this->setContent($value); - } - - /** - * Validate the content of the element. - * - * @param string $content The value to go in the XML textContent - * @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure - * @return void - */ - protected function validateContent(string $content): void - { - $content = intval($content); - Assert::natural($content, SchemaViolationException::class); - Assert::range($content, 0, 4294967295, SchemaViolationException::class); - } + /** @var string */ + public const TEXTCONTENT_TYPE = UnsignedIntValue::class; } diff --git a/src/XML/wst_200502/KeyType.php b/src/XML/wst_200502/KeyType.php index a9ba6a8c..fc3da47d 100644 --- a/src/XML/wst_200502/KeyType.php +++ b/src/XML/wst_200502/KeyType.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A KeyType element diff --git a/src/XML/wst_200502/Lifetime.php b/src/XML/wst_200502/Lifetime.php index b6fcbeec..da7b79ce 100644 --- a/src/XML/wst_200502/Lifetime.php +++ b/src/XML/wst_200502/Lifetime.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Lifetime element diff --git a/src/XML/wst_200502/OnBehalfOf.php b/src/XML/wst_200502/OnBehalfOf.php index 2145ade1..7d11ea11 100644 --- a/src/XML/wst_200502/OnBehalfOf.php +++ b/src/XML/wst_200502/OnBehalfOf.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A OnBehalfOf element diff --git a/src/XML/wst_200502/Participants.php b/src/XML/wst_200502/Participants.php index 0b7207f6..9a07c02b 100644 --- a/src/XML/wst_200502/Participants.php +++ b/src/XML/wst_200502/Participants.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Participants element diff --git a/src/XML/wst_200502/ProofEncryption.php b/src/XML/wst_200502/ProofEncryption.php index 13835738..e320cd1e 100644 --- a/src/XML/wst_200502/ProofEncryption.php +++ b/src/XML/wst_200502/ProofEncryption.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ProofEncryption element diff --git a/src/XML/wst_200502/Reason.php b/src/XML/wst_200502/Reason.php index 091ab130..364964bc 100644 --- a/src/XML/wst_200502/Reason.php +++ b/src/XML/wst_200502/Reason.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * A Reason element @@ -13,14 +14,9 @@ */ final class Reason extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/wst_200502/RenewTarget.php b/src/XML/wst_200502/RenewTarget.php index 5bf16bb4..31b21ad9 100644 --- a/src/XML/wst_200502/RenewTarget.php +++ b/src/XML/wst_200502/RenewTarget.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RenewTarget element diff --git a/src/XML/wst_200502/Renewing.php b/src/XML/wst_200502/Renewing.php index 692591d5..120ddfd8 100644 --- a/src/XML/wst_200502/Renewing.php +++ b/src/XML/wst_200502/Renewing.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Renewing element diff --git a/src/XML/wst_200502/RequestKET.php b/src/XML/wst_200502/RequestKET.php index d5add1a0..124a88b8 100644 --- a/src/XML/wst_200502/RequestKET.php +++ b/src/XML/wst_200502/RequestKET.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * A RequestKET element @@ -18,13 +19,14 @@ final class RequestKET extends AbstractWstElement implements SchemaValidatableEl { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/RequestSecurityToken.php b/src/XML/wst_200502/RequestSecurityToken.php index 58a5bdf0..1f4737a0 100644 --- a/src/XML/wst_200502/RequestSecurityToken.php +++ b/src/XML/wst_200502/RequestSecurityToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityToken element diff --git a/src/XML/wst_200502/RequestSecurityTokenResponse.php b/src/XML/wst_200502/RequestSecurityTokenResponse.php index 1b60d0d3..da3bd8c9 100644 --- a/src/XML/wst_200502/RequestSecurityTokenResponse.php +++ b/src/XML/wst_200502/RequestSecurityTokenResponse.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityTokenResponse element diff --git a/src/XML/wst_200502/RequestSecurityTokenResponseCollection.php b/src/XML/wst_200502/RequestSecurityTokenResponseCollection.php index f53540a5..94a8905f 100644 --- a/src/XML/wst_200502/RequestSecurityTokenResponseCollection.php +++ b/src/XML/wst_200502/RequestSecurityTokenResponseCollection.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityTokenResponseCollection element diff --git a/src/XML/wst_200502/RequestType.php b/src/XML/wst_200502/RequestType.php index 35b0ffce..459b812a 100644 --- a/src/XML/wst_200502/RequestType.php +++ b/src/XML/wst_200502/RequestType.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestType element diff --git a/src/XML/wst_200502/RequestedAttachedReference.php b/src/XML/wst_200502/RequestedAttachedReference.php index fedbbb52..37fdfc79 100644 --- a/src/XML/wst_200502/RequestedAttachedReference.php +++ b/src/XML/wst_200502/RequestedAttachedReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedAttachedReference element diff --git a/src/XML/wst_200502/RequestedProofToken.php b/src/XML/wst_200502/RequestedProofToken.php index e120c9e2..cf3389a1 100644 --- a/src/XML/wst_200502/RequestedProofToken.php +++ b/src/XML/wst_200502/RequestedProofToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedProofToken element diff --git a/src/XML/wst_200502/RequestedSecurityToken.php b/src/XML/wst_200502/RequestedSecurityToken.php index 256974bd..a250fe4e 100644 --- a/src/XML/wst_200502/RequestedSecurityToken.php +++ b/src/XML/wst_200502/RequestedSecurityToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedSecurityToken element diff --git a/src/XML/wst_200502/RequestedTokenCancelled.php b/src/XML/wst_200502/RequestedTokenCancelled.php index 356b359c..ad813d45 100644 --- a/src/XML/wst_200502/RequestedTokenCancelled.php +++ b/src/XML/wst_200502/RequestedTokenCancelled.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * A RequestedTokenCancelled element @@ -18,13 +19,14 @@ final class RequestedTokenCancelled extends AbstractWstElement implements Schema { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200502/RequestedUnattachedReference.php b/src/XML/wst_200502/RequestedUnattachedReference.php index e0cc2395..87a4f516 100644 --- a/src/XML/wst_200502/RequestedUnattachedReference.php +++ b/src/XML/wst_200502/RequestedUnattachedReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedUnattachedReference element diff --git a/src/XML/wst_200502/SignChallenge.php b/src/XML/wst_200502/SignChallenge.php index 8845336f..a30f2390 100644 --- a/src/XML/wst_200502/SignChallenge.php +++ b/src/XML/wst_200502/SignChallenge.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignChallenge element diff --git a/src/XML/wst_200502/SignChallengeResponse.php b/src/XML/wst_200502/SignChallengeResponse.php index 33325890..482e49ba 100644 --- a/src/XML/wst_200502/SignChallengeResponse.php +++ b/src/XML/wst_200502/SignChallengeResponse.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignChallengeResponse element diff --git a/src/XML/wst_200502/SignWith.php b/src/XML/wst_200502/SignWith.php index 22a167a2..5d2961de 100644 --- a/src/XML/wst_200502/SignWith.php +++ b/src/XML/wst_200502/SignWith.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A SignWith element @@ -15,14 +17,9 @@ final class SignWith extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/SignatureAlgorithm.php b/src/XML/wst_200502/SignatureAlgorithm.php index c3da4b8f..d0f67f16 100644 --- a/src/XML/wst_200502/SignatureAlgorithm.php +++ b/src/XML/wst_200502/SignatureAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A SignatureAlgorithm element @@ -15,14 +17,9 @@ final class SignatureAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/Status.php b/src/XML/wst_200502/Status.php index d44a292a..5f56745a 100644 --- a/src/XML/wst_200502/Status.php +++ b/src/XML/wst_200502/Status.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Status element diff --git a/src/XML/wst_200502/TokenType.php b/src/XML/wst_200502/TokenType.php index 1abc8890..2fe3eccf 100644 --- a/src/XML/wst_200502/TokenType.php +++ b/src/XML/wst_200502/TokenType.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A TokenType element @@ -15,14 +17,9 @@ final class TokenType extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/UseKey.php b/src/XML/wst_200502/UseKey.php index 06f68e37..fe91df61 100644 --- a/src/XML/wst_200502/UseKey.php +++ b/src/XML/wst_200502/UseKey.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A UseKey element From 3fd7bc7b4bc960e2ce7afdb894dd68075d098f37 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 20 Nov 2025 17:17:56 +0100 Subject: [PATCH 14/34] Add option-flag to XPath utility --- {src/XML => classes}/element.registry.php | 0 composer.json | 10 ++--- src/Utils/XPath.php | 5 ++- src/XML/sp_200507/XPath.php | 18 +++----- .../wst_200512/AbstractBinaryExchangeType.php | 45 ++++++++++--------- .../wst_200512/AbstractBinarySecretType.php | 18 +++++--- .../AbstractComputedKeyOpenEnum.php | 8 +++- .../wst_200512/AbstractStatusCodeOpenEnum.php | 8 +++- src/XML/wst_200512/AuthenticationType.php | 18 +++----- .../wst_200512/CanonicalizationAlgorithm.php | 17 +++---- src/XML/wst_200512/Challenge.php | 18 +++----- src/XML/wst_200512/CombinedHash.php | 17 +++---- src/XML/wst_200512/ComputedKeyAlgorithm.php | 18 +++----- tests/bootstrap.php | 2 +- 14 files changed, 97 insertions(+), 105 deletions(-) rename {src/XML => classes}/element.registry.php (100%) diff --git a/src/XML/element.registry.php b/classes/element.registry.php similarity index 100% rename from src/XML/element.registry.php rename to classes/element.registry.php diff --git a/composer.json b/composer.json index a06a8a0d..03fe1915 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,14 @@ "ext-dom": "*", "ext-spl": "*", - "simplesamlphp/assert": "~1.9.1", + "simplesamlphp/assert": "~1.9", "simplesamlphp/saml2": "dev-feature/xsd-types", - "simplesamlphp/xml-common": "~2.2.0", - "simplesamlphp/xml-security": "~2.0.5", - "simplesamlphp/xml-soap": "~2.0.5" + "simplesamlphp/xml-common": "~2.3", + "simplesamlphp/xml-security": "~2.0", + "simplesamlphp/xml-soap": "~2.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.10.3" + "simplesamlphp/simplesamlphp-test-framework": "~1.10" }, "autoload": { "psr-4": { diff --git a/src/Utils/XPath.php b/src/Utils/XPath.php index b8597854..15304bb9 100644 --- a/src/Utils/XPath.php +++ b/src/Utils/XPath.php @@ -19,13 +19,14 @@ class XPath extends \SimpleSAML\XMLSecurity\Utils\XPath * Get a DOMXPath object that can be used to search for WS Security elements. * * @param \DOMNode $node The document to associate to the DOMXPath object. + * @param bool $autoregister Whether to auto-register all namespaces used in the document * * @return \DOMXPath A DOMXPath object ready to use in the given document, with several * ws-related namespaces already registered. */ - public static function getXPath(DOMNode $node): DOMXPath + public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath { - $xp = parent::getXPath($node); + $xp = parent::getXPath($node, $autoregister); $xp->registerNamespace('wsa', C::NS_ADDR_200508); $xp->registerNamespace('wsa', C::NS_ADDR_200408); diff --git a/src/XML/sp_200507/XPath.php b/src/XML/sp_200507/XPath.php index 0d5e56c0..86347d2b 100644 --- a/src/XML/sp_200507/XPath.php +++ b/src/XML/sp_200507/XPath.php @@ -8,7 +8,8 @@ use DOMXPath; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * An XPath element @@ -17,19 +18,10 @@ */ final class XPath extends AbstractSpElement { - use StringElementTrait; + use TypedTextContentTrait; - - /** - * Initialize an XPath. - * - * @param string $content - */ - public function __construct( - string $content, - ) { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** diff --git a/src/XML/wst_200512/AbstractBinaryExchangeType.php b/src/XML/wst_200512/AbstractBinaryExchangeType.php index e9099de1..f14ec3d0 100644 --- a/src/XML/wst_200512/AbstractBinaryExchangeType.php +++ b/src/XML/wst_200512/AbstractBinaryExchangeType.php @@ -9,8 +9,10 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * A BinaryExchangeType element @@ -20,27 +22,28 @@ abstract class AbstractBinaryExchangeType extends AbstractWstElement { use ExtendableAttributesTrait; - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** - * @param string $content - * @param string $valueType - * @param string $encodingType + * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $valueType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $encodingType * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $content, - protected string $valueType, - protected string $encodingType, + StringValue $content, + protected AnyURIValue $valueType, + protected AnyURIValue $encodingType, array $namespacedAttributes, ) { - Assert::validURI($valueType, SchemaViolationException::class); - Assert::validURI($encodingType, SchemaViolationException::class); - $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } @@ -49,9 +52,9 @@ final public function __construct( /** * Get the valueType property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getValueType(): string + public function getValueType(): AnyURIValue { return $this->valueType; } @@ -60,9 +63,9 @@ public function getValueType(): string /** * Get the valueType property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getEncodingType(): string + public function getEncodingType(): AnyURIValue { return $this->encodingType; } @@ -83,9 +86,9 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - self::getAttribute($xml, 'ValueType'), - self::getAttribute($xml, 'EncodingType'), + StringValue::fromString($xml->textContent), + self::getAttribute($xml, 'ValueType', AnyURIValue::class), + self::getAttribute($xml, 'EncodingType', AnyURIValue::class), self::getAttributesNSFromXML($xml), ); } @@ -100,10 +103,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); - $e->setAttribute('ValueType', $this->getValueType()); - $e->setAttribute('EncodingType', $this->getEncodingType()); + $e->setAttribute('ValueType', $this->getValueType()->getValue()); + $e->setAttribute('EncodingType', $this->getEncodingType()->getValue()); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wst_200512/AbstractBinarySecretType.php b/src/XML/wst_200512/AbstractBinarySecretType.php index f12f5705..dfcfe6aa 100644 --- a/src/XML/wst_200512/AbstractBinarySecretType.php +++ b/src/XML/wst_200512/AbstractBinarySecretType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Base64ElementTrait; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Base64BinaryValue; use function array_map; use function explode; @@ -23,23 +24,28 @@ */ abstract class AbstractBinarySecretType extends AbstractWstElement { - use Base64ElementTrait; use ExtendableAttributesTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = Base64BinaryValue::class; /** @var string|\SimpleSAML\XML\XsNamespace */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + /** @var string[]|null */ protected ?array $Type; /** - * @param string $content + * @param \SimpleSAML\XMLSchema\Type\Base64BinaryValue $content * @param (\SimpleSAML\WSSecurity\XML\wst_200512\BinarySecretTypeEnum|string)[]|null $Type * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - string $content, + Base64BinaryValue $content, ?array $Type = null, array $namespacedAttributes = [], ) { @@ -85,7 +91,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, + Base64BinaryValue::fromString($xml->textContent), explode(' ', self::getAttribute($xml, 'Type')), self::getAttributesNSFromXML($xml), ); @@ -101,7 +107,7 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); if ($this->getType() !== null) { $e->setAttribute('Type', implode(' ', $this->getType())); diff --git a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php index ae1a9264..67d0c3a2 100644 --- a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,10 @@ */ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** diff --git a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php index 1c8fad8a..c2f1a83b 100644 --- a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,10 @@ */ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** diff --git a/src/XML/wst_200512/AuthenticationType.php b/src/XML/wst_200512/AuthenticationType.php index d362f2e7..c8b5e075 100644 --- a/src/XML/wst_200512/AuthenticationType.php +++ b/src/XML/wst_200512/AuthenticationType.php @@ -4,9 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; - +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A AuthenticationType element * @@ -15,14 +16,9 @@ final class AuthenticationType extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/CanonicalizationAlgorithm.php b/src/XML/wst_200512/CanonicalizationAlgorithm.php index 5149c359..4496986b 100644 --- a/src/XML/wst_200512/CanonicalizationAlgorithm.php +++ b/src/XML/wst_200512/CanonicalizationAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A CanonicalizationAlgorithm element @@ -15,14 +17,9 @@ final class CanonicalizationAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/Challenge.php b/src/XML/wst_200512/Challenge.php index 06682a4e..0558e150 100644 --- a/src/XML/wst_200512/Challenge.php +++ b/src/XML/wst_200512/Challenge.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * A Challenge element @@ -15,14 +17,8 @@ final class Challenge extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use StringElementTrait; + use TypedTextContentTrait; - - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/wst_200512/CombinedHash.php b/src/XML/wst_200512/CombinedHash.php index 3e8f7617..a2fcd2e8 100644 --- a/src/XML/wst_200512/CombinedHash.php +++ b/src/XML/wst_200512/CombinedHash.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\Base64ElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; /** * A CombinedHash element @@ -14,15 +16,10 @@ */ final class CombinedHash extends AbstractWstElement implements SchemaValidatableElementInterface { - use Base64ElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/wst_200512/ComputedKeyAlgorithm.php b/src/XML/wst_200512/ComputedKeyAlgorithm.php index 492ce6a4..7135e79f 100644 --- a/src/XML/wst_200512/ComputedKeyAlgorithm.php +++ b/src/XML/wst_200512/ComputedKeyAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A ComputedKeyAlgorithm element @@ -15,14 +17,8 @@ final class ComputedKeyAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c66a4c65..8333a485 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -6,4 +6,4 @@ require_once($projectRoot . '/vendor/autoload.php'); $registry = \SimpleSAML\XML\Registry\ElementRegistry::getInstance(); -$registry->importFromFile(dirname(__FILE__, 2) . '/src/XML/element.registry.php'); +$registry->importFromFile(dirname(__FILE__, 2) . '/classes/element.registry.php'); From b997e242a8e386633014ac6c346c6a66da0cb9c3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 25 Nov 2025 00:14:47 +0100 Subject: [PATCH 15/34] Migrate to xsd-types --- src/Constants.php | 14 +++++++ .../wst_200512/AbstractKeyTypeOpenEnum.php | 11 +++-- .../AbstractRequestTypeOpenEnum.php | 11 +++-- src/XML/wst_200512/Delegatable.php | 16 +++----- src/XML/wst_200512/EncryptWith.php | 17 ++++---- src/XML/wst_200512/EncryptionAlgorithm.php | 17 ++++---- src/XML/wst_200512/Forwardable.php | 17 ++++---- src/XML/wst_200512/KeySize.php | 34 ++++------------ src/XML/wst_200512/KeyWrapAlgorithm.php | 17 ++++---- src/XML/wst_200512/Reason.php | 14 +++---- src/XML/wst_200512/SignWith.php | 17 ++++---- src/XML/wst_200512/SignatureAlgorithm.php | 17 ++++---- src/XML/wst_200512/TokenType.php | 17 ++++---- src/XML/wsx/Dialect.php | 17 ++++---- src/XML/wsx/Identifier.php | 17 ++++---- src/XML/wsx/Location.php | 17 ++++---- tests/WSSecurity/XML/ElementRegistryTest.php | 2 +- .../XML/auth/AdditionalContextTest.php | 25 +++++++----- tests/WSSecurity/XML/auth/ClaimTypeTest.php | 29 ++++++++------ .../XML/auth/ConstrainedManyValueTest.php | 20 +++++----- .../XML/auth/ConstrainedSingleValueTest.php | 30 +++++++------- .../XML/auth/ConstrainedValueTest.php | 31 +++++++------- tests/WSSecurity/XML/auth/ContextItemTest.php | 19 ++++----- tests/WSSecurity/XML/auth/DescriptionTest.php | 10 +++-- tests/WSSecurity/XML/auth/DisplayNameTest.php | 10 +++-- .../WSSecurity/XML/auth/DisplayValueTest.php | 10 +++-- .../XML/auth/EncryptedValueTest.php | 18 +++++++-- .../XML/auth/StructuredValueTest.php | 11 +++-- .../XML/auth/ValueGreaterThanOrEqualTest.php | 17 ++++---- .../XML/auth/ValueGreaterThanTest.php | 17 ++++---- .../WSSecurity/XML/auth/ValueInRangenTest.php | 23 ++++++----- .../XML/auth/ValueLessThanOrEqualTest.php | 18 +++++---- .../WSSecurity/XML/auth/ValueLessThanTest.php | 17 ++++---- .../XML/auth/ValueLowerBoundTest.php | 13 +++--- .../ValueOneOfWithStructuredValuesTest.php | 17 ++++---- .../XML/auth/ValueOneOfWithValuesTest.php | 13 +++--- tests/WSSecurity/XML/auth/ValueTest.php | 6 ++- .../XML/auth/ValueUpperBoundTest.php | 17 ++++---- .../fed/AdditionalContextProcessedTest.php | 1 + .../fed/ApplicationServiceEndpointTest.php | 1 + .../XML/fed/AttributeServiceEndpointTest.php | 1 + .../XML/fed/AttributeServiceEndpointsTest.php | 1 + .../XML/fed/AuthenticationTokenTest.php | 1 + .../XML/fed/FilterPseudonymsTest.php | 1 + tests/WSSecurity/XML/fed/FreshnessTest.php | 1 + .../XML/fed/IssuesSpecificPolicyFaultTest.php | 1 + .../XML/fed/PassiveRequestorEndpointTest.php | 1 + .../XML/fed/PassiveRequestorEndpointsTest.php | 1 + tests/WSSecurity/XML/fed/ProofTokenTest.php | 1 - .../XML/fed/PseudonymServiceEndpointTest.php | 1 + .../XML/fed/PseudonymServiceEndpointsTest.php | 1 + tests/WSSecurity/XML/fed/PseudonymTest.php | 1 + .../XML/fed/ReferenceDigestTest.php | 10 +++-- tests/WSSecurity/XML/fed/ReferenceEPRTest.php | 22 +++++----- .../XML/fed/ReferenceToken11Test.php | 15 +++++-- .../WSSecurity/XML/fed/ReferenceTokenTest.php | 40 ++++++++++--------- .../WSSecurity/XML/fed/ReferenceTypeTest.php | 19 ++++----- .../XML/fed/RequestProofTokenTest.php | 1 + .../XML/fed/RequestPseudonymTest.php | 17 +++++--- .../XML/fed/RequireBearerTokensTest.php | 1 + .../XML/fed/RequireSharedCookiesTest.php | 1 + .../XML/fed/RequireSignedTokensTest.php | 1 + .../fed/RequiresGenericClaimDialectTest.php | 1 + .../fed/SecurityTokenServiceEndpointTest.php | 1 + tests/WSSecurity/XML/fed/SignOutBasisTest.php | 1 + tests/WSSecurity/XML/fed/SignOutTest.php | 1 + .../SingleSignOutNotificationEndpointTest.php | 1 + ...SingleSignOutNotificationEndpointsTest.php | 1 + .../SingleSignOutSubscriptionEndpointTest.php | 1 + ...SingleSignOutSubscriptionEndpointsTest.php | 1 + tests/WSSecurity/XML/fed/TargetScopesTest.php | 1 + tests/WSSecurity/XML/fed/WebBindingTest.php | 1 + .../XML/sp_200507/AsymmetricBindingTest.php | 1 + .../XML/sp_200507/IssuedTokenTest.php | 1 + tests/WSSecurity/XML/sp_200507/IssuerTest.php | 1 + .../sp_200507/SecureConversationTokenTest.php | 1 + .../XML/sp_200507/SpnegoContextTokenTest.php | 1 + .../XML/sp_200702/AlgorithmSuiteTest.php | 1 + .../XML/sp_200702/AsymmetricBindingTest.php | 2 + .../XML/sp_200702/BootstrapPolicyTest.php | 1 + .../EncryptedSupportingTokensTest.php | 1 + .../XML/sp_200702/EncryptionTokenTest.php | 1 + ...EndorsingEncryptedSupportingTokensTest.php | 1 + .../EndorsingSupportingTokensTest.php | 1 + .../InitiatorEncryptionTokenTest.php | 1 + .../sp_200702/InitiatorSignatureTokenTest.php | 1 + .../XML/sp_200702/InitiatorTokenTest.php | 1 + tests/WSSecurity/XML/sp_200702/IssuerTest.php | 1 + tests/WSSecurity/XML/sp_200702/LayoutTest.php | 1 + .../XML/sp_200702/ProtectionTokenTest.php | 1 + .../RecipientEncryptionTokenTest.php | 1 + .../sp_200702/RecipientSignatureTokenTest.php | 1 + .../XML/sp_200702/RecipientTokenTest.php | 1 + .../XML/sp_200702/SignatureTokenTest.php | 1 + .../SignedEncryptedSupportingTokensTest.php | 1 + ...EndorsingEncryptedSupportingTokensTest.php | 1 + .../SignedEndorsingSupportingTokensTest.php | 1 + .../sp_200702/SignedSupportingTokensTest.php | 1 + .../XML/sp_200702/SupportingTokensTest.php | 1 + .../XML/sp_200702/SymmetricBindingTest.php | 1 + .../XML/sp_200702/TransportBindingTest.php | 1 + .../XML/sp_200702/TransportTokenTest.php | 1 + .../WSSecurity/XML/sp_200702/Trust13Test.php | 1 + tests/WSSecurity/XML/sp_200702/Wss10Test.php | 1 + tests/WSSecurity/XML/sp_200702/Wss11Test.php | 1 + .../XML/wsa_200408/EndpointReferenceTest.php | 1 + .../WSSecurity/XML/wsa_200408/FaultToTest.php | 1 + tests/WSSecurity/XML/wsa_200408/FromTest.php | 1 + .../wsa_200408/ReferenceParametersTest.php | 1 + .../wsa_200408/ReferencePropertiesTest.php | 1 + .../WSSecurity/XML/wsa_200408/ReplyToTest.php | 1 + .../XML/wsa_200508/EndpointReferenceTest.php | 1 + .../XML/wsa_200508/MessageIDTest.php | 1 - .../XML/wsa_200508/MetadataTest.php | 1 + .../wsa_200508/ReferenceParametersTest.php | 1 + .../XML/wsa_200508/RelatesToTest.php | 1 + .../WSSecurity/XML/wst_200502/IssuerTest.php | 1 + .../WSSecurity/XML/wst_200512/IssuerTest.php | 1 + .../XML/wsx/MetadataReferenceTest.php | 1 + 119 files changed, 476 insertions(+), 366 deletions(-) diff --git a/src/Constants.php b/src/Constants.php index f52b9f69..1be4a3c7 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -16,6 +16,7 @@ class Constants extends \SimpleSAML\SAML2\Constants * The namespace for WS-Addressing protocol. */ public const NS_ADDR_200408 = 'http://schemas.xmlsoap.org/ws/2004/08/addressing'; + public const NS_ADDR_200508 = 'http://www.w3.org/2005/08/addressing'; /** @@ -37,6 +38,7 @@ class Constants extends \SimpleSAML\SAML2\Constants * The namespace for WS-Trust protocol. */ public const NS_TRUST_200502 = 'http://schemas.xmlsoap.org/ws/2005/02/trust'; + public const NS_TRUST_200512 = 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/'; /** @@ -48,6 +50,7 @@ class Constants extends \SimpleSAML\SAML2\Constants * The namespace for the Web Service Security Policy protocol. */ public const NS_SEC_POLICY_11 = 'http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'; + public const NS_SEC_POLICY_12 = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'; /** @@ -79,15 +82,25 @@ class Constants extends \SimpleSAML\SAML2\Constants * The schema-defined wsa fault codes */ public const WSA_FAULT_INVALID_ADDRESSING_HEADER = 'InvalidAddressingHeader'; + public const WSA_FAULT_INVALID_ADDRESS = 'InvalidAddress'; + public const WSA_FAULT_INVALID_EPR = 'InvalidEPR'; + public const WSA_FAULT_INVALID_CARDINALITY = 'InvalidCardinality'; + public const WSA_FAULT_MISSING_ADDRESS_IN_EPR = 'MissingAddressInEPR'; + public const WSA_FAULT_DUPLICATE_MESSAGEID = 'DupicateMessageID'; + public const WSA_FAULT_ACTION_MISMATCH = 'ActionMismatch'; + public const WSA_FAULT_MESSAGE_ADDRESSING_HEADER_REQUIRED = 'MessageAddressingHeaderRequired'; + public const WSA_FAULT_DESTINATION_UNREACHABLE = 'DestinationUnreachable'; + public const WSA_FAULT_ACTION_NOT_SUPPORTED = 'ActionNotSupported'; + public const WSA_FAULT_ENDPOINT_UNAVAILABLE = 'EndpointUnavailable'; public const FAULT_CODES = [ @@ -107,6 +120,7 @@ class Constants extends \SimpleSAML\SAML2\Constants /** */ public const WST_REFID_PIN = 'http://docs.oasis-open.org/ws-sx/ws-trust/200802/challenge/PIN'; + public const WST_REFID_OTP = 'http://docs.oasis-open.org/ws-sx/ws-trust/200802/challenge/OTP'; /** diff --git a/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php b/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php index 508d5f9a..19785024 100644 --- a/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php +++ b/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,11 @@ */ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** @@ -39,7 +44,7 @@ function (KeyTypeEnum|string $v): string { ); Assert::allValidURI($values, SchemaViolationException::class); - $this->setContent(implode(' ', $values)); + $this->setContent(StringValue::fromString(implode(' ', $values))); } diff --git a/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php b/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php index 2da55a86..8166287b 100644 --- a/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php +++ b/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php @@ -8,7 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function array_map; use function explode; @@ -23,7 +24,11 @@ */ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; + + + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; /** @@ -39,7 +44,7 @@ function (RequestTypeEnum|string $v): string { ); Assert::allValidURI($values, SchemaViolationException::class); - $this->setContent(implode(' ', $values)); + $this->setContent(StringValue::fromString(implode(' ', $values))); } diff --git a/src/XML/wst_200512/Delegatable.php b/src/XML/wst_200512/Delegatable.php index 789f0f1b..6d1ecaa5 100644 --- a/src/XML/wst_200512/Delegatable.php +++ b/src/XML/wst_200512/Delegatable.php @@ -4,8 +4,9 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\BooleanElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Delegatable element @@ -14,15 +15,10 @@ */ final class Delegatable extends AbstractWstElement implements SchemaValidatableElementInterface { - use BooleanElementTrait; + use TypedTextContentTrait; use SchemaValidatableElementTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = BooleanValue::class; } diff --git a/src/XML/wst_200512/EncryptWith.php b/src/XML/wst_200512/EncryptWith.php index 089d463c..d6efb1ce 100644 --- a/src/XML/wst_200512/EncryptWith.php +++ b/src/XML/wst_200512/EncryptWith.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * An EncryptWith element @@ -15,14 +17,9 @@ final class EncryptWith extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/EncryptionAlgorithm.php b/src/XML/wst_200512/EncryptionAlgorithm.php index f5cc646a..5403cb5e 100644 --- a/src/XML/wst_200512/EncryptionAlgorithm.php +++ b/src/XML/wst_200512/EncryptionAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A EncryptionAlgorithm element @@ -15,14 +17,9 @@ final class EncryptionAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/Forwardable.php b/src/XML/wst_200512/Forwardable.php index 30fa2e63..c4097fdd 100644 --- a/src/XML/wst_200512/Forwardable.php +++ b/src/XML/wst_200512/Forwardable.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\BooleanElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue /** * A Forwardable element @@ -14,15 +16,10 @@ */ final class Forwardable extends AbstractWstElement implements SchemaValidatableElementInterface { - use BooleanElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = BooleanValue::class; } diff --git a/src/XML/wst_200512/KeySize.php b/src/XML/wst_200512/KeySize.php index d2b4a7ad..3512c409 100644 --- a/src/XML/wst_200512/KeySize.php +++ b/src/XML/wst_200512/KeySize.php @@ -6,8 +6,10 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\IntegerElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\UnsignedIntValue; /** * Class representing WS-trust KeySize. @@ -16,32 +18,10 @@ */ final class KeySize extends AbstractWstElement implements SchemaValidatableElementInterface { - use IntegerElementTrait; use SchemaValidatableElementTrait; + use TypedTextContentTrait; - /** - * KeySize constructor. - * - * @param string $value The long. - */ - final public function __construct(string $value) - { - $this->setContent($value); - } - - - /** - * Validate the content of the element. - * - * @param string $content The value to go in the XML textContent - * @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure - * @return void - */ - protected function validateContent(string $content): void - { - $content = intval($content); - Assert::natural($content, SchemaViolationException::class); - Assert::range($content, 0, 4294967295, SchemaViolationException::class); - } + /** @var string */ + public const TEXTCONTENT_TYPE = UnsignedIntValue::class; } diff --git a/src/XML/wst_200512/KeyWrapAlgorithm.php b/src/XML/wst_200512/KeyWrapAlgorithm.php index 22d3bb02..f63e8c76 100644 --- a/src/XML/wst_200512/KeyWrapAlgorithm.php +++ b/src/XML/wst_200512/KeyWrapAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A KeyWrapAlgorithm element @@ -15,14 +17,9 @@ final class KeyWrapAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/Reason.php b/src/XML/wst_200512/Reason.php index 12922185..28c07273 100644 --- a/src/XML/wst_200512/Reason.php +++ b/src/XML/wst_200512/Reason.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\StringElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\StringValue; /** * A Reason element @@ -13,14 +14,9 @@ */ final class Reason extends AbstractWstElement { - use StringElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/wst_200512/SignWith.php b/src/XML/wst_200512/SignWith.php index 77a71614..09ecb76e 100644 --- a/src/XML/wst_200512/SignWith.php +++ b/src/XML/wst_200512/SignWith.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A SignWith element @@ -15,14 +17,9 @@ final class SignWith extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/SignatureAlgorithm.php b/src/XML/wst_200512/SignatureAlgorithm.php index 647476c6..4dd3dad6 100644 --- a/src/XML/wst_200512/SignatureAlgorithm.php +++ b/src/XML/wst_200512/SignatureAlgorithm.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A SignatureAlgorithm element @@ -15,14 +17,9 @@ final class SignatureAlgorithm extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/TokenType.php b/src/XML/wst_200512/TokenType.php index 0ed5b5cc..221fb914 100644 --- a/src/XML/wst_200512/TokenType.php +++ b/src/XML/wst_200512/TokenType.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A TokenType element @@ -15,14 +17,9 @@ final class TokenType extends AbstractWstElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wsx/Dialect.php b/src/XML/wsx/Dialect.php index 28d06bbe..f200b01d 100644 --- a/src/XML/wsx/Dialect.php +++ b/src/XML/wsx/Dialect.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wsx; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * An Dialect element @@ -15,14 +17,9 @@ final class Dialect extends AbstractWsxElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wsx/Identifier.php b/src/XML/wsx/Identifier.php index 3fd38c93..f54dfaa6 100644 --- a/src/XML/wsx/Identifier.php +++ b/src/XML/wsx/Identifier.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wsx; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * An Identifier element @@ -15,14 +17,9 @@ final class Identifier extends AbstractWsxElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wsx/Location.php b/src/XML/wsx/Location.php index e44f0d6f..90fcb81c 100644 --- a/src/XML/wsx/Location.php +++ b/src/XML/wsx/Location.php @@ -4,8 +4,10 @@ namespace SimpleSAML\WSSecurity\XML\wsx; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\URIElementTrait; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * An Location element @@ -15,14 +17,9 @@ final class Location extends AbstractWsxElement implements SchemaValidatableElementInterface { use SchemaValidatableElementTrait; - use URIElementTrait; + use TypedTextContentTrait; - /** - * @param string $content - */ - public function __construct(string $content) - { - $this->setContent($content); - } + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/tests/WSSecurity/XML/ElementRegistryTest.php b/tests/WSSecurity/XML/ElementRegistryTest.php index 12f1c95e..1405ac77 100644 --- a/tests/WSSecurity/XML/ElementRegistryTest.php +++ b/tests/WSSecurity/XML/ElementRegistryTest.php @@ -23,7 +23,7 @@ final class ElementRegistryTest extends TestCase */ public function testElementRegistry(): void { - $elementRegistry = dirname(__FILE__, 4) . '/src/XML/element.registry.php'; + $elementRegistry = dirname(__FILE__, 4) . '/classes/element.registry.php'; $namespaces = include($elementRegistry); foreach ($namespaces as $namespaceURI => $elements) { diff --git a/tests/WSSecurity/XML/auth/AdditionalContextTest.php b/tests/WSSecurity/XML/auth/AdditionalContextTest.php index 8a37a1d9..caff0be5 100644 --- a/tests/WSSecurity/XML/auth/AdditionalContextTest.php +++ b/tests/WSSecurity/XML/auth/AdditionalContextTest.php @@ -4,19 +4,22 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAdditionalContextType, - AbstractAuthElement, - AdditionalContext, - ContextItem, - Value, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; -use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; -use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAdditionalContextType; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AdditionalContext; +use SimpleSAML\WSSecurity\XML\auth\ContextItem; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; +use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ClaimTypeTest.php b/tests/WSSecurity/XML/auth/ClaimTypeTest.php index 4737e47f..387ba585 100644 --- a/tests/WSSecurity/XML/auth/ClaimTypeTest.php +++ b/tests/WSSecurity/XML/auth/ClaimTypeTest.php @@ -4,22 +4,25 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\Utils\XPath; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractClaimType, - ClaimType, - Description, - DisplayName, - DisplayValue, - Value, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, DOMDocumentFactory}; -use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; -use SimpleSAML\XML\Type\{AnyURIValue, BooleanValue, StringValue}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractClaimType; +use SimpleSAML\WSSecurity\XML\auth\ClaimType; +use SimpleSAML\WSSecurity\XML\auth\Description; +use SimpleSAML\WSSecurity\XML\auth\DisplayName; +use SimpleSAML\WSSecurity\XML\auth\DisplayValue; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; +use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\Type\BooleanValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php index bf85d581..75e49353 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php @@ -4,17 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, DataProvider, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Assert\AssertionFailedException; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedManyValueType, - StructuredValue, - Value, - ValueOneOf, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\Type\StringValue; /** diff --git a/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php index 5c6f5db3..e1be7d20 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php @@ -4,22 +4,24 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, DataProvider, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Assert\AssertionFailedException; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - StructuredValue, - Value, - ValueGreaterThan, - ValueGreaterThanOrEqual, - ValueLessThan, - ValueLessThanOrEqual, - ValueLowerBound, - ValueUpperBound, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan; +use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual; +use SimpleSAML\WSSecurity\XML\auth\ValueLessThan; +use SimpleSAML\WSSecurity\XML\auth\ValueLessThanOrEqual; +use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; +use SimpleSAML\WSSecurity\XML\auth\ValueUpperBound; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\Type\StringValue; /** diff --git a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php index 5f75b0cc..14972b04 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php @@ -4,21 +4,24 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, DataProvider, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedValueType, - ConstrainedValue, - //StructuredValue, - Value, - ValueGreaterThan, - ValueGreaterThanOrEqual, - ValueLessThan, - ValueLessThanOrEqual, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute,/*Chunk,*/ DOMDocumentFactory}; -use SimpleSAML\XML\Type\{BooleanValue, StringValue}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedValueType; +use SimpleSAML\WSSecurity\XML\auth\ConstrainedValue; +//use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan; +use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual; +use SimpleSAML\WSSecurity\XML\auth\ValueLessThan; +use SimpleSAML\WSSecurity\XML\auth\ValueLessThanOrEqual; +use SimpleSAML\XML\Attribute as XMLAttribute; +//use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\Type\BooleanValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ContextItemTest.php b/tests/WSSecurity/XML/auth/ContextItemTest.php index 5829f906..e2e041b5 100644 --- a/tests/WSSecurity/XML/auth/ContextItemTest.php +++ b/tests/WSSecurity/XML/auth/ContextItemTest.php @@ -4,18 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractContextItemType, - ContextItem, - Value, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractContextItemType; +use SimpleSAML\WSSecurity\XML\auth\ContextItem; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/DescriptionTest.php b/tests/WSSecurity/XML/auth/DescriptionTest.php index f0f67549..6fd9754f 100644 --- a/tests/WSSecurity/XML/auth/DescriptionTest.php +++ b/tests/WSSecurity/XML/auth/DescriptionTest.php @@ -4,10 +4,14 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractDescriptionType, Description}; -use SimpleSAML\XML\{Attribute, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractDescriptionType; +use SimpleSAML\WSSecurity\XML\auth\Description; +use SimpleSAML\XML\Attribute; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/DisplayNameTest.php b/tests/WSSecurity/XML/auth/DisplayNameTest.php index f8cd3fe2..4798cdcd 100644 --- a/tests/WSSecurity/XML/auth/DisplayNameTest.php +++ b/tests/WSSecurity/XML/auth/DisplayNameTest.php @@ -4,10 +4,14 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractDisplayNameType, DisplayName}; -use SimpleSAML\XML\{Attribute, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractDisplayNameType; +use SimpleSAML\WSSecurity\XML\auth\DisplayName; +use SimpleSAML\XML\Attribute; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/DisplayValueTest.php b/tests/WSSecurity/XML/auth/DisplayValueTest.php index e3659491..08448d9c 100644 --- a/tests/WSSecurity/XML/auth/DisplayValueTest.php +++ b/tests/WSSecurity/XML/auth/DisplayValueTest.php @@ -4,10 +4,14 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractDisplayValueType, DisplayValue}; -use SimpleSAML\XML\{Attribute, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractDisplayValueType; +use SimpleSAML\WSSecurity\XML\auth\DisplayValue; +use SimpleSAML\XML\Attribute; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/EncryptedValueTest.php b/tests/WSSecurity/XML/auth/EncryptedValueTest.php index 6e9e6d45..74d0c6a5 100644 --- a/tests/WSSecurity/XML/auth/EncryptedValueTest.php +++ b/tests/WSSecurity/XML/auth/EncryptedValueTest.php @@ -4,14 +4,24 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractEncryptedValueType, EncryptedValue}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractEncryptedValueType; +use SimpleSAML\WSSecurity\XML\auth\EncryptedValue; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSecurity\XML\ds\KeyInfo; -use SimpleSAML\XMLSecurity\XML\xenc\{CipherData, CipherValue, EncryptedData, EncryptedKey, EncryptionMethod}; -use SimpleSAML\XML\Type\{AnyURIValue, Base64BinaryValue, IDValue, StringValue}; +use SimpleSAML\XMLSecurity\XML\xenc\CipherData; +use SimpleSAML\XMLSecurity\XML\xenc\CipherValue; +use SimpleSAML\XMLSecurity\XML\xenc\EncryptedData; +use SimpleSAML\XMLSecurity\XML\xenc\EncryptedKey; +use SimpleSAML\XMLSecurity\XML\xenc\EncryptionMethod; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/StructuredValueTest.php b/tests/WSSecurity/XML/auth/StructuredValueTest.php index 6a2f90cc..ea934d31 100644 --- a/tests/WSSecurity/XML/auth/StructuredValueTest.php +++ b/tests/WSSecurity/XML/auth/StructuredValueTest.php @@ -4,10 +4,15 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, AbstractStructuredValueType, StructuredValue}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractStructuredValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php b/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php index 0c10b7d1..7d5c3667 100644 --- a/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php +++ b/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php @@ -4,15 +4,16 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - StructuredValue, - ValueGreaterThanOrEqual, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php b/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php index fa49b391..a05d57c9 100644 --- a/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php +++ b/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php @@ -4,15 +4,16 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - StructuredValue, - ValueGreaterThan, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueInRangenTest.php b/tests/WSSecurity/XML/auth/ValueInRangenTest.php index 069a3392..8ea52342 100644 --- a/tests/WSSecurity/XML/auth/ValueInRangenTest.php +++ b/tests/WSSecurity/XML/auth/ValueInRangenTest.php @@ -4,18 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractValueInRangeType, - StructuredValue, - Value, - ValueInRangen, - ValueLowerBound, - ValueUpperBound, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractValueInRangeType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\ValueInRangen; +use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; +use SimpleSAML\WSSecurity\XML\auth\ValueUpperBound; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php b/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php index f0d83ce5..318d8d6e 100644 --- a/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php +++ b/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php @@ -4,17 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - StructuredValue, - ValueLessThanOrEqual, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\ValueLessThanOrEqual; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; + use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueLessThanTest.php b/tests/WSSecurity/XML/auth/ValueLessThanTest.php index be96c61f..cb02472c 100644 --- a/tests/WSSecurity/XML/auth/ValueLessThanTest.php +++ b/tests/WSSecurity/XML/auth/ValueLessThanTest.php @@ -4,15 +4,16 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - StructuredValue, - ValueLessThan, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\ValueLessThan; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php b/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php index 5da1ba1e..5962e209 100644 --- a/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php +++ b/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php @@ -4,14 +4,13 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - Value, - ValueLowerBound, -}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php b/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php index b37e760a..2c4752a2 100644 --- a/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php +++ b/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php @@ -4,15 +4,16 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedManyValueType, - StructuredValue, - ValueOneOf, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php b/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php index bf95d211..e62f8a2b 100644 --- a/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php +++ b/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php @@ -4,14 +4,13 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedManyValueType, - Value, - ValueOneOf, -}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType; +use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueTest.php b/tests/WSSecurity/XML/auth/ValueTest.php index 30bac83b..c5c8dd1c 100644 --- a/tests/WSSecurity/XML/auth/ValueTest.php +++ b/tests/WSSecurity/XML/auth/ValueTest.php @@ -4,9 +4,11 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{AbstractAuthElement, Value}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\Value; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php b/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php index 8be72c46..f9315568 100644 --- a/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php +++ b/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php @@ -4,15 +4,16 @@ namespace SimpleSAML\Test\WSSecurity\XML\auth; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\auth\{ - AbstractAuthElement, - AbstractConstrainedSingleValueType, - StructuredValue, - ValueUpperBound, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement; +use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType; +use SimpleSAML\WSSecurity\XML\auth\StructuredValue; +use SimpleSAML\WSSecurity\XML\auth\ValueUpperBound; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; diff --git a/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php b/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php index 240da55a..f9e3a19f 100644 --- a/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php +++ b/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php @@ -33,6 +33,7 @@ final class AdditionalContextProcessedTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php b/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php index 8b8875d7..156f5fd0 100644 --- a/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php @@ -38,6 +38,7 @@ final class ApplicationServiceEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php b/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php index 8265fb7c..20c1a907 100644 --- a/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php @@ -41,6 +41,7 @@ final class AttributeServiceEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php b/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php index 41c24ea2..cbca7f5b 100644 --- a/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php @@ -38,6 +38,7 @@ final class AttributeServiceEndpointsTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php b/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php index 35b7a871..67a64fd1 100644 --- a/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php +++ b/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php @@ -42,6 +42,7 @@ final class AuthenticationTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php b/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php index 94722542..c6439a50 100644 --- a/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php +++ b/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php @@ -37,6 +37,7 @@ final class FilterPseudonymsTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/FreshnessTest.php b/tests/WSSecurity/XML/fed/FreshnessTest.php index 005140f9..77526062 100644 --- a/tests/WSSecurity/XML/fed/FreshnessTest.php +++ b/tests/WSSecurity/XML/fed/FreshnessTest.php @@ -36,6 +36,7 @@ final class FreshnessTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php b/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php index 8682348d..a287858e 100644 --- a/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php +++ b/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php @@ -33,6 +33,7 @@ final class IssuesSpecificPolicyFaultTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php index d82c246c..af8e2a12 100644 --- a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php +++ b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php @@ -38,6 +38,7 @@ final class PassiveRequestorEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php index 364b8037..d049e028 100644 --- a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php @@ -38,6 +38,7 @@ final class PassiveRequestorEndpointsTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/ProofTokenTest.php b/tests/WSSecurity/XML/fed/ProofTokenTest.php index e902d5e5..074efc39 100644 --- a/tests/WSSecurity/XML/fed/ProofTokenTest.php +++ b/tests/WSSecurity/XML/fed/ProofTokenTest.php @@ -27,7 +27,6 @@ #[Group('fed')] #[CoversClass(ProofToken::class)] #[CoversClass(AbstractProofTokenType::class)] -#[CoversClass(AbstractProofTokenType::class)] #[CoversClass(AbstractFedElement::class)] final class ProofTokenTest extends TestCase { diff --git a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php index c1fd9768..e873e884 100644 --- a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php @@ -38,6 +38,7 @@ final class PseudonymServiceEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php index 15a3177f..0de87f1a 100644 --- a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php @@ -38,6 +38,7 @@ final class PseudonymServiceEndpointsTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/PseudonymTest.php b/tests/WSSecurity/XML/fed/PseudonymTest.php index 6a44d90a..02849070 100644 --- a/tests/WSSecurity/XML/fed/PseudonymTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymTest.php @@ -40,6 +40,7 @@ final class PseudonymTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $basis */ protected static Chunk $basis; diff --git a/tests/WSSecurity/XML/fed/ReferenceDigestTest.php b/tests/WSSecurity/XML/fed/ReferenceDigestTest.php index 9b0e6811..d4e5feab 100644 --- a/tests/WSSecurity/XML/fed/ReferenceDigestTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceDigestTest.php @@ -4,14 +4,18 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\{AbstractFedElement, AbstractReferenceDigestType, ReferenceDigest}; +use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; +use SimpleSAML\WSSecurity\XML\fed\AbstractReferenceDigestType; +use SimpleSAML\WSSecurity\XML\fed\ReferenceDigest; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\{Base64BinaryValue, StringValue}; +use SimpleSAML\XML\Type\Base64BinaryValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; diff --git a/tests/WSSecurity/XML/fed/ReferenceEPRTest.php b/tests/WSSecurity/XML/fed/ReferenceEPRTest.php index 3b508bab..190aaa89 100644 --- a/tests/WSSecurity/XML/fed/ReferenceEPRTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceEPRTest.php @@ -5,19 +5,21 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; use DOMElement; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\WSSecurity\XML\fed\ReferenceEPR; -use SimpleSAML\WSSecurity\XML\wsa_200508\{ - AbstractEndpointReferenceType, - AbstractWsaElement, - Address, - Metadata, - ReferenceParameters, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractEndpointReferenceType; +use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; +use SimpleSAML\WSSecurity\XML\wsa_200508\Address; +use SimpleSAML\WSSecurity\XML\wsa_200508\Metadata; +use SimpleSAML\WSSecurity\XML\wsa_200508\ReferenceParameters; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/ReferenceToken11Test.php b/tests/WSSecurity/XML/fed/ReferenceToken11Test.php index 406ff367..77e656f3 100644 --- a/tests/WSSecurity/XML/fed/ReferenceToken11Test.php +++ b/tests/WSSecurity/XML/fed/ReferenceToken11Test.php @@ -4,12 +4,18 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\{AbstractAssertionType, AbstractFedElement, ReferenceToken11}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; -use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; +use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; +use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; +use SimpleSAML\WSSecurity\XML\fed\ReferenceToken11; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; +use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XML\Type\StringValue; use function dirname; @@ -28,6 +34,7 @@ final class ReferenceToken11Test extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/ReferenceTokenTest.php b/tests/WSSecurity/XML/fed/ReferenceTokenTest.php index dcc6717c..027735d7 100644 --- a/tests/WSSecurity/XML/fed/ReferenceTokenTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceTokenTest.php @@ -5,27 +5,29 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; use DOMElement; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\{ - AbstractReferenceTokenType, - ReferenceDigest, - ReferenceEPR, - ReferenceToken, - ReferenceType, - SerialNo, -}; -use SimpleSAML\WSSecurity\XML\wsa_200508\{ - AbstractEndpointReferenceType, - AbstractWsaElement, - Address, - Metadata, - ReferenceParameters, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; -use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; -use SimpleSAML\XML\Type\{AnyURIValue, Base64BinaryValue, StringValue}; +use SimpleSAML\WSSecurity\XML\fed\AbstractReferenceTokenType; +use SimpleSAML\WSSecurity\XML\fed\ReferenceDigest; +use SimpleSAML\WSSecurity\XML\fed\ReferenceEPR; +use SimpleSAML\WSSecurity\XML\fed\ReferenceToken; +use SimpleSAML\WSSecurity\XML\fed\ReferenceType; +use SimpleSAML\WSSecurity\XML\fed\SerialNo; +use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractEndpointReferenceType; +use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; +use SimpleSAML\WSSecurity\XML\wsa_200508\Address; +use SimpleSAML\WSSecurity\XML\wsa_200508\Metadata; +use SimpleSAML\WSSecurity\XML\wsa_200508\ReferenceParameters; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; +use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\Type\Base64BinaryValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/ReferenceTypeTest.php b/tests/WSSecurity/XML/fed/ReferenceTypeTest.php index 23e3339f..38490131 100644 --- a/tests/WSSecurity/XML/fed/ReferenceTypeTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceTypeTest.php @@ -4,18 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\Test\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\XML\fed\{ - AbstractAttributeExtensibleString, - AbstractAttributeExtensibleURI, - AbstractFedElement, - ReferenceType, -}; -use SimpleSAML\XML\{Attribute as XMLAttribute, DOMDocumentFactory}; +use SimpleSAML\WSSecurity\XML\fed\AbstractAttributeExtensibleString; +use SimpleSAML\WSSecurity\XML\fed\AbstractAttributeExtensibleURI; +use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; +use SimpleSAML\WSSecurity\XML\fed\ReferenceType; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\{AnyURIValue, StringValue}; +use SimpleSAML\XML\Type\AnyURIValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; diff --git a/tests/WSSecurity/XML/fed/RequestProofTokenTest.php b/tests/WSSecurity/XML/fed/RequestProofTokenTest.php index c08e32f1..ee0cc3b5 100644 --- a/tests/WSSecurity/XML/fed/RequestProofTokenTest.php +++ b/tests/WSSecurity/XML/fed/RequestProofTokenTest.php @@ -33,6 +33,7 @@ final class RequestProofTokenTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/RequestPseudonymTest.php b/tests/WSSecurity/XML/fed/RequestPseudonymTest.php index 41e42882..bdf4bbbd 100644 --- a/tests/WSSecurity/XML/fed/RequestPseudonymTest.php +++ b/tests/WSSecurity/XML/fed/RequestPseudonymTest.php @@ -4,12 +4,19 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use PHPUnit\Framework\Attributes\{CoversClass, Group}; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\fed\{AbstractFedElement, AbstractRequestPseudonymType, RequestPseudonym}; -use SimpleSAML\XML\{Attribute as XMLAttribute, Chunk, DOMDocumentFactory}; -use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; -use SimpleSAML\XML\Type\{BooleanValue, StringValue}; +use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; +use SimpleSAML\WSSecurity\XML\fed\AbstractRequestPseudonymType; +use SimpleSAML\WSSecurity\XML\fed\RequestPseudonym; +use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XML\Chunk; +use SimpleSAML\XML\DOMDocumentFactory; +use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; +use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XML\Type\BooleanValue; +use SimpleSAML\XML\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php b/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php index 7531c601..80913dc8 100644 --- a/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php +++ b/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php @@ -33,6 +33,7 @@ final class RequireBearerTokensTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php b/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php index d0c7d695..9ca2cefd 100644 --- a/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php +++ b/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php @@ -33,6 +33,7 @@ final class RequireSharedCookiesTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php b/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php index b471d396..6e1a7e40 100644 --- a/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php +++ b/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php @@ -33,6 +33,7 @@ final class RequireSignedTokensTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php b/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php index ad21e5bb..f11b7703 100644 --- a/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php +++ b/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php @@ -33,6 +33,7 @@ final class RequiresGenericClaimDialectTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php b/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php index f5a22c84..cfcb943e 100644 --- a/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php @@ -38,6 +38,7 @@ final class SecurityTokenServiceEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/SignOutBasisTest.php b/tests/WSSecurity/XML/fed/SignOutBasisTest.php index a7430c06..7c6fa121 100644 --- a/tests/WSSecurity/XML/fed/SignOutBasisTest.php +++ b/tests/WSSecurity/XML/fed/SignOutBasisTest.php @@ -31,6 +31,7 @@ final class SignOutBasisTest extends TestCase { use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; diff --git a/tests/WSSecurity/XML/fed/SignOutTest.php b/tests/WSSecurity/XML/fed/SignOutTest.php index 6680a961..22883432 100644 --- a/tests/WSSecurity/XML/fed/SignOutTest.php +++ b/tests/WSSecurity/XML/fed/SignOutTest.php @@ -36,6 +36,7 @@ final class SignOutTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $basis */ protected static Chunk $basis; diff --git a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php index b47f6ba4..0f717665 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php @@ -38,6 +38,7 @@ final class SingleSignOutNotificationEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php index 547d4d0b..214b5718 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php @@ -38,6 +38,7 @@ final class SingleSignOutNotificationEndpointsTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php index 8b848dce..6659801a 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php @@ -38,6 +38,7 @@ final class SingleSignOutSubscriptionEndpointTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php index 6863b5e3..beb4975b 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php @@ -38,6 +38,7 @@ final class SingleSignOutSubscriptionEndpointsTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/TargetScopesTest.php b/tests/WSSecurity/XML/fed/TargetScopesTest.php index 29913cc2..d0d537bb 100644 --- a/tests/WSSecurity/XML/fed/TargetScopesTest.php +++ b/tests/WSSecurity/XML/fed/TargetScopesTest.php @@ -38,6 +38,7 @@ final class TargetScopesTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $endpointReference */ protected static DOMElement $endpointReference; diff --git a/tests/WSSecurity/XML/fed/WebBindingTest.php b/tests/WSSecurity/XML/fed/WebBindingTest.php index ecc19a11..359b2e48 100644 --- a/tests/WSSecurity/XML/fed/WebBindingTest.php +++ b/tests/WSSecurity/XML/fed/WebBindingTest.php @@ -42,6 +42,7 @@ final class WebBindingTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php index 76fd0c2a..93b7e991 100644 --- a/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php @@ -36,6 +36,7 @@ final class AsymmetricBindingTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $some */ protected static Chunk $some; diff --git a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php index 119638e6..983adcea 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php @@ -44,6 +44,7 @@ final class IssuedTokenTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/sp_200507/IssuerTest.php b/tests/WSSecurity/XML/sp_200507/IssuerTest.php index deaaa03b..80a1ef34 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuerTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuerTest.php @@ -37,6 +37,7 @@ final class IssuerTest extends TestCase { use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php index edb67ce0..2f2d7839 100644 --- a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php @@ -43,6 +43,7 @@ final class SecureConversationTokenTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php index ca7eba6a..42b6cb66 100644 --- a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php @@ -43,6 +43,7 @@ final class SpnegoContextTokenTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php b/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php index 2233b8fe..4b492535 100644 --- a/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php +++ b/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php @@ -41,6 +41,7 @@ final class AlgorithmSuiteTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php index c0589887..d669dae3 100644 --- a/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php @@ -34,12 +34,14 @@ final class AsymmetricBindingTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \SimpleSAML\XML\Chunk $chunk */ protected static Chunk $chunk; /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php b/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php index d74b6f66..1a542dd1 100644 --- a/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php +++ b/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php @@ -41,6 +41,7 @@ final class BootstrapPolicyTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php index 882b8c38..0f263e9a 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php @@ -41,6 +41,7 @@ final class EncryptedSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php index d43f43f6..20ad0061 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php @@ -41,6 +41,7 @@ final class EncryptionTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php index 6163a376..af1e3506 100644 --- a/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php @@ -41,6 +41,7 @@ final class EndorsingEncryptedSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php index 2f52caea..1f57c5d1 100644 --- a/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php @@ -41,6 +41,7 @@ final class EndorsingSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php index 6c6aea1f..0e0e9e9c 100644 --- a/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php @@ -41,6 +41,7 @@ final class InitiatorEncryptionTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php b/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php index 36877370..6e0a04c4 100644 --- a/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php @@ -41,6 +41,7 @@ final class InitiatorSignatureTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php b/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php index 63b04d16..f57c96ba 100644 --- a/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php @@ -41,6 +41,7 @@ final class InitiatorTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/IssuerTest.php b/tests/WSSecurity/XML/sp_200702/IssuerTest.php index 20ee9238..ed1d596e 100644 --- a/tests/WSSecurity/XML/sp_200702/IssuerTest.php +++ b/tests/WSSecurity/XML/sp_200702/IssuerTest.php @@ -35,6 +35,7 @@ final class IssuerTest extends TestCase { use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ protected static DOMElement $referenceParametersContent; diff --git a/tests/WSSecurity/XML/sp_200702/LayoutTest.php b/tests/WSSecurity/XML/sp_200702/LayoutTest.php index 1b888364..5008006f 100644 --- a/tests/WSSecurity/XML/sp_200702/LayoutTest.php +++ b/tests/WSSecurity/XML/sp_200702/LayoutTest.php @@ -41,6 +41,7 @@ final class LayoutTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php b/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php index 773f307d..8c66ca60 100644 --- a/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php @@ -41,6 +41,7 @@ final class ProtectionTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php index 0a9fe64e..6473faca 100644 --- a/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php @@ -41,6 +41,7 @@ final class RecipientEncryptionTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php b/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php index 0ec3e960..aa6278ea 100644 --- a/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php @@ -41,6 +41,7 @@ final class RecipientSignatureTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php b/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php index 701c18d6..4cd23638 100644 --- a/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php @@ -41,6 +41,7 @@ final class RecipientTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php b/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php index 90b8a1b1..45cc13f7 100644 --- a/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php @@ -41,6 +41,7 @@ final class SignatureTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php index 81dc08f9..98c594b6 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php @@ -41,6 +41,7 @@ final class SignedEncryptedSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php index 29a1fb91..e50a63e0 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php @@ -41,6 +41,7 @@ final class SignedEndorsingEncryptedSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php index c34848fa..6dd55df8 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php @@ -41,6 +41,7 @@ final class SignedEndorsingSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php index 725beedc..e65bd76e 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php @@ -41,6 +41,7 @@ final class SignedSupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php index 643e29a1..b71262fb 100644 --- a/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php @@ -41,6 +41,7 @@ final class SupportingTokensTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php index 23aa466e..1cea7e1b 100644 --- a/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php @@ -41,6 +41,7 @@ final class SymmetricBindingTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php b/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php index d9c28f29..5d658fc9 100644 --- a/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php +++ b/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php @@ -41,6 +41,7 @@ final class TransportBindingTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php b/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php index 62315b38..4faa0e0c 100644 --- a/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php @@ -41,6 +41,7 @@ final class TransportTokenTest extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/Trust13Test.php b/tests/WSSecurity/XML/sp_200702/Trust13Test.php index a7986a56..648d3b42 100644 --- a/tests/WSSecurity/XML/sp_200702/Trust13Test.php +++ b/tests/WSSecurity/XML/sp_200702/Trust13Test.php @@ -41,6 +41,7 @@ final class Trust13Test extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/Wss10Test.php b/tests/WSSecurity/XML/sp_200702/Wss10Test.php index cf38c6a7..b19456d8 100644 --- a/tests/WSSecurity/XML/sp_200702/Wss10Test.php +++ b/tests/WSSecurity/XML/sp_200702/Wss10Test.php @@ -41,6 +41,7 @@ final class Wss10Test extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/sp_200702/Wss11Test.php b/tests/WSSecurity/XML/sp_200702/Wss11Test.php index ad6bf580..7a890f2e 100644 --- a/tests/WSSecurity/XML/sp_200702/Wss11Test.php +++ b/tests/WSSecurity/XML/sp_200702/Wss11Test.php @@ -41,6 +41,7 @@ final class Wss11Test extends TestCase /** @var \SimpleSAML\XML\Attribute $attr */ protected static XMLAttribute $attr; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php b/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php index 25c87bec..66e5c690 100644 --- a/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php +++ b/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php @@ -40,6 +40,7 @@ final class EndpointReferenceTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/wsa_200408/FaultToTest.php b/tests/WSSecurity/XML/wsa_200408/FaultToTest.php index 092ba75f..f1c0557c 100644 --- a/tests/WSSecurity/XML/wsa_200408/FaultToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/FaultToTest.php @@ -40,6 +40,7 @@ final class FaultToTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/wsa_200408/FromTest.php b/tests/WSSecurity/XML/wsa_200408/FromTest.php index f94fa766..71e6aa1a 100644 --- a/tests/WSSecurity/XML/wsa_200408/FromTest.php +++ b/tests/WSSecurity/XML/wsa_200408/FromTest.php @@ -40,6 +40,7 @@ final class FromTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/wsa_200408/ReferenceParametersTest.php b/tests/WSSecurity/XML/wsa_200408/ReferenceParametersTest.php index ac4b36eb..279b15cb 100644 --- a/tests/WSSecurity/XML/wsa_200408/ReferenceParametersTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ReferenceParametersTest.php @@ -29,6 +29,7 @@ final class ReferenceParametersTest extends TestCase { use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ private static DOMElement $referenceParametersContent; diff --git a/tests/WSSecurity/XML/wsa_200408/ReferencePropertiesTest.php b/tests/WSSecurity/XML/wsa_200408/ReferencePropertiesTest.php index 1bc87826..091b26c1 100644 --- a/tests/WSSecurity/XML/wsa_200408/ReferencePropertiesTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ReferencePropertiesTest.php @@ -29,6 +29,7 @@ final class ReferencePropertiesTest extends TestCase { use SerializableElementTestTrait; + /** @var \DOMElement $ReferencePropertiesContent */ private static DOMElement $ReferencePropertiesContent; diff --git a/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php b/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php index 97b05684..a68b5124 100644 --- a/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php @@ -40,6 +40,7 @@ final class ReplyToTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referencePropertiesContent */ protected static DOMElement $referencePropertiesContent; diff --git a/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php b/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php index 65fcf9cb..9a5a2141 100644 --- a/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php +++ b/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php @@ -37,6 +37,7 @@ final class EndpointReferenceTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ protected static DOMElement $referenceParametersContent; diff --git a/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php b/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php index b6934b6c..73d6ad6f 100644 --- a/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php +++ b/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractAttributedURIType; use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID; -use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; diff --git a/tests/WSSecurity/XML/wsa_200508/MetadataTest.php b/tests/WSSecurity/XML/wsa_200508/MetadataTest.php index 286d5b2f..2cea2480 100644 --- a/tests/WSSecurity/XML/wsa_200508/MetadataTest.php +++ b/tests/WSSecurity/XML/wsa_200508/MetadataTest.php @@ -32,6 +32,7 @@ final class MetadataTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $MetadataContent */ private static DOMElement $metadataContent; diff --git a/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php b/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php index 671c791d..1366044b 100644 --- a/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php @@ -32,6 +32,7 @@ final class ReferenceParametersTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ private static DOMElement $referenceParametersContent; diff --git a/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php b/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php index b7e21ef7..ae1ef197 100644 --- a/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php +++ b/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php @@ -30,6 +30,7 @@ final class RelatesToTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** */ public static function setUpBeforeClass(): void diff --git a/tests/WSSecurity/XML/wst_200502/IssuerTest.php b/tests/WSSecurity/XML/wst_200502/IssuerTest.php index c7aae1ea..215c2152 100644 --- a/tests/WSSecurity/XML/wst_200502/IssuerTest.php +++ b/tests/WSSecurity/XML/wst_200502/IssuerTest.php @@ -34,6 +34,7 @@ final class IssuerTest extends TestCase { use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ protected static DOMElement $referenceParametersContent; diff --git a/tests/WSSecurity/XML/wst_200512/IssuerTest.php b/tests/WSSecurity/XML/wst_200512/IssuerTest.php index 67d8a74b..44cc6252 100644 --- a/tests/WSSecurity/XML/wst_200512/IssuerTest.php +++ b/tests/WSSecurity/XML/wst_200512/IssuerTest.php @@ -35,6 +35,7 @@ final class IssuerTest extends TestCase { use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ protected static DOMElement $referenceParametersContent; diff --git a/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php b/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php index afe27d22..c2cc6a21 100644 --- a/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php +++ b/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php @@ -34,6 +34,7 @@ final class MetadataReferenceTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; + /** @var \DOMElement $referenceParametersContent */ protected static DOMElement $referenceParametersContent; From a1f00e01c167b1a5e7d4a26f835f3488a3884a2e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 30 Nov 2025 00:32:34 +0100 Subject: [PATCH 16/34] Migrate to xsd-types --- src/Assert/Assert.php | 5 +++ src/Assert/WSUDateTimeTrait.php | 33 ++++++++++++++++++ src/XML/wst_200512/Forwardable.php | 2 +- src/XML/wsu/AbstractAttributedDateTime.php | 39 +++++++++------------ src/XML/wsu/AbstractAttributedURI.php | 35 +++++++++++-------- src/XML/wsu/AbstractTimestamp.php | 22 ++++++------ src/XML/wsu/Type/DateTimeValue.php | 31 +++++++++++++++++ src/XML/wsu/Type/IDValue.php | 26 ++++++++++++++ src/XML/wsx/GetMetadata.php | 11 +++--- src/XML/wsx/Metadata.php | 9 ++--- src/XML/wsx/MetadataReference.php | 11 +++--- src/XML/wsx/MetadataSection.php | 40 +++++++++++----------- 12 files changed, 180 insertions(+), 84 deletions(-) create mode 100644 src/Assert/WSUDateTimeTrait.php create mode 100644 src/XML/wsu/Type/DateTimeValue.php create mode 100644 src/XML/wsu/Type/IDValue.php diff --git a/src/Assert/Assert.php b/src/Assert/Assert.php index eafe62fb..6d0b9456 100644 --- a/src/Assert/Assert.php +++ b/src/Assert/Assert.php @@ -8,7 +8,12 @@ /** * @package simplesamlphp/ws-security + * + * @method static void validWSUDateTime(mixed $value, string $message = '', string $exception = '') + * @method static void allWSUDateTime(mixed $value, string $message = '', string $exception = '') + * @method static void nullOrValueWSUDateTime(mixed $value, string $message = '', string $exception = '') */ class Assert extends BaseAssert { + use WSUDateTimeTrait; } diff --git a/src/Assert/WSUDateTimeTrait.php b/src/Assert/WSUDateTimeTrait.php new file mode 100644 index 00000000..5b93a883 --- /dev/null +++ b/src/Assert/WSUDateTimeTrait.php @@ -0,0 +1,33 @@ +getMessage()); + } + } +} diff --git a/src/XML/wst_200512/Forwardable.php b/src/XML/wst_200512/Forwardable.php index c4097fdd..633c3195 100644 --- a/src/XML/wst_200512/Forwardable.php +++ b/src/XML/wst_200512/Forwardable.php @@ -7,7 +7,7 @@ use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\BooleanValue +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * A Forwardable element diff --git a/src/XML/wsu/AbstractAttributedDateTime.php b/src/XML/wsu/AbstractAttributedDateTime.php index 0f3efc29..33df51d9 100644 --- a/src/XML/wsu/AbstractAttributedDateTime.php +++ b/src/XML/wsu/AbstractAttributedDateTime.php @@ -4,15 +4,16 @@ namespace SimpleSAML\WSSecurity\XML\wsu; -use DateTimeImmutable; use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\Exception\ProtocolViolationException; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Abstract class defining the AttributedDateTime type @@ -30,24 +31,23 @@ abstract class AbstractAttributedDateTime extends AbstractWsuElement /** * AbstractAttributedDateTime constructor * - * @param \DateTimeImmutable $dateTime - * @param string|null $Id + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue $dateTime + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected DateTimeImmutable $dateTime, - protected ?string $Id = null, + protected DateTimeValue $dateTime, + protected ?IDValue $Id = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($Id); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ - public function getId(): ?string + public function getId(): ?IDValue { return $this->Id; } @@ -56,9 +56,9 @@ public function getId(): ?string /** * Collect the value of the dateTime property * - * @return \DateTimeImmutable + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue */ - public function getDateTime(): DateTimeImmutable + public function getDateTime(): DateTimeValue { return $this->dateTime; } @@ -70,7 +70,7 @@ public function getDateTime(): DateTimeImmutable * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -78,17 +78,12 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - // Time values MUST be expressed in the UTC timezone using the 'Z' timezone identifier - // Strip sub-seconds - $xml->textContent = preg_replace('/([.][0-9]+)/', '', $xml->textContent, 1); - Assert::validDateTime($xml->textContent, ProtocolViolationException::class); - $Id = null; if ($xml->hasAttributeNS(static::NS, 'Id')) { - $Id = $xml->getAttributeNS(static::NS, 'Id'); + $Id = IDValue::fromString($xml->getAttributeNS(static::NS, 'Id')); } - return new static(new DateTimeImmutable($xml->textContent), $Id, self::getAttributesNSFromXML($xml)); + return new static(DateTimeValue::fromString($xml->textContent), $Id, self::getAttributesNSFromXML($xml)); } @@ -99,11 +94,11 @@ public static function fromXML(DOMElement $xml): static final public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getDateTime()->format(C::DATETIME_FORMAT); + $e->textContent = $this->getDateTime()->getValue(); $attributes = $this->getAttributesNS(); if ($this->getId() !== null) { - $attributes[] = new XMLAttribute(static::NS, 'wsu', 'Id', $this->getId()); + $this->getId()->toAttribute()->toXML($e); } foreach ($attributes as $attr) { diff --git a/src/XML/wsu/AbstractAttributedURI.php b/src/XML/wsu/AbstractAttributedURI.php index de47428d..d91c7f00 100644 --- a/src/XML/wsu/AbstractAttributedURI.php +++ b/src/XML/wsu/AbstractAttributedURI.php @@ -6,11 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\URIElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Abstract class defining the AttributedURI type @@ -20,7 +22,10 @@ abstract class AbstractAttributedURI extends AbstractWsuElement { use ExtendableAttributesTrait; - use URIElementTrait; + use TypedTextContentTrait; + + /** @var string */ + public const TEXTCONTENT_TYPE = AnyURIValue::class; /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -29,13 +34,13 @@ abstract class AbstractAttributedURI extends AbstractWsuElement /** * AbstractAttributedURI constructor * - * @param string $uri - * @param string|null $Id + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $uri + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final protected function __construct( - string $uri, - protected ?string $Id = null, + AnyURIValue $uri, + protected ?IDValue $Id = null, array $namespacedAttributes = [], ) { Assert::nullOrValidNCName($Id); @@ -46,9 +51,9 @@ final protected function __construct( /** - * @return string|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ - public function getId(): ?string + public function getId(): ?IDValue { return $this->Id; } @@ -60,7 +65,7 @@ public function getId(): ?string * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -70,10 +75,10 @@ public static function fromXML(DOMElement $xml): static $Id = null; if ($xml->hasAttributeNS(static::NS, 'Id')) { - $Id = $xml->getAttributeNS(static::NS, 'Id'); + $Id = IDValue::fromString($xml->getAttributeNS(static::NS, 'Id')); } - return new static($xml->textContent, $Id, self::getAttributesNSFromXML($xml)); + return new static(AnyURIValue::fromString($xml->textContent), $Id, self::getAttributesNSFromXML($xml)); } @@ -84,11 +89,11 @@ public static function fromXML(DOMElement $xml): static final public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->textContent = $this->getContent(); + $e->textContent = $this->getContent()->getValue(); $attributes = $this->getAttributesNS(); if ($this->getId() !== null) { - $attributes[] = new XMLAttribute(static::NS, 'wsu', 'Id', $this->getId()); + $this->getId()->toAttribute()->toXML($e); } foreach ($attributes as $attr) { diff --git a/src/XML/wsu/AbstractTimestamp.php b/src/XML/wsu/AbstractTimestamp.php index 37aeefb8..20081f44 100644 --- a/src/XML/wsu/AbstractTimestamp.php +++ b/src/XML/wsu/AbstractTimestamp.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -42,28 +43,26 @@ abstract class AbstractTimestamp extends AbstractWsuElement * * @param \SimpleSAML\WSSecurity\XML\wsu\Created|null $created * @param \SimpleSAML\WSSecurity\XML\wsu\Expires|null $expires - * @param string|null $Id + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\SerializableElementInterface> $elements * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?Created $created = null, protected ?Expires $expires = null, - protected ?string $Id = null, + protected ?IDValue $Id = null, array $elements = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidNCName($Id); - $this->setElements($elements); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ - public function getId(): ?string + public function getId(): ?IDValue { return $this->Id; } @@ -108,7 +107,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -122,7 +121,7 @@ public static function fromXML(DOMElement $xml): static $Id = null; if ($xml->hasAttributeNS(static::NS, 'Id')) { - $Id = $xml->getAttributeNS(static::NS, 'Id'); + $Id = IDValue::fromString($xml->getAttributeNS(static::NS, 'Id')); } return new static( @@ -147,7 +146,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $attributes = $this->getAttributesNS(); if ($this->getId() !== null) { - $attributes[] = new XMLAttribute(static::NS, 'wsu', 'Id', $this->getId()); + $this->getId()->toAttribute()->toXML($e); } foreach ($attributes as $attr) { @@ -158,7 +157,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $this->getExpires()?->toXML($e); foreach ($this->getElements() as $detail) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $detail */ $detail->toXML($e); } diff --git a/src/XML/wsu/Type/DateTimeValue.php b/src/XML/wsu/Type/DateTimeValue.php new file mode 100644 index 00000000..9f8a58dc --- /dev/null +++ b/src/XML/wsu/Type/DateTimeValue.php @@ -0,0 +1,31 @@ +sanitizeValue($value), ProtocolViolationException::class); + } +} diff --git a/src/XML/wsu/Type/IDValue.php b/src/XML/wsu/Type/IDValue.php new file mode 100644 index 00000000..009ed9cc --- /dev/null +++ b/src/XML/wsu/Type/IDValue.php @@ -0,0 +1,26 @@ + $namespacedAttributes */ final public function __construct( protected SerializableElementInterface|MetadataReference|Location $child, - protected string $Dialect, - protected ?string $Identifier = null, + protected AnyURIValue $Dialect, + protected ?AnyURIValue $Identifier = null, array $namespacedAttributes = [], ) { if (!($child instanceof MetadataReference) && !($child instanceof Location)) { Assert::notSame($child->toXML()->namespaceURI, static::NS); } - Assert::validURI($Dialect); - Assert::nullOrValidURI($Identifier); $this->setAttributesNS($namespacedAttributes); } @@ -78,9 +78,9 @@ public function getChild(): SerializableElementInterface|MetadataReference|Locat /** * Get the Dialect property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getDialect(): string + public function getDialect(): AnyURIValue { return $this->Dialect; } @@ -89,9 +89,9 @@ public function getDialect(): string /** * Get the Identifier property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getIdentifier(): ?string + public function getIdentifier(): ?AnyURIValue { return $this->Identifier; } @@ -103,7 +103,7 @@ public function getIdentifier(): ?string * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -121,8 +121,8 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($children), - self::getAttribute($xml, 'Dialect'), - self::getOptionalAttribute($xml, 'Identifier', null), + self::getAttribute($xml, 'Dialect', AnyURIValue::class), + self::getOptionalAttribute($xml, 'Identifier', AnyURIValue::class, null), self::getAttributesNSFromXML($xml), ); } @@ -137,10 +137,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = parent::instantiateParentElement($parent); - $e->setAttribute('Dialect', $this->getDialect()); + $e->setAttribute('Dialect', $this->getDialect()->getValue()); if ($this->getIdentifier() !== null) { - $e->setAttribute('Identifier', $this->getIdentifier()); + $e->setAttribute('Identifier', $this->getIdentifier()->getValue()); } $this->getChild()->toXML($e); From ee7f79423bff08c48c06fdff953b03df174e3cfc Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 30 Nov 2025 16:35:20 +0100 Subject: [PATCH 17/34] Migrate to xsd-types --- .github/workflows/php.yml | 4 +- composer.json | 2 +- .../wst_200512/AbstractAuthenticatorType.php | 6 +-- .../wst_200512/AbstractBinaryExchangeType.php | 8 ++-- .../wst_200512/AbstractBinarySecretType.php | 42 +++++------------ .../wst_200512/AbstractCancelTargetType.php | 10 ++-- src/XML/wst_200512/AbstractClaimsType.php | 23 +++++---- .../AbstractComputedKeyOpenEnum.php | 47 +------------------ src/XML/wst_200512/AbstractDelegateToType.php | 10 ++-- src/XML/wst_200512/AbstractEncryptionType.php | 10 ++-- src/XML/wst_200512/AbstractEntropyType.php | 6 +-- .../AbstractKeyExchangeTokenType.php | 6 +-- .../wst_200512/AbstractKeyTypeOpenEnum.php | 47 +------------------ src/XML/wst_200512/AbstractLifetimeType.php | 6 +-- src/XML/wst_200512/AbstractOnBehalfOfType.php | 10 ++-- .../wst_200512/AbstractParticipantType.php | 10 ++-- .../wst_200512/AbstractParticipantsType.php | 8 ++-- .../AbstractProofEncryptionType.php | 10 ++-- .../wst_200512/AbstractRenewTargetType.php | 10 ++-- src/XML/wst_200512/AbstractRenewingType.php | 29 ++++++------ ...ractRequestSecurityTokenCollectionType.php | 8 ++-- ...estSecurityTokenResponseCollectionType.php | 12 ++--- ...stractRequestSecurityTokenResponseType.php | 23 +++++---- .../AbstractRequestSecurityTokenType.php | 23 +++++---- .../AbstractRequestTypeOpenEnum.php | 47 +------------------ .../AbstractRequestedProofTokenType.php | 10 ++-- .../AbstractRequestedReferenceType.php | 8 ++-- .../AbstractRequestedSecurityTokenType.php | 10 ++-- .../wst_200512/AbstractSignChallengeType.php | 6 +-- .../wst_200512/AbstractStatusCodeOpenEnum.php | 47 +------------------ src/XML/wst_200512/AbstractStatusType.php | 8 ++-- src/XML/wst_200512/AbstractUseKeyType.php | 25 +++++----- .../wst_200512/AbstractValidateTargetType.php | 10 ++-- src/XML/wst_200512/AllowPostdating.php | 7 +-- src/XML/wst_200512/Delegatable.php | 1 + src/XML/wst_200512/RequestKET.php | 7 +-- .../wst_200512/RequestedTokenCancelled.php | 7 +-- 37 files changed, 187 insertions(+), 376 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index da02c73a..2bbd3575 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.2', '8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6 with: php-version: ${{ matrix.php-version }} @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.6 with: enable_eslinter: false enable_jsonlinter: true diff --git a/composer.json b/composer.json index 03fe1915..9a4672c5 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "ext-spl": "*", "simplesamlphp/assert": "~1.9", - "simplesamlphp/saml2": "dev-feature/xsd-types", + "simplesamlphp/saml2": "~6.0", "simplesamlphp/xml-common": "~2.3", "simplesamlphp/xml-security": "~2.0", "simplesamlphp/xml-soap": "~2.0" diff --git a/src/XML/wst_200512/AbstractAuthenticatorType.php b/src/XML/wst_200512/AbstractAuthenticatorType.php index 3be1ec9a..4d8aee28 100644 --- a/src/XML/wst_200512/AbstractAuthenticatorType.php +++ b/src/XML/wst_200512/AbstractAuthenticatorType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -66,7 +66,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractBinaryExchangeType.php b/src/XML/wst_200512/AbstractBinaryExchangeType.php index f14ec3d0..407f7a78 100644 --- a/src/XML/wst_200512/AbstractBinaryExchangeType.php +++ b/src/XML/wst_200512/AbstractBinaryExchangeType.php @@ -6,13 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A BinaryExchangeType element @@ -77,7 +77,7 @@ public function getEncodingType(): AnyURIValue * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractBinarySecretType.php b/src/XML/wst_200512/AbstractBinarySecretType.php index dfcfe6aa..a2d9c01f 100644 --- a/src/XML/wst_200512/AbstractBinarySecretType.php +++ b/src/XML/wst_200512/AbstractBinarySecretType.php @@ -6,16 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; -use SimpleSAML\XMLSchema\Base64BinaryValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A BinarySecertType element @@ -35,31 +32,16 @@ abstract class AbstractBinarySecretType extends AbstractWstElement public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; - /** @var string[]|null */ - protected ?array $Type; - - /** * @param \SimpleSAML\XMLSchema\Type\Base64BinaryValue $content - * @param (\SimpleSAML\WSSecurity\XML\wst_200512\BinarySecretTypeEnum|string)[]|null $Type + * @param \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue|null $Type * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( Base64BinaryValue $content, - ?array $Type = null, + protected ?AnyURIListValue $Type = null, array $namespacedAttributes = [], ) { - if ($Type !== null) { - $Type = array_map( - function (BinarySecretTypeEnum|string $v): string { - return ($v instanceof BinarySecretTypeEnum) ? $v->value : $v; - }, - $Type, - ); - Assert::allValidURI($Type, SchemaViolationException::class); - $this->Type = $Type; - } - $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } @@ -68,9 +50,9 @@ function (BinarySecretTypeEnum|string $v): string { /** * Get the Type property. * - * @return string[]|null + * @return \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue|null */ - public function getType(): ?array + public function getType(): ?AnyURIListValue { return $this->Type; } @@ -82,7 +64,7 @@ public function getType(): ?array * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -92,7 +74,7 @@ public static function fromXML(DOMElement $xml): static return new static( Base64BinaryValue::fromString($xml->textContent), - explode(' ', self::getAttribute($xml, 'Type')), + self::getAttribute($xml, 'Type', AnyURIListValue::class), self::getAttributesNSFromXML($xml), ); } @@ -110,7 +92,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e->textContent = $this->getContent()->getValue(); if ($this->getType() !== null) { - $e->setAttribute('Type', implode(' ', $this->getType())); + $e->setAttribute('Type', $this->getType()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wst_200512/AbstractCancelTargetType.php b/src/XML/wst_200512/AbstractCancelTargetType.php index 2f8e7791..3a0939a8 100644 --- a/src/XML/wst_200512/AbstractCancelTargetType.php +++ b/src/XML/wst_200512/AbstractCancelTargetType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -46,7 +46,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractClaimsType.php b/src/XML/wst_200512/AbstractClaimsType.php index bc5a0aa2..42ff681b 100644 --- a/src/XML/wst_200512/AbstractClaimsType.php +++ b/src/XML/wst_200512/AbstractClaimsType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ClaimsType element @@ -32,26 +33,24 @@ abstract class AbstractClaimsType extends AbstractWstElement /** * AbstractClaimsType constructor * - * @param string|null $dialect + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $dialect * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $dialect = null, + protected ?AnyURIValue $dialect = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($dialect, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getDialect(): ?string + public function getDialect(): ?AnyURIValue { return $this->dialect; } @@ -76,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -85,7 +84,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Dialect', null), + self::getOptionalAttribute($xml, 'Dialect', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +102,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getDialect() !== null) { - $e->setAttribute('Dialect', $this->getDialect()); + $e->setAttribute('Dialect', $this->getDialect()->getValue()); } foreach ($this->getElements() as $child) { diff --git a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php index 67d0c3a2..87191c96 100644 --- a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php @@ -4,16 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; /** * A ComputedKeyOpenEnum element @@ -27,40 +19,5 @@ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement use TypedTextContentTrait; /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200512\ComputedKeyEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (ComputedKeyEnum|string $v): string { - return ($v instanceof ComputedKeyEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(implode(' ', $values)); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIListValue::class; } diff --git a/src/XML/wst_200512/AbstractDelegateToType.php b/src/XML/wst_200512/AbstractDelegateToType.php index 772f9d64..a4aa4293 100644 --- a/src/XML/wst_200512/AbstractDelegateToType.php +++ b/src/XML/wst_200512/AbstractDelegateToType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the DelegateToType element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractEncryptionType.php b/src/XML/wst_200512/AbstractEncryptionType.php index 5af46dc3..61b04258 100644 --- a/src/XML/wst_200512/AbstractEncryptionType.php +++ b/src/XML/wst_200512/AbstractEncryptionType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the EncryptionType element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractEntropyType.php b/src/XML/wst_200512/AbstractEntropyType.php index 5e122104..5dc39cd4 100644 --- a/src/XML/wst_200512/AbstractEntropyType.php +++ b/src/XML/wst_200512/AbstractEntropyType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the EntropyType element @@ -61,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractKeyExchangeTokenType.php b/src/XML/wst_200512/AbstractKeyExchangeTokenType.php index 2fb9db49..91752ee8 100644 --- a/src/XML/wst_200512/AbstractKeyExchangeTokenType.php +++ b/src/XML/wst_200512/AbstractKeyExchangeTokenType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the KeyExchangeTokenType element @@ -52,7 +52,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php b/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php index 19785024..74a53020 100644 --- a/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php +++ b/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php @@ -4,16 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; /** * A KeyTypeOpenEnum element @@ -28,40 +20,5 @@ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200512\KeyTypeEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (KeyTypeEnum|string $v): string { - return ($v instanceof KeyTypeEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(StringValue::fromString(implode(' ', $values))); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIListValue::class; } diff --git a/src/XML/wst_200512/AbstractLifetimeType.php b/src/XML/wst_200512/AbstractLifetimeType.php index 1a876eed..e686ee72 100644 --- a/src/XML/wst_200512/AbstractLifetimeType.php +++ b/src/XML/wst_200512/AbstractLifetimeType.php @@ -8,8 +8,8 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsu\Created; use SimpleSAML\WSSecurity\XML\wsu\Expires; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; /** * Class defining the LifetimeType element @@ -67,7 +67,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractOnBehalfOfType.php b/src/XML/wst_200512/AbstractOnBehalfOfType.php index 2cf4d718..d7bfeb19 100644 --- a/src/XML/wst_200512/AbstractOnBehalfOfType.php +++ b/src/XML/wst_200512/AbstractOnBehalfOfType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the OnBehalfOfType element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractParticipantType.php b/src/XML/wst_200512/AbstractParticipantType.php index 606bdb44..c176113c 100644 --- a/src/XML/wst_200512/AbstractParticipantType.php +++ b/src/XML/wst_200512/AbstractParticipantType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ParticipantType element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractParticipantsType.php b/src/XML/wst_200512/AbstractParticipantsType.php index d4b28064..d232e46b 100644 --- a/src/XML/wst_200512/AbstractParticipantsType.php +++ b/src/XML/wst_200512/AbstractParticipantsType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ParticipantsType element @@ -77,7 +77,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractProofEncryptionType.php b/src/XML/wst_200512/AbstractProofEncryptionType.php index 376cea73..ee4b1a0e 100644 --- a/src/XML/wst_200512/AbstractProofEncryptionType.php +++ b/src/XML/wst_200512/AbstractProofEncryptionType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ProofEncryptionType element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractRenewTargetType.php b/src/XML/wst_200512/AbstractRenewTargetType.php index ddcf2fa0..4fc2a5ff 100644 --- a/src/XML/wst_200512/AbstractRenewTargetType.php +++ b/src/XML/wst_200512/AbstractRenewTargetType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -46,7 +46,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractRenewingType.php b/src/XML/wst_200512/AbstractRenewingType.php index 0ae2e2ac..295cde15 100644 --- a/src/XML/wst_200512/AbstractRenewingType.php +++ b/src/XML/wst_200512/AbstractRenewingType.php @@ -6,7 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * Class defining the RenewingType element @@ -18,29 +19,29 @@ abstract class AbstractRenewingType extends AbstractWstElement /** * AbstractRenewingType constructor * - * @param bool|null $allow - * @param bool|null $ok + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $allow + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $ok */ final public function __construct( - protected ?bool $allow = null, - protected ?bool $ok = null, + protected ?BooleanValue $allow = null, + protected ?BooleanValue $ok = null, ) { } /** - * @return bool|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ - public function getAllow(): ?bool + public function getAllow(): ?BooleanValue { return $this->allow; } /** - * @return bool|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ - public function getOk(): ?bool + public function getOk(): ?BooleanValue { return $this->ok; } @@ -64,7 +65,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -73,8 +74,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalBooleanAttribute($xml, 'Allow', null), - self::getOptionalBooleanAttribute($xml, 'OK', null), + self::getOptionalAttribute($xml, 'Allow', BooleanValue::class, null), + self::getOptionalAttribute($xml, 'OK', BooleanValue::class, null), ); } @@ -90,11 +91,11 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getAllow() !== null) { - $e->setAttribute('Allow', $this->getAllow() ? 'true' : 'false'); + $e->setAttribute('Allow', $this->getAllow()->getValue()); } if ($this->getOk() !== null) { - $e->setAttribute('OK', $this->getOk() ? 'true' : 'false'); + $e->setAttribute('OK', $this->getOk()->getValue()); } return $e; diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenCollectionType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenCollectionType.php index ef1a4d9b..bfac0552 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenCollectionType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenCollectionType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; /** * A RequestSecurityTokenCollectionType element @@ -49,7 +49,7 @@ public function getRequestSecurityToken(): array * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php index f6e9e2ed..ad6b9d24 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A RequestSecurityTokenResponseCollectionType element @@ -21,7 +21,7 @@ abstract class AbstractRequestSecurityTokenResponseCollectionType extends Abstra { use ExtendableAttributesTrait; - /** @var string|\SimpleSAML\XML\XsNamespace */ + /** The namespace-attribute for the xs:anyAttribute */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -61,7 +61,7 @@ public function getRequestSecurityTokenResponse(): array * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php index c896c714..a4a0b336 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestSecurityTokenResponseType element @@ -32,26 +33,24 @@ abstract class AbstractRequestSecurityTokenResponseType extends AbstractWstEleme /** * AbstractRequestSecurityTokenResponseType constructor * - * @param string|null $context + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $context * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $context = null, + protected ?AnyURIValue $context = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($context, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getContext(): ?string + public function getContext(): ?AnyURIValue { return $this->context; } @@ -76,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -85,7 +84,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Context'), + self::getOptionalAttribute($xml, 'Context', AnyURIValue::class), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -103,7 +102,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getContext() !== null) { - $e->setAttribute('Context', $this->getContext()); + $e->setAttribute('Context', $this->getContext()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenType.php index 00f3afcb..19623e29 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestSecurityTokenType element @@ -34,26 +35,24 @@ abstract class AbstractRequestSecurityTokenType extends AbstractWstElement /** * AbstractRequestSecurityTokenType constructor * - * @param string|null $context + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $context * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $context = null, + protected ?AnyURIValue $context = null, array $children = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($context, SchemaViolationException::class); - $this->setElements($children); $this->setAttributesNS($namespacedAttributes); } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getContext(): ?string + public function getContext(): ?AnyURIValue { return $this->context; } @@ -78,7 +77,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -87,7 +86,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - self::getOptionalAttribute($xml, 'Context'), + self::getOptionalAttribute($xml, 'Context', AnyURIValue::class), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -105,7 +104,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getContext() !== null) { - $e->setAttribute('Context', $this->getContext()); + $e->setAttribute('Context', $this->getContext()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php b/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php index 8166287b..d8af8b5d 100644 --- a/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php +++ b/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php @@ -4,16 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; /** * A RequestTypeOpenEnum element @@ -28,40 +20,5 @@ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200512\RequestTypeEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (RequestTypeEnum|string $v): string { - return ($v instanceof RequestTypeEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(StringValue::fromString(implode(' ', $values))); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIListValue::class; } diff --git a/src/XML/wst_200512/AbstractRequestedProofTokenType.php b/src/XML/wst_200512/AbstractRequestedProofTokenType.php index 22e19536..3aae090b 100644 --- a/src/XML/wst_200512/AbstractRequestedProofTokenType.php +++ b/src/XML/wst_200512/AbstractRequestedProofTokenType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the RequestedProofTokenType element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractRequestedReferenceType.php b/src/XML/wst_200512/AbstractRequestedReferenceType.php index e1c44e7c..9c148cbf 100644 --- a/src/XML/wst_200512/AbstractRequestedReferenceType.php +++ b/src/XML/wst_200512/AbstractRequestedReferenceType.php @@ -7,9 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsse\SecurityTokenReference; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use function array_pop; @@ -48,7 +48,7 @@ public function getSecurityTokenReference(): SecurityTokenReference * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php b/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php index 9e3f6432..c2cf80b5 100644 --- a/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php +++ b/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -46,7 +46,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractSignChallengeType.php b/src/XML/wst_200512/AbstractSignChallengeType.php index 87a29f2c..6f7dc759 100644 --- a/src/XML/wst_200512/AbstractSignChallengeType.php +++ b/src/XML/wst_200512/AbstractSignChallengeType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -80,7 +80,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php index c2f1a83b..08cd30fa 100644 --- a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php @@ -4,16 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; /** * A StatusCodeOpenEnum element @@ -27,40 +19,5 @@ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement use TypedTextContentTrait; /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200512\StatusCodeEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (StatusCodeEnum|string $v): string { - return ($v instanceof StatusCodeEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(implode(' ', $values)); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIListValue::class; } diff --git a/src/XML/wst_200512/AbstractStatusType.php b/src/XML/wst_200512/AbstractStatusType.php index c06f4129..9c2c72b3 100644 --- a/src/XML/wst_200512/AbstractStatusType.php +++ b/src/XML/wst_200512/AbstractStatusType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; /** * Class defining the StatusType element @@ -54,7 +54,7 @@ public function getReason(): ?Reason * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AbstractUseKeyType.php b/src/XML/wst_200512/AbstractUseKeyType.php index b9f4d83e..0e8dcb9e 100644 --- a/src/XML/wst_200512/AbstractUseKeyType.php +++ b/src/XML/wst_200512/AbstractUseKeyType.php @@ -6,12 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the UseKeyType element @@ -30,14 +31,12 @@ abstract class AbstractUseKeyType extends AbstractWstElement * AbstractUseKeyType constructor * * @param \SimpleSAML\XML\SerializableElementInterface|null $child - * @param string|null $Sig + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Sig */ final public function __construct( ?SerializableElementInterface $child = null, - protected ?string $Sig = null, + protected ?AnyURIValue $Sig = null, ) { - Assert::nullOrValidURI($Sig, SchemaViolationException::class); - if ($child !== null) { $this->setElements([$child]); } @@ -45,9 +44,9 @@ final public function __construct( /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getSig(): ?string + public function getSig(): ?AnyURIValue { return $this->Sig; } @@ -71,7 +70,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -84,7 +83,7 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($children), - self::getOptionalAttribute($xml, 'Sig', null), + self::getOptionalAttribute($xml, 'Sig', AnyURIValue::class, null), ); } @@ -100,7 +99,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::instantiateParentElement($parent); if ($this->getSig() !== null) { - $e->setAttribute('Sig', $this->getSig()); + $e->setAttribute('Sig', $this->getSig()->getValue()); } foreach ($this->getElements() as $child) { diff --git a/src/XML/wst_200512/AbstractValidateTargetType.php b/src/XML/wst_200512/AbstractValidateTargetType.php index 119cc7f1..8848c4a5 100644 --- a/src/XML/wst_200512/AbstractValidateTargetType.php +++ b/src/XML/wst_200512/AbstractValidateTargetType.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -46,7 +46,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/AllowPostdating.php b/src/XML/wst_200512/AllowPostdating.php index 3dae2d39..b435b431 100644 --- a/src/XML/wst_200512/AllowPostdating.php +++ b/src/XML/wst_200512/AllowPostdating.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * A AllowPostdating element @@ -24,7 +25,7 @@ final class AllowPostdating extends AbstractWstElement implements SchemaValidata * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/Delegatable.php b/src/XML/wst_200512/Delegatable.php index 6d1ecaa5..ef8fca01 100644 --- a/src/XML/wst_200512/Delegatable.php +++ b/src/XML/wst_200512/Delegatable.php @@ -7,6 +7,7 @@ use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; /** * A Delegatable element diff --git a/src/XML/wst_200512/RequestKET.php b/src/XML/wst_200512/RequestKET.php index ae46c4c2..228132f7 100644 --- a/src/XML/wst_200512/RequestKET.php +++ b/src/XML/wst_200512/RequestKET.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * A RequestKET element @@ -24,7 +25,7 @@ final class RequestKET extends AbstractWstElement implements SchemaValidatableEl * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wst_200512/RequestedTokenCancelled.php b/src/XML/wst_200512/RequestedTokenCancelled.php index a3b15d48..521933f7 100644 --- a/src/XML/wst_200512/RequestedTokenCancelled.php +++ b/src/XML/wst_200512/RequestedTokenCancelled.php @@ -6,8 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; /** * A RequestedTokenCancelled element @@ -24,7 +25,7 @@ final class RequestedTokenCancelled extends AbstractWstElement implements Schema * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static From 3ac2d74f65ece2f1b0c2ca00187a4ecfc53f4e3a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 1 Dec 2025 00:14:33 +0100 Subject: [PATCH 18/34] Migrate to xsd-types --- src/XML/wsse/AbstractAttributedString.php | 16 ++++++------ .../wsse/AbstractBinarySecurityTokenType.php | 25 ++++++++++--------- src/XML/wsse/AbstractEmbeddedType.php | 6 ++--- src/XML/wsse/AbstractEncodedString.php | 18 ++++++------- src/XML/wsse/AbstractKeyIdentifierType.php | 22 ++++++++-------- src/XML/wsse/AbstractPasswordString.php | 16 ++++++------ src/XML/wsse/AbstractReferenceType.php | 6 ++--- src/XML/wsse/AbstractSecurityHeaderType.php | 6 ++--- .../AbstractSecurityTokenReferenceType.php | 6 ++--- .../AbstractTransformationParametersType.php | 6 ++--- src/XML/wsse/AbstractUsernameTokenType.php | 10 ++++---- src/XML/wsse/UsageTrait.php | 2 +- 12 files changed, 70 insertions(+), 69 deletions(-) diff --git a/src/XML/wsse/AbstractAttributedString.php b/src/XML/wsse/AbstractAttributedString.php index be271e2c..67da032d 100644 --- a/src/XML/wsse/AbstractAttributedString.php +++ b/src/XML/wsse/AbstractAttributedString.php @@ -7,13 +7,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; -use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_unshift; @@ -41,7 +41,7 @@ abstract class AbstractAttributedString extends AbstractWsseElement * AbstractAttributedString constructor * * @param \SimpleSAML\XMLSchema\Type\StringValue $content - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( @@ -55,7 +55,7 @@ public function __construct( /** - * @return \SimpleSAML\XMLSchema\Type\IDValue|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ public function getId(): ?IDValue { @@ -69,7 +69,7 @@ public function getId(): ?IDValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -82,13 +82,13 @@ public static function fromXML(DOMElement $xml): static $Id = null; foreach ($nsAttributes as $i => $attr) { if ($attr->getNamespaceURI() === C::NS_SEC_UTIL && $attr->getAttrName() === 'Id') { - $Id = $attr->getAttrValue(); + $Id = IDValue::fromString($attr->getAttrValue()->getValue()); unset($nsAttributes[$i]); break; } } - return new static($xml->textContent, $Id, $nsAttributes); + return new static(StringValue::fromString($xml->textContent), $Id, $nsAttributes); } diff --git a/src/XML/wsse/AbstractBinarySecurityTokenType.php b/src/XML/wsse/AbstractBinarySecurityTokenType.php index 4b960cd9..b26a288b 100644 --- a/src/XML/wsse/AbstractBinarySecurityTokenType.php +++ b/src/XML/wsse/AbstractBinarySecurityTokenType.php @@ -7,11 +7,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the BinarySecurityTokenType element @@ -28,20 +29,20 @@ abstract class AbstractBinarySecurityTokenType extends AbstractEncodedString * AbstractBinarySecurityTokenType constructor * * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType - * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( StringValue $content, - protected ?AnyURIValue $valueType = null, ?IDValue $Id = null, - ?string $EncodingType = null, array $namespacedAttributes = [], + protected ?AnyURIValue $valueType = null, + ?AnyURIValue $EncodingType = null, ) { Assert::validBase64Binary($content->getValue()); - parent::__construct($content, $Id, $EncodingType, $namespacedAttributes); + parent::__construct($content, $Id, $namespacedAttributes, $EncodingType); } @@ -60,7 +61,7 @@ public function getValueType(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -73,7 +74,7 @@ public static function fromXML(DOMElement $xml): static $Id = null; foreach ($nsAttributes as $i => $attr) { if ($attr->getNamespaceURI() === C::NS_SEC_UTIL && $attr->getAttrName() === 'Id') { - $Id = $attr->getAttrValue(); + $Id = IDValue::fromString($attr->getAttrValue()->getValue()); unset($nsAttributes[$i]); break; } @@ -81,10 +82,10 @@ public static function fromXML(DOMElement $xml): static return new static( StringValue::fromString($xml->textContent), - self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), $Id, - self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), $nsAttributes, + self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), + self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), ); } diff --git a/src/XML/wsse/AbstractEmbeddedType.php b/src/XML/wsse/AbstractEmbeddedType.php index 7c7de5de..d011404a 100644 --- a/src/XML/wsse/AbstractEmbeddedType.php +++ b/src/XML/wsse/AbstractEmbeddedType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the EmbeddedType element @@ -75,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsse/AbstractEncodedString.php b/src/XML/wsse/AbstractEncodedString.php index 9adc7dc3..cbc20371 100644 --- a/src/XML/wsse/AbstractEncodedString.php +++ b/src/XML/wsse/AbstractEncodedString.php @@ -7,9 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\StringValue; /** @@ -25,15 +25,15 @@ abstract class AbstractEncodedString extends AbstractAttributedString * AbstractEncodedString constructor * * @param \SimpleSAML\XMLSchema\Type\StringValue $content - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id - * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType */ public function __construct( StringValue $content, ?IDValue $Id = null, - protected ?AnyURIValue $EncodingType = null, array $namespacedAttributes = [], + protected ?AnyURIValue $EncodingType = null, ) { parent::__construct($content, $Id, $namespacedAttributes); } @@ -54,7 +54,7 @@ public function getEncodingType(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -67,17 +67,17 @@ public static function fromXML(DOMElement $xml): static $Id = null; foreach ($nsAttributes as $i => $attr) { if ($attr->getNamespaceURI() === C::NS_SEC_UTIL && $attr->getAttrName() === 'Id') { - $Id = $attr->getAttrValue(); + $Id = IDValue::fromString($attr->getAttrValue()->getValue()); unset($nsAttributes[$i]); break; } } return new static( - $xml->textContent, + StringValue::fromString($xml->textContent), $Id, - self::getOptionalAttribute($xml, 'EncodingType', null), $nsAttributes, + self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), ); } diff --git a/src/XML/wsse/AbstractKeyIdentifierType.php b/src/XML/wsse/AbstractKeyIdentifierType.php index 045f940a..f16ccda8 100644 --- a/src/XML/wsse/AbstractKeyIdentifierType.php +++ b/src/XML/wsse/AbstractKeyIdentifierType.php @@ -7,9 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\StringValue; /** @@ -23,19 +23,19 @@ abstract class AbstractKeyIdentifierType extends AbstractEncodedString * AbstractKeyIdentifierType constructor * * @param \SimpleSAML\XMLSchema\Type\StringValue $content + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $valueType - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $EncodingType - * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( StringValue $content, - protected ?AnyURIValue $valueType = null, ?IDValue $Id = null, - ?AnyURIValue $EncodingType = null, array $namespacedAttributes = [], + protected ?AnyURIValue $valueType = null, + ?AnyURIValue $EncodingType = null, ) { - parent::__construct($content, $Id, $EncodingType, $namespacedAttributes); + parent::__construct($content, $Id, $namespacedAttributes, $EncodingType); } @@ -54,7 +54,7 @@ public function getValueType(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -67,7 +67,7 @@ public static function fromXML(DOMElement $xml): static $Id = null; foreach ($nsAttributes as $i => $attr) { if ($attr->getNamespaceURI() === C::NS_SEC_UTIL && $attr->getAttrName() === 'Id') { - $Id = $attr->getAttrValue(); + $Id = IDValue::fromString($attr->getAttrValue()->getValue()); unset($nsAttributes[$i]); break; } @@ -75,10 +75,10 @@ public static function fromXML(DOMElement $xml): static return new static( StringValue::fromString($xml->textContent), - self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), $Id, - self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), $nsAttributes, + self::getOptionalAttribute($xml, 'ValueType', AnyURIValue::class, null), + self::getOptionalAttribute($xml, 'EncodingType', AnyURIValue::class, null), ); } diff --git a/src/XML/wsse/AbstractPasswordString.php b/src/XML/wsse/AbstractPasswordString.php index fb46590b..9feddc71 100644 --- a/src/XML/wsse/AbstractPasswordString.php +++ b/src/XML/wsse/AbstractPasswordString.php @@ -7,9 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\StringValue; /** @@ -23,16 +23,16 @@ abstract class AbstractPasswordString extends AbstractAttributedString * AbstractPasswordString constructor * * @param \SimpleSAML\XMLSchema\Type\StringValue $content - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id - * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Type + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Type */ final public function __construct( #[\SensitiveParameter] StringValue $content, ?IDValue $Id = null, - protected ?AnyURIValue $Type = null, array $namespacedAttributes = [], + protected ?AnyURIValue $Type = null, ) { parent::__construct($content, $Id, $namespacedAttributes); } @@ -53,7 +53,7 @@ public function getType(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -66,7 +66,7 @@ public static function fromXML(DOMElement $xml): static $Id = null; foreach ($nsAttributes as $i => $attr) { if ($attr->getNamespaceURI() === C::NS_SEC_UTIL && $attr->getAttrName() === 'Id') { - $Id = $attr->getAttrValue(); + $Id = IDValue::fromString($attr->getAttrValue()->getValue()); unset($nsAttributes[$i]); break; } @@ -75,8 +75,8 @@ public static function fromXML(DOMElement $xml): static return new static( StringValue::fromString($xml->textContent), $Id, - self::getOptionalAttribute($xml, 'Type', AnyURIValue::class, null), $nsAttributes, + self::getOptionalAttribute($xml, 'Type', AnyURIValue::class, null), ); } diff --git a/src/XML/wsse/AbstractReferenceType.php b/src/XML/wsse/AbstractReferenceType.php index 2e6f6d31..9abdc8a6 100644 --- a/src/XML/wsse/AbstractReferenceType.php +++ b/src/XML/wsse/AbstractReferenceType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ReferenceType element @@ -65,7 +65,7 @@ public function getURI(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsse/AbstractSecurityHeaderType.php b/src/XML/wsse/AbstractSecurityHeaderType.php index 7072fa26..6de02d20 100644 --- a/src/XML/wsse/AbstractSecurityHeaderType.php +++ b/src/XML/wsse/AbstractSecurityHeaderType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the SecurityHeaderType element @@ -62,7 +62,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index d558abdf..d694c555 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -8,12 +8,12 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_unshift; @@ -90,7 +90,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsse/AbstractTransformationParametersType.php b/src/XML/wsse/AbstractTransformationParametersType.php index 078678a2..a8fcfb55 100644 --- a/src/XML/wsse/AbstractTransformationParametersType.php +++ b/src/XML/wsse/AbstractTransformationParametersType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the TransformationParametersType element @@ -61,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsse/AbstractUsernameTokenType.php b/src/XML/wsse/AbstractUsernameTokenType.php index 4ead4f88..22d6cb4b 100644 --- a/src/XML/wsse/AbstractUsernameTokenType.php +++ b/src/XML/wsse/AbstractUsernameTokenType.php @@ -8,13 +8,13 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XML\Attribute as XMLAttribute; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function array_unshift; @@ -90,7 +90,7 @@ public function getUsername(): Username * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsse/UsageTrait.php b/src/XML/wsse/UsageTrait.php index 18c68724..01a3a86d 100644 --- a/src/XML/wsse/UsageTrait.php +++ b/src/XML/wsse/UsageTrait.php @@ -12,7 +12,7 @@ trait UsageTrait { /** @var \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - protected ?string $usage; + protected ?AnyURIValue $usage; /** From dff51ef88e84ece507e4abe22ef7358675056c63 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 1 Dec 2025 17:59:25 +0100 Subject: [PATCH 19/34] Fix path to class registry --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index fe6a1cf9..4affc05c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -17,4 +17,4 @@ comment: github_checks: annotations: false ignore: - - 'src/XML/element.registry.php' + - 'classes/element.registry.php' From dfeb5a8e04c5dc4eee30b786d01927b3d8775a80 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 1 Dec 2025 23:19:16 +0100 Subject: [PATCH 20/34] Migrate to xsd-types --- src/XML/wsp/AbstractOperatorContentType.php | 6 +- src/XML/wsp/All.php | 3 +- src/XML/wsp/AppliesTo.php | 9 +-- src/XML/wsp/ExactlyOne.php | 3 +- src/XML/wsp/OptionalTrait.php | 1 + src/XML/wsp/Policy.php | 47 ++++++++-------- src/XML/wsp/PolicyAttachment.php | 13 +++-- src/XML/wsp/PolicyReference.php | 55 +++++++++---------- src/XML/wsp/PolicyURIsTrait.php | 11 ++-- .../XML/auth/AdditionalContextTest.php | 4 +- tests/WSSecurity/XML/auth/ClaimTypeTest.php | 6 +- .../XML/auth/ConstrainedManyValueTest.php | 2 +- .../XML/auth/ConstrainedSingleValueTest.php | 2 +- .../XML/auth/ConstrainedValueTest.php | 4 +- tests/WSSecurity/XML/auth/ContextItemTest.php | 4 +- tests/WSSecurity/XML/auth/DescriptionTest.php | 2 +- tests/WSSecurity/XML/auth/DisplayNameTest.php | 2 +- .../WSSecurity/XML/auth/DisplayValueTest.php | 2 +- .../XML/auth/StructuredValueTest.php | 2 +- .../XML/auth/ValueGreaterThanOrEqualTest.php | 2 +- .../XML/auth/ValueGreaterThanTest.php | 2 +- .../WSSecurity/XML/auth/ValueInRangenTest.php | 2 +- .../XML/auth/ValueLessThanOrEqualTest.php | 2 +- .../WSSecurity/XML/auth/ValueLessThanTest.php | 2 +- .../XML/auth/ValueLowerBoundTest.php | 2 +- .../ValueOneOfWithStructuredValuesTest.php | 2 +- .../XML/auth/ValueOneOfWithValuesTest.php | 2 +- tests/WSSecurity/XML/auth/ValueTest.php | 2 +- .../XML/auth/ValueUpperBoundTest.php | 2 +- tests/WSSecurity/XML/wsp/AppliesToTest.php | 12 +++- .../XML/wsp/PolicyAttachmentTest.php | 32 +++++++---- .../XML/wsp/PolicyReferenceTest.php | 11 ++-- tests/WSSecurity/XML/wsp/PolicyTest.php | 9 ++- tests/resources/xml/wsp_All.xml | 4 +- tests/resources/xml/wsp_AppliesTo.xml | 4 +- tests/resources/xml/wsp_ExactlyOne.xml | 4 +- tests/resources/xml/wsp_PolicyAttachment.xml | 4 +- 37 files changed, 153 insertions(+), 125 deletions(-) diff --git a/src/XML/wsp/AbstractOperatorContentType.php b/src/XML/wsp/AbstractOperatorContentType.php index 9370c16f..02927a7a 100644 --- a/src/XML/wsp/AbstractOperatorContentType.php +++ b/src/XML/wsp/AbstractOperatorContentType.php @@ -9,10 +9,10 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\Constants as C; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsp:OperatorContentType element. @@ -90,7 +90,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsp/All.php b/src/XML/wsp/All.php index 73a1aa30..61f79adc 100644 --- a/src/XML/wsp/All.php +++ b/src/XML/wsp/All.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsp; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the All element diff --git a/src/XML/wsp/AppliesTo.php b/src/XML/wsp/AppliesTo.php index e4de6627..e4eb99cb 100644 --- a/src/XML/wsp/AppliesTo.php +++ b/src/XML/wsp/AppliesTo.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing a wsp:AppliesTo element. @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsp/ExactlyOne.php b/src/XML/wsp/ExactlyOne.php index 01ca3f10..3ff406c1 100644 --- a/src/XML/wsp/ExactlyOne.php +++ b/src/XML/wsp/ExactlyOne.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsp; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the ExactlyOne element diff --git a/src/XML/wsp/OptionalTrait.php b/src/XML/wsp/OptionalTrait.php index b194a26e..f944b807 100644 --- a/src/XML/wsp/OptionalTrait.php +++ b/src/XML/wsp/OptionalTrait.php @@ -8,6 +8,7 @@ * Trait grouping common functionality for elements that can hold an Optional attribute. * * @package simplesamlphp/ws-security + * @phpstan-ignore trait.unused */ trait OptionalTrait { diff --git a/src/XML/wsp/Policy.php b/src/XML/wsp/Policy.php index 64efeb78..b9974c23 100644 --- a/src/XML/wsp/Policy.php +++ b/src/XML/wsp/Policy.php @@ -7,13 +7,15 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the Policy element @@ -32,27 +34,22 @@ final class Policy extends AbstractOperatorContentType implements SchemaValidata /** * Initialize a wsp:Policy * - * @param string|null $Name - * @param \SimpleSAML\XML\Attribute|null $Id * @param (\SimpleSAML\WSSecurity\XML\wsp\All| * \SimpleSAML\WSSecurity\XML\wsp\ExactlyOne| * \SimpleSAML\WSSecurity\XML\wsp\Policy| * \SimpleSAML\WSSecurity\XML\wsp\PolicyReference)[] $operatorContent - * @param \SimpleSAML\XML\Chunk[] $children + * @param \SimpleSAML\XML\SerializableElementInterface[] $children + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Name + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ public function __construct( - protected ?string $Name = null, - protected ?XMLAttribute $Id = null, array $operatorContent = [], array $children = [], + protected ?AnyURIValue $Name = null, + protected ?IDValue $Id = null, array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($Name, SchemaViolationException::class); - if ($Id !== null) { - Assert::validNCName($Id->getAttrValue(), SchemaViolationException::class); - } - $this->setAttributesNS($namespacedAttributes); parent::__construct($operatorContent, $children); @@ -60,18 +57,18 @@ public function __construct( /** - * @return \SimpleSAML\XML\Attribute|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ - public function getId(): ?XMLAttribute + public function getId(): ?IDValue { return $this->Id; } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getName(): ?string + public function getName(): ?AnyURIValue { return $this->Name; } @@ -97,7 +94,7 @@ final public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ #[\Override] @@ -108,7 +105,7 @@ public static function fromXML(DOMElement $xml): static $Id = null; if ($xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id')) { - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', $xml->getAttributeNS(C::NS_SEC_UTIL, 'Id')); + $Id = IDValue::fromString($xml->getAttributeNS(C::NS_SEC_UTIL, 'Id')); } $namespacedAttributes = self::getAttributesNSFromXML($xml); @@ -145,10 +142,10 @@ public static function fromXML(DOMElement $xml): static } return new static( - self::getOptionalAttribute($xml, 'Name', null), - $Id, $operatorContent, $children, + self::getOptionalAttribute($xml, 'Name', AnyURIValue::class, null), + $Id, $namespacedAttributes, ); } @@ -165,10 +162,10 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = parent::toXML($parent); if ($this->getName() !== null) { - $e->setAttribute('Name', $this->getName()); + $e->setAttribute('Name', $this->getName()->getValue()); } - $this->getId()?->toXML($e); + $this->getId()?->toAttribute()->toXML($e); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/wsp/PolicyAttachment.php b/src/XML/wsp/PolicyAttachment.php index d5f73c77..b32e2c10 100644 --- a/src/XML/wsp/PolicyAttachment.php +++ b/src/XML/wsp/PolicyAttachment.php @@ -9,13 +9,14 @@ use SimpleSAML\WSSecurity\XML\wsp\AppliesTo; use SimpleSAML\WSSecurity\XML\wsp\Policy; use SimpleSAML\WSSecurity\XML\wsp\PolicyReference; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_merge; @@ -84,7 +85,7 @@ public function getPolicies(): array * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsp/PolicyReference.php b/src/XML/wsp/PolicyReference.php index a2e737c8..69b2a35a 100644 --- a/src/XML/wsp/PolicyReference.php +++ b/src/XML/wsp/PolicyReference.php @@ -6,11 +6,14 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function str_replace; @@ -31,47 +34,43 @@ final class PolicyReference extends AbstractWspElement implements SchemaValidata /** * Initialize a wsp:PolicyReference * - * @param string $URI - * @param string|null $Digest - * @param string $DigestAlgorithm + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $URI + * @param \SimpleSAML\XMLSchema\Type\Base64BinaryValue|null $Digest + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $DigestAlgorithm * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ public function __construct( - protected string $URI, - protected ?string $Digest = null, - protected ?string $DigestAlgorithm = 'http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc', + protected AnyURIValue $URI, + protected ?Base64BinaryValue $Digest = null, + protected ?AnyURIValue $DigestAlgorithm = null, array $namespacedAttributes = [], ) { - Assert::validURI($URI, SchemaViolationException::class); - Assert::nullOrValidBase64($Digest, SchemaViolationException::class); - Assert::nullOrValidURI($DigestAlgorithm, SchemaViolationException::class); - $this->setAttributesNS($namespacedAttributes); } /** - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getURI(): string + public function getURI(): AnyURIValue { return $this->URI; } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\Base64BinaryValue|null */ - public function getDigest(): ?string + public function getDigest(): ?Base64BinaryValue { - return $this->Digest ? str_replace(["\f", "\r", "\n", "\t", "\v", ' '], '', $this->Digest) : null; + return $this->Digest; } /** - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getDigestAlgorithm(): ?string + public function getDigestAlgorithm(): ?AnyURIValue { return $this->DigestAlgorithm; } @@ -83,7 +82,7 @@ public function getDigestAlgorithm(): ?string * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -108,9 +107,9 @@ public static function fromXML(DOMElement $xml): static } return new static( - self::getAttribute($xml, 'URI'), - self::getOptionalAttribute($xml, 'Digest', null), - self::getOptionalAttribute($xml, 'DigestAlgorithm', null), + self::getAttribute($xml, 'URI', AnyURIValue::class), + self::getOptionalAttribute($xml, 'Digest', Base64BinaryValue::class, null), + self::getOptionalAttribute($xml, 'DigestAlgorithm', AnyURIValue::class, null), $namespacedAttributes, ); } @@ -125,14 +124,14 @@ public static function fromXML(DOMElement $xml): static public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->setAttribute('URI', $this->getURI()); + $e->setAttribute('URI', $this->getURI()->getValue()); if ($this->getDigest() !== null) { - $e->setAttribute('Digest', $this->getDigest()); + $e->setAttribute('Digest', $this->getDigest()->getValue()); } if ($this->getDigestAlgorithm() !== null) { - $e->setAttribute('DigestAlgorithm', $this->getDigestAlgorithm()); + $e->setAttribute('DigestAlgorithm', $this->getDigestAlgorithm()->getValue()); } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsp/PolicyURIsTrait.php b/src/XML/wsp/PolicyURIsTrait.php index 93b8f85b..7118f446 100644 --- a/src/XML/wsp/PolicyURIsTrait.php +++ b/src/XML/wsp/PolicyURIsTrait.php @@ -5,18 +5,21 @@ namespace SimpleSAML\WSSecurity\XML\wsp; use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * Trait grouping common functionality for elements that can hold a PolicyURIs attribute. * * @package simplesamlphp/ws-security + * @phpstan-ignore trait.unused */ trait PolicyURIsTrait { /** * The PolicyURIs. * - * @var string[] + * @var \SimpleSAML\XMLSchema\Type\AnyURIValue[] */ protected array $PolicyURIs; @@ -24,7 +27,7 @@ trait PolicyURIsTrait /** * Collect the value of the PolicyURIs-property * - * @return array + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue[] */ public function getPolicyURIs(): array { @@ -35,11 +38,11 @@ public function getPolicyURIs(): array /** * Set the value of the PolicyURIs-property * - * @param array $PolicyURIs + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue[] $PolicyURIs */ protected function setPolicyURIs(array $PolicyURIs): void { - Assert::allValidURI($PolicyURIs); + Assert::allIsInstanceOf($PolicyURIs, AnyURIValue::class, SchemaViolationException::class); $this->PolicyURIs = $PolicyURIs; } } diff --git a/tests/WSSecurity/XML/auth/AdditionalContextTest.php b/tests/WSSecurity/XML/auth/AdditionalContextTest.php index caff0be5..58a0cca0 100644 --- a/tests/WSSecurity/XML/auth/AdditionalContextTest.php +++ b/tests/WSSecurity/XML/auth/AdditionalContextTest.php @@ -18,8 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ClaimTypeTest.php b/tests/WSSecurity/XML/auth/ClaimTypeTest.php index 387ba585..186fcb91 100644 --- a/tests/WSSecurity/XML/auth/ClaimTypeTest.php +++ b/tests/WSSecurity/XML/auth/ClaimTypeTest.php @@ -20,9 +20,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\Type\BooleanValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php index 75e49353..a05e76c7 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php @@ -17,7 +17,7 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Tests for auth:ConstrainedManyValueType. diff --git a/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php index e1be7d20..3bf807c6 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php @@ -22,7 +22,7 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; /** * Tests for auth:ConstrainedSingleValueType. diff --git a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php index 14972b04..de897534 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php @@ -20,8 +20,8 @@ use SimpleSAML\XML\Attribute as XMLAttribute; //use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; -use SimpleSAML\XML\Type\BooleanValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ContextItemTest.php b/tests/WSSecurity/XML/auth/ContextItemTest.php index e2e041b5..10782caa 100644 --- a/tests/WSSecurity/XML/auth/ContextItemTest.php +++ b/tests/WSSecurity/XML/auth/ContextItemTest.php @@ -15,8 +15,8 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/DescriptionTest.php b/tests/WSSecurity/XML/auth/DescriptionTest.php index 6fd9754f..37ca5e4b 100644 --- a/tests/WSSecurity/XML/auth/DescriptionTest.php +++ b/tests/WSSecurity/XML/auth/DescriptionTest.php @@ -13,7 +13,7 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/DisplayNameTest.php b/tests/WSSecurity/XML/auth/DisplayNameTest.php index 4798cdcd..86790f1f 100644 --- a/tests/WSSecurity/XML/auth/DisplayNameTest.php +++ b/tests/WSSecurity/XML/auth/DisplayNameTest.php @@ -13,7 +13,7 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/DisplayValueTest.php b/tests/WSSecurity/XML/auth/DisplayValueTest.php index 08448d9c..9b25a476 100644 --- a/tests/WSSecurity/XML/auth/DisplayValueTest.php +++ b/tests/WSSecurity/XML/auth/DisplayValueTest.php @@ -13,7 +13,7 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/StructuredValueTest.php b/tests/WSSecurity/XML/auth/StructuredValueTest.php index ea934d31..7cc3cd38 100644 --- a/tests/WSSecurity/XML/auth/StructuredValueTest.php +++ b/tests/WSSecurity/XML/auth/StructuredValueTest.php @@ -14,7 +14,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php b/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php index 7d5c3667..2b67c0d9 100644 --- a/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php +++ b/tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php @@ -15,7 +15,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php b/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php index a05d57c9..81928f1c 100644 --- a/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php +++ b/tests/WSSecurity/XML/auth/ValueGreaterThanTest.php @@ -15,7 +15,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueInRangenTest.php b/tests/WSSecurity/XML/auth/ValueInRangenTest.php index 8ea52342..e672bb7d 100644 --- a/tests/WSSecurity/XML/auth/ValueInRangenTest.php +++ b/tests/WSSecurity/XML/auth/ValueInRangenTest.php @@ -18,7 +18,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php b/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php index 318d8d6e..c73a80df 100644 --- a/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php +++ b/tests/WSSecurity/XML/auth/ValueLessThanOrEqualTest.php @@ -15,7 +15,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueLessThanTest.php b/tests/WSSecurity/XML/auth/ValueLessThanTest.php index cb02472c..fa37ef76 100644 --- a/tests/WSSecurity/XML/auth/ValueLessThanTest.php +++ b/tests/WSSecurity/XML/auth/ValueLessThanTest.php @@ -15,7 +15,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php b/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php index 5962e209..8c3ecb13 100644 --- a/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php +++ b/tests/WSSecurity/XML/auth/ValueLowerBoundTest.php @@ -13,7 +13,7 @@ use SimpleSAML\WSSecurity\XML\auth\ValueLowerBound; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php b/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php index 2c4752a2..11054b8e 100644 --- a/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php +++ b/tests/WSSecurity/XML/auth/ValueOneOfWithStructuredValuesTest.php @@ -15,7 +15,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php b/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php index e62f8a2b..9a539f14 100644 --- a/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php +++ b/tests/WSSecurity/XML/auth/ValueOneOfWithValuesTest.php @@ -13,7 +13,7 @@ use SimpleSAML\WSSecurity\XML\auth\ValueOneOf; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueTest.php b/tests/WSSecurity/XML/auth/ValueTest.php index c5c8dd1c..a1f3217b 100644 --- a/tests/WSSecurity/XML/auth/ValueTest.php +++ b/tests/WSSecurity/XML/auth/ValueTest.php @@ -11,7 +11,7 @@ use SimpleSAML\WSSecurity\XML\auth\Value; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php b/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php index f9315568..543572ff 100644 --- a/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php +++ b/tests/WSSecurity/XML/auth/ValueUpperBoundTest.php @@ -15,7 +15,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/wsp/AppliesToTest.php b/tests/WSSecurity/XML/wsp/AppliesToTest.php index e3352a46..a0d0a5fe 100644 --- a/tests/WSSecurity/XML/wsp/AppliesToTest.php +++ b/tests/WSSecurity/XML/wsp/AppliesToTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -49,10 +51,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $domAttr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'value1'); + $domAttr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('value1')); $AppliesTo = new AppliesTo( - [new EndpointReference(new Address('http://www.fabrikam123.example.com/acct'))], + [ + new EndpointReference( + new Address( + AnyURIValue::fromString('http://www.fabrikam123.example.com/acct'), + ), + ), + ], [$domAttr], ); $this->assertFalse($AppliesTo->isEmptyElement()); diff --git a/tests/WSSecurity/XML/wsp/PolicyAttachmentTest.php b/tests/WSSecurity/XML/wsp/PolicyAttachmentTest.php index 75a2fecd..af36d626 100644 --- a/tests/WSSecurity/XML/wsp/PolicyAttachmentTest.php +++ b/tests/WSSecurity/XML/wsp/PolicyAttachmentTest.php @@ -17,11 +17,15 @@ use SimpleSAML\WSSecurity\XML\wsp\PolicyAttachment; use SimpleSAML\WSSecurity\XML\wsp\PolicyReference; use SimpleSAML\WSSecurity\XML\wsse\Security; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -60,11 +64,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr3', 'testval3'); - $attr4 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr4', 'testval4'); - $attr5 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr5', 'testval5'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr4', StringValue::fromString('testval4')); + $attr5 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr5', StringValue::fromString('testval5')); $some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -77,17 +81,23 @@ public function testMarshalling(): void )->documentElement); $appliesTo = new AppliesTo( - [new EndpointReference(new Address('http://www.fabrikam123.example.com/acct'))], + [ + new EndpointReference( + new Address( + AnyURIValue::fromString('http://www.fabrikam123.example.com/acct'), + ), + ), + ], [$attr2], ); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - $policy = new Policy('phpunit', $Id, [new ExactlyOne([])], [$other], [$attr3]); + $Id = IDValue::fromString('MyId'); + $policy = new Policy([new ExactlyOne([])], [$other], AnyURIValue::fromString('phpunit'), $Id, [$attr3]); $policyReference = new PolicyReference( - 'urn:x-simplesamlphp:phpunit', - '/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=', - 'http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc', + AnyURIValue::fromString('urn:x-simplesamlphp:phpunit'), + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + AnyURIValue::fromString('http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc'), [$attr4], ); diff --git a/tests/WSSecurity/XML/wsp/PolicyReferenceTest.php b/tests/WSSecurity/XML/wsp/PolicyReferenceTest.php index b7626da6..8f6dbe95 100644 --- a/tests/WSSecurity/XML/wsp/PolicyReferenceTest.php +++ b/tests/WSSecurity/XML/wsp/PolicyReferenceTest.php @@ -14,6 +14,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -52,12 +55,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $pr = new PolicyReference( - 'urn:x-simplesamlphp:phpunit', - '/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=', - 'http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc', + AnyURIValue::fromString('urn:x-simplesamlphp:phpunit'), + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + AnyURIValue::fromString('http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc'), [$attr], ); diff --git a/tests/WSSecurity/XML/wsp/PolicyTest.php b/tests/WSSecurity/XML/wsp/PolicyTest.php index a4bde4f4..f7e58dd0 100644 --- a/tests/WSSecurity/XML/wsp/PolicyTest.php +++ b/tests/WSSecurity/XML/wsp/PolicyTest.php @@ -12,11 +12,14 @@ use SimpleSAML\WSSecurity\XML\wsp\AbstractWspElement; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -56,13 +59,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - $policy = new Policy('phpunit', $Id, [new ExactlyOne([])], [$chunk], [$attr]); + $Id = IDValue::fromString('MyId'); + $policy = new Policy([new ExactlyOne([])], [$chunk], AnyURIValue::fromString('phpunit'), $Id, [$attr]); $this->assertFalse($policy->isEmptyElement()); diff --git a/tests/resources/xml/wsp_All.xml b/tests/resources/xml/wsp_All.xml index fe19ce60..0c0bbb80 100644 --- a/tests/resources/xml/wsp_All.xml +++ b/tests/resources/xml/wsp_All.xml @@ -1,4 +1,4 @@ - + - Some + Some diff --git a/tests/resources/xml/wsp_AppliesTo.xml b/tests/resources/xml/wsp_AppliesTo.xml index c4aef33b..ebbbf8fc 100644 --- a/tests/resources/xml/wsp_AppliesTo.xml +++ b/tests/resources/xml/wsp_AppliesTo.xml @@ -1,5 +1,5 @@ - - + + http://www.fabrikam123.example.com/acct diff --git a/tests/resources/xml/wsp_ExactlyOne.xml b/tests/resources/xml/wsp_ExactlyOne.xml index a4dcd8e1..9c6f5368 100644 --- a/tests/resources/xml/wsp_ExactlyOne.xml +++ b/tests/resources/xml/wsp_ExactlyOne.xml @@ -1,4 +1,4 @@ - + - Some + Some diff --git a/tests/resources/xml/wsp_PolicyAttachment.xml b/tests/resources/xml/wsp_PolicyAttachment.xml index 642fda22..8ecc70b7 100644 --- a/tests/resources/xml/wsp_PolicyAttachment.xml +++ b/tests/resources/xml/wsp_PolicyAttachment.xml @@ -1,4 +1,4 @@ - + http://www.fabrikam123.example.com/acct @@ -9,7 +9,7 @@ Other - + Security Some From df3e7c5d5b9c07ba705d318d156c59ddb1a8c27b Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 4 Dec 2025 23:29:30 +0100 Subject: [PATCH 21/34] Migrate to xsd-types --- src/XML/ReferenceIdentifierTrait.php | 18 +++++----- src/XML/auth/AbstractClaimType.php | 10 +++--- src/XML/auth/AbstractConstrainedValueType.php | 5 ++- src/XML/sp_200507/AbstractEmptyType.php | 4 +-- src/XML/sp_200507/AbstractHeaderType.php | 35 +++++++++---------- src/XML/sp_200507/AbstractHttpsTokenType.php | 22 +++++++----- src/XML/sp_200507/AbstractIssuedTokenType.php | 15 ++++---- .../sp_200507/AbstractNestedPolicyType.php | 6 ++-- .../sp_200507/AbstractQNameAssertionType.php | 6 ++-- ...stractRequestSecurityTokenTemplateType.php | 20 +++++------ src/XML/sp_200507/AbstractSePartsType.php | 8 ++--- .../AbstractSecureConversationTokenType.php | 11 +++--- src/XML/sp_200507/AbstractSerElementsType.php | 23 ++++++------ .../AbstractSpnegoContextTokenType.php | 12 +++---- .../sp_200507/AbstractTokenAssertionType.php | 6 ++-- src/XML/sp_200507/XPath.php | 2 +- src/XML/sp_200702/AbstractEmptyType.php | 4 +-- src/XML/sp_200702/AbstractHeaderType.php | 4 +-- src/XML/sp_200702/AbstractIssuedTokenType.php | 8 ++--- .../sp_200702/AbstractKeyValueTokenType.php | 4 +-- .../sp_200702/AbstractNestedPolicyType.php | 4 +-- .../sp_200702/AbstractQNameAssertionType.php | 4 +-- src/XML/sp_200702/AbstractReqPartsType.php | 6 ++-- ...stractRequestSecurityTokenTemplateType.php | 4 +-- src/XML/sp_200702/AbstractSePartsType.php | 6 ++-- .../AbstractSecureConversationTokenType.php | 4 +-- src/XML/sp_200702/AbstractSerElementsType.php | 11 +++--- .../AbstractSpnegoContextTokenType.php | 2 +- src/XML/sp_200702/IncludeTokenTypeTrait.php | 2 ++ src/XML/wsaw/AbstractAttributedQNameType.php | 2 +- src/XML/wsaw/AbstractServiceNameType.php | 5 ++- src/XML/wsaw/ActionTrait.php | 4 +-- src/XML/wsaw/Anonymous.php | 8 ++--- src/XML/wsaw/InterfaceName.php | 7 ++-- src/XML/wsaw/ServiceName.php | 10 +++--- src/XML/wsaw/UsingAddressing.php | 6 ++-- tests/WSSecurity/XML/wsaw/AnonymousTest.php | 3 +- .../WSSecurity/XML/wsaw/InterfaceNameTest.php | 3 +- tests/WSSecurity/XML/wsaw/ServiceNameTest.php | 6 ++-- .../XML/wsaw/UsingAddressingTest.php | 3 +- 40 files changed, 169 insertions(+), 154 deletions(-) diff --git a/src/XML/ReferenceIdentifierTrait.php b/src/XML/ReferenceIdentifierTrait.php index 5f7e049a..b61121af 100644 --- a/src/XML/ReferenceIdentifierTrait.php +++ b/src/XML/ReferenceIdentifierTrait.php @@ -4,33 +4,33 @@ namespace SimpleSAML\WSSecurity\XML; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * @package simplesamlphp/ws-security + * + * @phpstan-ignore trait.unused */ trait ReferenceIdentifierTrait { - /** @var string */ - protected string $refId; + /** @var \SimpleSAML\XMLSchema\Type\AnyURIValue */ + protected AnyURIValue $refId; /** - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getRefId(): string + public function getRefId(): AnyURIValue { return $this->refId; } /** - * @param string $refId + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $refId */ - private function setRefId(string $refId): void + private function setRefId(AnyURIValue $refId): void { - Assert::validURI($refId, SchemaViolationException::class); $this->refId = $refId; } } diff --git a/src/XML/auth/AbstractClaimType.php b/src/XML/auth/AbstractClaimType.php index 74421a7f..2f4c397f 100644 --- a/src/XML/auth/AbstractClaimType.php +++ b/src/XML/auth/AbstractClaimType.php @@ -13,6 +13,7 @@ use SimpleSAML\WSSecurity\XML\auth\EncryptedValue; use SimpleSAML\WSSecurity\XML\auth\StructuredValue; use SimpleSAML\WSSecurity\XML\auth\Value; +use SimpleSAML\XML\Chunk; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; @@ -22,7 +23,6 @@ use SimpleSAML\XMLSchema\Type\BooleanValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use function array_filter; use function array_merge; use function array_pop; use function var_export; @@ -78,8 +78,8 @@ final public function __construct( $value instanceof StructuredValue || $value instanceof EncryptedValue) ) { - /** @psalm-var \SimpleSAML\XML\AbstractElement|\SimpleSAML\XML\Chunk $value */ - Assert::notSame($value->getNamespaceURI(), static::NS); + /** @var \SimpleSAML\XML\Chunk|\SimpleSAML\XML\AbstractElement $value */ + Assert::notSame($value instanceof Chunk ? $value->getNamespaceURI() : $value::getNamespaceURI(), static::NS); } $this->setAttributesNS($namespacedAttributes); } @@ -187,13 +187,13 @@ public static function fromXML(DOMElement $xml): static $constrainedValue = ConstrainedValue::getChildrenOfClass($xml); $otherValue = self::getChildElementsFromXML($xml); - $value = array_filter(array_merge( + $value = array_merge( $simpleValue, $structuredValue, $encryptedValue, $constrainedValue, $otherValue, - )); + ); Assert::maxCount($value, 1, TooManyElementsException::class); return new static( diff --git a/src/XML/auth/AbstractConstrainedValueType.php b/src/XML/auth/AbstractConstrainedValueType.php index 40916fce..b852502f 100644 --- a/src/XML/auth/AbstractConstrainedValueType.php +++ b/src/XML/auth/AbstractConstrainedValueType.php @@ -13,7 +13,6 @@ use SimpleSAML\XMLSchema\Type\BooleanValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use function array_filter; use function array_merge; use function array_pop; use function var_export; @@ -104,14 +103,14 @@ public static function fromXML(DOMElement $xml): static $valueInRangen = ValueInRangen::getChildrenOfClass($xml); $valueOneOf = ValueOneOf::getChildrenOfClass($xml); - $value = array_filter(array_merge( + $value = array_merge( $valueLessThan, $valueLessThanOrEqual, $valueGreaterThan, $valueGreaterThanOrEqual, $valueInRangen, $valueOneOf, - )); + ); Assert::minCount($value, 1, MissingElementException::class); Assert::maxCount($value, 1, TooManyElementsException::class); diff --git a/src/XML/sp_200507/AbstractEmptyType.php b/src/XML/sp_200507/AbstractEmptyType.php index 9dd84312..71a0c3bc 100644 --- a/src/XML/sp_200507/AbstractEmptyType.php +++ b/src/XML/sp_200507/AbstractEmptyType.php @@ -6,7 +6,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use function sprintf; @@ -33,7 +33,7 @@ final public function __construct() * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200507/AbstractHeaderType.php b/src/XML/sp_200507/AbstractHeaderType.php index 2bea742b..74b4611d 100644 --- a/src/XML/sp_200507/AbstractHeaderType.php +++ b/src/XML/sp_200507/AbstractHeaderType.php @@ -6,9 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; use function sprintf; @@ -28,18 +30,15 @@ abstract class AbstractHeaderType extends AbstractSpElement /** * AbstractHeaderType constructor. * - * @param string $namespace - * @param string|null $name + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $namespace + * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $name * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected string $namespace, - protected ?string $name = null, + protected AnyURIValue $namespace, + protected ?QNameValue $name = null, array $namespacedAttributes = [], ) { - Assert::validURI($namespace); - Assert::nullOrValidQName($name); - $this->setAttributesNS($namespacedAttributes); } @@ -47,9 +46,9 @@ final public function __construct( /** * Collect the value of the Name property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\QNameValue|null */ - public function getName(): ?string + public function getName(): ?QNameValue { return $this->name; } @@ -58,9 +57,9 @@ public function getName(): ?string /** * Collect the value of the Namespace property. * - * @return string + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ - public function getNamespace(): string + public function getNamespace(): AnyURIValue { return $this->namespace; } @@ -74,7 +73,7 @@ public function getNamespace(): string * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -97,8 +96,8 @@ public static function fromXML(DOMElement $xml): static } return new static( - self::getAttribute($xml, 'Namespace'), - self::getOptionalAttribute($xml, 'Name', null), + self::getAttribute($xml, 'Namespace', AnyURIValue::class), + self::getOptionalAttribute($xml, 'Name', QNameValue::class, null), $namespacedAttributes, ); } @@ -115,10 +114,10 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getName() !== null) { - $e->setAttribute('Name', $this->getName()); + $e->setAttribute('Name', $this->getName()->getValue()); } - $e->setAttribute('Namespace', $this->getNamespace()); + $e->setAttribute('Namespace', $this->getNamespace()->getValue()); foreach ($this->getAttributesNS() as $attr) { $attr->toXML($e); diff --git a/src/XML/sp_200507/AbstractHttpsTokenType.php b/src/XML/sp_200507/AbstractHttpsTokenType.php index 304a957f..87e629ce 100644 --- a/src/XML/sp_200507/AbstractHttpsTokenType.php +++ b/src/XML/sp_200507/AbstractHttpsTokenType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -38,12 +39,12 @@ abstract class AbstractHttpsTokenType extends AbstractSpElement /** * HttpsTokenType constructor. * - * @param bool $requireClientCertificate + * @param \SimpleSAML\XMLSchema\Type\BooleanValue $requireClientCertificate * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected bool $requireClientCertificate, + protected BooleanValue $requireClientCertificate, array $elts = [], array $namespacedAttributes = [], ) { @@ -54,8 +55,10 @@ final public function __construct( /** * Get the value of the RequireClientCertificate-attribute + * + * @return \SimpleSAML\XMLSchema\Type\BooleanValue */ - public function getRequireClientCertificate(): bool + public function getRequireClientCertificate(): BooleanValue { return $this->requireClientCertificate; } @@ -67,7 +70,7 @@ public function getRequireClientCertificate(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -81,7 +84,7 @@ public static function fromXML(DOMElement $xml): static ); return new static( - self::getBooleanAttribute($xml, 'RequireClientCertificate'), + self::getAttribute($xml, 'RequireClientCertificate', BooleanValue::class), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -98,7 +101,10 @@ public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->setAttribute('RequireClientCertificate', $this->getRequireClientCertificate() ? 'true' : 'false'); + $e->setAttribute( + 'RequireClientCertificate', + $this->getRequireClientCertificate()->toBoolean() ? 'true' : 'false', + ); foreach ($this->getElements() as $elt) { $elt->toXML($e); diff --git a/src/XML/sp_200507/AbstractIssuedTokenType.php b/src/XML/sp_200507/AbstractIssuedTokenType.php index decb0316..6ad78faa 100644 --- a/src/XML/sp_200507/AbstractIssuedTokenType.php +++ b/src/XML/sp_200507/AbstractIssuedTokenType.php @@ -6,12 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use ValueError; use function array_pop; @@ -93,7 +94,7 @@ public function getRequestSecurityTokenTemplate(): RequestSecurityTokenTemplate * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -112,9 +113,9 @@ public static function fromXML(DOMElement $xml): static Assert::minCount($requestSecurityTokenTemplate, 1, MissingElementException::class); Assert::maxCount($requestSecurityTokenTemplate, 1, TooManyElementsException::class); - $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', StringValue::class, null); try { - $includeToken = IncludeToken::from($includeToken); + $includeToken = IncludeToken::from($includeToken->getValue()); } catch (ValueError) { } diff --git a/src/XML/sp_200507/AbstractNestedPolicyType.php b/src/XML/sp_200507/AbstractNestedPolicyType.php index 15588da5..fd9bc97a 100644 --- a/src/XML/sp_200507/AbstractNestedPolicyType.php +++ b/src/XML/sp_200507/AbstractNestedPolicyType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class representing sp:NestedPolicyType @@ -49,7 +49,7 @@ final public function __construct( * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200507/AbstractQNameAssertionType.php b/src/XML/sp_200507/AbstractQNameAssertionType.php index e85200ee..ca6db389 100644 --- a/src/XML/sp_200507/AbstractQNameAssertionType.php +++ b/src/XML/sp_200507/AbstractQNameAssertionType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -45,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php index 3cba15e5..27f3b2fb 100644 --- a/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function sprintf; @@ -38,12 +39,12 @@ abstract class AbstractRequestSecurityTokenTemplateType extends AbstractSpElemen /** * AbstractRequestSecurityTokenTemplateType constructor. * - * @param string|null $trustVersion + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $trustVersion * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( - protected ?string $trustVersion = null, + protected ?AnyURIValue $trustVersion = null, array $elts = [], array $namespacedAttributes = [], ) { @@ -57,9 +58,9 @@ final public function __construct( /** * Collect the value of the trustVersion property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getTrustVersion(): ?string + public function getTrustVersion(): ?AnyURIValue { return $this->trustVersion; } @@ -84,7 +85,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -102,7 +103,7 @@ public static function fromXML(DOMElement $xml): static ); return new static( - self::getOptionalAttribute($xml, 'TrustVersion', null), + self::getOptionalAttribute($xml, 'TrustVersion', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -120,11 +121,10 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getTrustVersion() !== null) { - $e->setAttribute('TrustVersion', $this->getTrustVersion()); + $e->setAttribute('TrustVersion', $this->getTrustVersion()->getValue()); } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200507/AbstractSePartsType.php b/src/XML/sp_200507/AbstractSePartsType.php index 24bdbda5..ab3f3799 100644 --- a/src/XML/sp_200507/AbstractSePartsType.php +++ b/src/XML/sp_200507/AbstractSePartsType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; use function sprintf; @@ -95,7 +95,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200507/AbstractSecureConversationTokenType.php b/src/XML/sp_200507/AbstractSecureConversationTokenType.php index 8a5944ca..5b11de02 100644 --- a/src/XML/sp_200507/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200507/AbstractSecureConversationTokenType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use ValueError; use function array_pop; @@ -92,7 +93,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -107,9 +108,9 @@ public static function fromXML(DOMElement $xml): static $issuer = Issuer::getChildrenOfClass($xml); - $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', StringValue::class, null); try { - $includeToken = IncludeToken::from($includeToken); + $includeToken = IncludeToken::from($includeToken->getValue()); } catch (ValueError) { } diff --git a/src/XML/sp_200507/AbstractSerElementsType.php b/src/XML/sp_200507/AbstractSerElementsType.php index 54ab0ca1..26a99264 100644 --- a/src/XML/sp_200507/AbstractSerElementsType.php +++ b/src/XML/sp_200507/AbstractSerElementsType.php @@ -6,11 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function sprintf; @@ -40,18 +41,17 @@ abstract class AbstractSerElementsType extends AbstractSpElement * AbstractSerElementsType constructor. * * @param list<\SimpleSAML\WSSecurity\XML\sp_200507\XPath> $xpath - * @param string|null $xpathVersion + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $xpathVersion * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $xpath, - protected ?string $xpathVersion = null, + protected ?AnyURIValue $xpathVersion = null, array $elts = [], array $namespacedAttributes = [], ) { Assert::minCount($xpath, 1, SchemaViolationException::class); - Assert::nullOrValidURI($xpathVersion); $this->setElements($elts); $this->setAttributesNS($namespacedAttributes); @@ -72,9 +72,9 @@ public function getXPath(): array /** * Collect the value of the XPathVersion property. * - * @return string|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getXPathVersion(): ?string + public function getXPathVersion(): ?AnyURIValue { return $this->xpathVersion; } @@ -88,7 +88,7 @@ public function getXPathVersion(): ?string * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -103,7 +103,7 @@ public static function fromXML(DOMElement $xml): static return new static( XPath::getChildrenOfClass($xml), - self::getOptionalAttribute($xml, 'XPathVersion', null), + self::getOptionalAttribute($xml, 'XPathVersion', AnyURIValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -121,7 +121,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getXPathVersion() !== null) { - $e->setAttribute('XPathVersion', $this->getXPathVersion()); + $e->setAttribute('XPathVersion', $this->getXPathVersion()->getValue()); } foreach ($this->getXPath() as $xpath) { @@ -129,7 +129,6 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php index 84ca9d95..13d6f492 100644 --- a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use ValueError; use function array_pop; @@ -92,7 +93,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -107,9 +108,9 @@ public static function fromXML(DOMElement $xml): static $issuer = Issuer::getChildrenOfClass($xml); - $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', StringValue::class, null); try { - $includeToken = IncludeToken::from($includeToken); + $includeToken = IncludeToken::from($includeToken->getValue()); } catch (ValueError) { } @@ -144,7 +145,6 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200507/AbstractTokenAssertionType.php b/src/XML/sp_200507/AbstractTokenAssertionType.php index b6564da5..8e1a4a74 100644 --- a/src/XML/sp_200507/AbstractTokenAssertionType.php +++ b/src/XML/sp_200507/AbstractTokenAssertionType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -65,7 +65,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200507/XPath.php b/src/XML/sp_200507/XPath.php index 86347d2b..b726d2c3 100644 --- a/src/XML/sp_200507/XPath.php +++ b/src/XML/sp_200507/XPath.php @@ -28,7 +28,7 @@ final class XPath extends AbstractSpElement * Validate the content of the element. * * @param string $content The value to go in the XML textContent - * @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure + * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure * @return void */ protected function validateContent(string $content): void diff --git a/src/XML/sp_200702/AbstractEmptyType.php b/src/XML/sp_200702/AbstractEmptyType.php index 5b1f8b43..4e674979 100644 --- a/src/XML/sp_200702/AbstractEmptyType.php +++ b/src/XML/sp_200702/AbstractEmptyType.php @@ -6,7 +6,7 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use function sprintf; @@ -33,7 +33,7 @@ final public function __construct() * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractHeaderType.php b/src/XML/sp_200702/AbstractHeaderType.php index 6c37828f..e37313b7 100644 --- a/src/XML/sp_200702/AbstractHeaderType.php +++ b/src/XML/sp_200702/AbstractHeaderType.php @@ -6,8 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -79,7 +79,7 @@ public function getNamespace(): AnyURIValue * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractIssuedTokenType.php b/src/XML/sp_200702/AbstractIssuedTokenType.php index 22265bc3..4b117229 100644 --- a/src/XML/sp_200702/AbstractIssuedTokenType.php +++ b/src/XML/sp_200702/AbstractIssuedTokenType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\MissingElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -82,7 +82,7 @@ public function getRequestSecurityTokenTemplate(): RequestSecurityTokenTemplate * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractKeyValueTokenType.php b/src/XML/sp_200702/AbstractKeyValueTokenType.php index 31db30e7..e583d255 100644 --- a/src/XML/sp_200702/AbstractKeyValueTokenType.php +++ b/src/XML/sp_200702/AbstractKeyValueTokenType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -65,7 +65,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractNestedPolicyType.php b/src/XML/sp_200702/AbstractNestedPolicyType.php index a266e93a..ff113a19 100644 --- a/src/XML/sp_200702/AbstractNestedPolicyType.php +++ b/src/XML/sp_200702/AbstractNestedPolicyType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; /** @@ -60,7 +60,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractQNameAssertionType.php b/src/XML/sp_200702/AbstractQNameAssertionType.php index 5bffd300..99c1883d 100644 --- a/src/XML/sp_200702/AbstractQNameAssertionType.php +++ b/src/XML/sp_200702/AbstractQNameAssertionType.php @@ -6,8 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -45,7 +45,7 @@ final public function __construct( * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractReqPartsType.php b/src/XML/sp_200702/AbstractReqPartsType.php index fff25620..c7ae9940 100644 --- a/src/XML/sp_200702/AbstractReqPartsType.php +++ b/src/XML/sp_200702/AbstractReqPartsType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -80,7 +80,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php index 5606d75c..923fe501 100644 --- a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -85,7 +85,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractSePartsType.php b/src/XML/sp_200702/AbstractSePartsType.php index 8fad2b6a..5d90f872 100644 --- a/src/XML/sp_200702/AbstractSePartsType.php +++ b/src/XML/sp_200702/AbstractSePartsType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -109,7 +109,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractSecureConversationTokenType.php b/src/XML/sp_200702/AbstractSecureConversationTokenType.php index d314e08c..2846f88f 100644 --- a/src/XML/sp_200702/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200702/AbstractSecureConversationTokenType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -80,7 +80,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/sp_200702/AbstractSerElementsType.php b/src/XML/sp_200702/AbstractSerElementsType.php index fcc81f66..ba2378bd 100644 --- a/src/XML/sp_200702/AbstractSerElementsType.php +++ b/src/XML/sp_200702/AbstractSerElementsType.php @@ -6,10 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -88,7 +88,7 @@ public function getXPathVersion(): ?AnyURIValue * @param \DOMElement $xml The XML element we should load. * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -103,7 +103,9 @@ public static function fromXML(DOMElement $xml): static return new static( XPath::getChildrenOfClass($xml), - $xml->hasAttributeNS(self::NS, 'XPathVersion') ? $xml->getAttributeNS(self::NS, 'XPathVersion', AnyURIValue) : null, + $xml->hasAttributeNS(self::NS, 'XPathVersion') + ? AnyURIValue::fromString($xml->getAttributeNS(self::NS, 'XPathVersion')) + : null, self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -129,7 +131,6 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php index 26e04a62..6fcb08dc 100644 --- a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; diff --git a/src/XML/sp_200702/IncludeTokenTypeTrait.php b/src/XML/sp_200702/IncludeTokenTypeTrait.php index be22e919..b9bc61f8 100644 --- a/src/XML/sp_200702/IncludeTokenTypeTrait.php +++ b/src/XML/sp_200702/IncludeTokenTypeTrait.php @@ -12,6 +12,8 @@ * Trait grouping common functionality for elements that can hold IncludeToken attributes. * * @package simplesamlphp/ws-security + * + * @phpstan-ignore trait.unused */ trait IncludeTokenTypeTrait { diff --git a/src/XML/wsaw/AbstractAttributedQNameType.php b/src/XML/wsaw/AbstractAttributedQNameType.php index c59ebfff..1e4f8717 100644 --- a/src/XML/wsaw/AbstractAttributedQNameType.php +++ b/src/XML/wsaw/AbstractAttributedQNameType.php @@ -7,7 +7,7 @@ use DOMElement; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Type\QNameValue; /** diff --git a/src/XML/wsaw/AbstractServiceNameType.php b/src/XML/wsaw/AbstractServiceNameType.php index 3e9d99ea..aaeff1e6 100644 --- a/src/XML/wsaw/AbstractServiceNameType.php +++ b/src/XML/wsaw/AbstractServiceNameType.php @@ -6,12 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Abstract class defining the ServiceNameType type @@ -39,7 +38,7 @@ abstract class AbstractServiceNameType extends AbstractWsawElement */ public function __construct( QNameValue $value, - protected ?string $endpointName = null, + protected ?NCNameValue $endpointName = null, array $namespacedAttributes = [], ) { $this->setContent($value); diff --git a/src/XML/wsaw/ActionTrait.php b/src/XML/wsaw/ActionTrait.php index b5fdab21..73a115d4 100644 --- a/src/XML/wsaw/ActionTrait.php +++ b/src/XML/wsaw/ActionTrait.php @@ -5,13 +5,14 @@ namespace SimpleSAML\WSSecurity\XML\wsaw; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * Trait adding methods to handle elements that define the action-attribute. * * @package simplesamlphp/ws-security + * + * @phpstan-ignore trait.unused */ trait ActionTrait { @@ -36,7 +37,6 @@ public function getAction(): ?AnyURIValue * Set the value of the action property. * * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $action - * @throws \SimpleSAML\XML\Exception\SchemViolationException */ protected function setAction(?AnyURIValue $action): void { diff --git a/src/XML/wsaw/Anonymous.php b/src/XML/wsaw/Anonymous.php index c37e696c..5d9dbc58 100644 --- a/src/XML/wsaw/Anonymous.php +++ b/src/XML/wsaw/Anonymous.php @@ -6,12 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\XML\Constants\NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use ValueError; use function sprintf; @@ -51,7 +51,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/wsaw/InterfaceName.php b/src/XML/wsaw/InterfaceName.php index 625d710d..963e6256 100644 --- a/src/XML/wsaw/InterfaceName.php +++ b/src/XML/wsaw/InterfaceName.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * Class defining the InterfaceName element @@ -25,7 +26,7 @@ final class InterfaceName extends AbstractAttributedQNameType implements SchemaV * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -34,7 +35,7 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, + QNameValue::fromDocument($xml->textContent, $xml), self::getAttributesNSFromXML($xml), ); } diff --git a/src/XML/wsaw/ServiceName.php b/src/XML/wsaw/ServiceName.php index abc470e1..b50c3ae0 100644 --- a/src/XML/wsaw/ServiceName.php +++ b/src/XML/wsaw/ServiceName.php @@ -6,9 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * Class defining the ServiceName element @@ -25,7 +27,7 @@ final class ServiceName extends AbstractServiceNameType implements SchemaValidat * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -34,8 +36,8 @@ public static function fromXML(DOMElement $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - $xml->textContent, - self::getOptionalAttribute($xml, 'EndpointName', null), + QNameValue::fromDocument($xml->textContent, $xml), + self::getOptionalAttribute($xml, 'EndpointName', NCNameValue::class, null), self::getAttributesNSFromXML($xml), ); } diff --git a/src/XML/wsaw/UsingAddressing.php b/src/XML/wsaw/UsingAddressing.php index a673d82c..090bf223 100644 --- a/src/XML/wsaw/UsingAddressing.php +++ b/src/XML/wsaw/UsingAddressing.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the UsingAddressing element @@ -44,7 +44,7 @@ final public function __construct( * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/tests/WSSecurity/XML/wsaw/AnonymousTest.php b/tests/WSSecurity/XML/wsaw/AnonymousTest.php index 65655549..fb9965cd 100644 --- a/tests/WSSecurity/XML/wsaw/AnonymousTest.php +++ b/tests/WSSecurity/XML/wsaw/AnonymousTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -55,7 +56,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $anonymous = new Anonymous(AnonymousEnum::Prohibited, [$attr]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php b/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php index 1f0129ce..13f920eb 100644 --- a/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php +++ b/tests/WSSecurity/XML/wsaw/InterfaceNameTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $interfaceName = new InterfaceName( QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr], diff --git a/tests/WSSecurity/XML/wsaw/ServiceNameTest.php b/tests/WSSecurity/XML/wsaw/ServiceNameTest.php index 84dbfa5d..b01d6985 100644 --- a/tests/WSSecurity/XML/wsaw/ServiceNameTest.php +++ b/tests/WSSecurity/XML/wsaw/ServiceNameTest.php @@ -15,7 +15,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,10 +56,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $serviceName = new ServiceName( QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), - 'PHPUnit', + NCNameValue::fromString('PHPUnit'), [$attr], ); diff --git a/tests/WSSecurity/XML/wsaw/UsingAddressingTest.php b/tests/WSSecurity/XML/wsaw/UsingAddressingTest.php index bd964cda..6a580529 100644 --- a/tests/WSSecurity/XML/wsaw/UsingAddressingTest.php +++ b/tests/WSSecurity/XML/wsaw/UsingAddressingTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $usingAddressing = new UsingAddressing([$attr]); $this->assertEquals( From 0bf3e53e06f175ae6ae0afc5d1ae99e820c4c1a3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 6 Dec 2025 13:00:07 +0100 Subject: [PATCH 22/34] Migrate to xsd-types --- .../fed/AbstractApplicationServiceType.php | 30 ++++++++++++------- src/XML/fed/AbstractAssertionType.php | 10 +++---- .../fed/AbstractAttributeExtensibleString.php | 11 +++---- .../fed/AbstractAttributeExtensibleURI.php | 8 ++--- src/XML/fed/AbstractAttributeServiceType.php | 27 +++++++++++------ src/XML/fed/AbstractClaimDialectType.php | 16 +++++----- .../fed/AbstractClaimDialectsOfferedType.php | 8 +++-- src/XML/fed/AbstractClaimTypesOfferedType.php | 8 +++-- .../fed/AbstractClaimTypesRequestedType.php | 8 +++-- src/XML/fed/AbstractClientPseudonymType.php | 10 ++++--- src/XML/fed/AbstractEndpointType.php | 5 ++-- .../AbstractFederationMetadataHandlerType.php | 6 ++-- .../fed/AbstractFederationMetadataType.php | 9 +++--- src/XML/fed/AbstractFederationType.php | 16 +++++----- src/XML/fed/AbstractFilterPseudonymsType.php | 10 ++++--- src/XML/fed/AbstractFreshnessType.php | 19 +++++++----- src/XML/fed/AbstractIssuerNameType.php | 13 ++++---- ...AbstractLogicalServiceNamesOfferedType.php | 9 +++--- src/XML/fed/AbstractPseudonymServiceType.php | 6 ++-- .../fed/AbstractSecurityTokenServiceType.php | 6 ++-- .../fed/AbstractWebServiceDescriptorType.php | 6 ++-- src/XML/fed/SecurityTokenServiceType.php | 4 +-- 22 files changed, 143 insertions(+), 102 deletions(-) diff --git a/src/XML/fed/AbstractApplicationServiceType.php b/src/XML/fed/AbstractApplicationServiceType.php index d502c00d..06120a81 100644 --- a/src/XML/fed/AbstractApplicationServiceType.php +++ b/src/XML/fed/AbstractApplicationServiceType.php @@ -5,12 +5,20 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; -use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLDateTimeValue; +use SimpleSAML\SAML2\Type\SAMLStringValue; +use SimpleSAML\SAML2\XML\md\Extensions; +use SimpleSAML\SAML2\XML\md\Organization; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; -use SimpleSAML\XML\Type\{AnyURIValue, DurationValue, IDValue}; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\DurationValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * A ApplicationServiceType @@ -32,10 +40,11 @@ abstract class AbstractApplicationServiceType extends AbstractWebServiceDescript /** * ApplicationServiceType constructor. * - * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. - * @param \SimpleSAML\SAML2\Type\DateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi-type of the element + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration A set of URI specifying the protocols supported. + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. @@ -59,7 +68,8 @@ abstract class AbstractApplicationServiceType extends AbstractWebServiceDescript * @param \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] $passiveRequestorEndpoint */ final public function __construct( - array $protocolSupportEnumeration, + QNameValue $type, + SAMLAnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, @@ -100,7 +110,7 @@ final public function __construct( ); parent::__construct( - static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME, + $type, $protocolSupportEnumeration, $ID, $validUntil, diff --git a/src/XML/fed/AbstractAssertionType.php b/src/XML/fed/AbstractAssertionType.php index b54bc60b..1910301f 100644 --- a/src/XML/fed/AbstractAssertionType.php +++ b/src/XML/fed/AbstractAssertionType.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the AssertionType element @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static @@ -89,7 +90,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractAttributeExtensibleString.php b/src/XML/fed/AbstractAttributeExtensibleString.php index 19dea568..08082629 100644 --- a/src/XML/fed/AbstractAttributeExtensibleString.php +++ b/src/XML/fed/AbstractAttributeExtensibleString.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; -use SimpleSAML\XML\Type\StringValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * An AbstractAttributeExtensibleString element @@ -29,7 +30,7 @@ abstract class AbstractAttributeExtensibleString extends AbstractFedElement /** - * @param \SimpleSAML\XML\Type\StringValue $content + * @param \SimpleSAML\XMLSchema\Type\StringValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ final public function __construct(StringValue $content, array $namespacedAttributes = []) diff --git a/src/XML/fed/AbstractAttributeExtensibleURI.php b/src/XML/fed/AbstractAttributeExtensibleURI.php index be88d681..82781f6b 100644 --- a/src/XML/fed/AbstractAttributeExtensibleURI.php +++ b/src/XML/fed/AbstractAttributeExtensibleURI.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\Type\AnyURIValue; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * An AbstractAttributeExtensibleURI element @@ -30,7 +30,7 @@ abstract class AbstractAttributeExtensibleURI extends AbstractFedElement /** - * @param \SimpleSAML\XML\Type\AnyURIValue $content + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ final public function __construct(AnyURIValue $content, array $namespacedAttributes = []) diff --git a/src/XML/fed/AbstractAttributeServiceType.php b/src/XML/fed/AbstractAttributeServiceType.php index df191b6d..15a15ab1 100644 --- a/src/XML/fed/AbstractAttributeServiceType.php +++ b/src/XML/fed/AbstractAttributeServiceType.php @@ -5,12 +5,19 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML\Type\{SAMLAnyURIValue, SAMLDateTimeValue, SAMLStringValue}; -use SimpleSAML\SAML2\XML\md\{Extensions, Organization}; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLDateTimeValue; +use SimpleSAML\SAML2\Type\SAMLStringValue; +use SimpleSAML\SAML2\XML\md\Extensions; +use SimpleSAML\SAML2\XML\md\Organization; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\XML\Exception\{MissingElementException, SchemaViolationException}; -use SimpleSAML\XML\Type\{DurationValue, IDValue}; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\DurationValue; +use SimpleSAML\XMLSchema\Type\IDValue; +use SimpleSAML\XMLSchema\Type\QNameValue; /** * A AttributeServiceType @@ -32,10 +39,11 @@ abstract class AbstractAttributeServiceType extends AbstractWebServiceDescriptor /** * AttributeServiceType constructor. * - * @param string[] $protocolSupportEnumeration A set of URI specifying the protocols supported. - * @param \SimpleSAML\XML\Type\IDValue|null $ID The ID for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi-type of the element + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration A set of URI specifying the protocols supported. + * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XML\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. @@ -58,7 +66,8 @@ abstract class AbstractAttributeServiceType extends AbstractWebServiceDescriptor * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint */ final public function __construct( - array $protocolSupportEnumeration, + QNameValue $type, + SAMLAnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, @@ -93,7 +102,7 @@ final public function __construct( ); parent::__construct( - static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME, + $type, $protocolSupportEnumeration, $ID, $validUntil, diff --git a/src/XML/fed/AbstractClaimDialectType.php b/src/XML/fed/AbstractClaimDialectType.php index 374491fc..adea6d0e 100644 --- a/src/XML/fed/AbstractClaimDialectType.php +++ b/src/XML/fed/AbstractClaimDialectType.php @@ -6,10 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ClaimDialectType element @@ -31,7 +33,7 @@ abstract class AbstractClaimDialectType extends AbstractFedElement /** * AbstractClaimDialectType constructor * - * @param \SimpleSAML\XML\Type\AnyURIValue|null $Uri + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Uri * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ @@ -49,7 +51,7 @@ final public function __construct( /** - * @return \SimpleSAML\XML\Type\AnyURIValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ public function getUri(): ?AnyURIValue { @@ -63,7 +65,7 @@ public function getUri(): ?AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractClaimDialectsOfferedType.php b/src/XML/fed/AbstractClaimDialectsOfferedType.php index 6e2591ee..55c5bf01 100644 --- a/src/XML/fed/AbstractClaimDialectsOfferedType.php +++ b/src/XML/fed/AbstractClaimDialectsOfferedType.php @@ -7,9 +7,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\fed\ClaimDialect; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ClaimDialectsOfferedType element @@ -56,7 +58,7 @@ public function getClaimDialect(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractClaimTypesOfferedType.php b/src/XML/fed/AbstractClaimTypesOfferedType.php index a5130473..3156d108 100644 --- a/src/XML/fed/AbstractClaimTypesOfferedType.php +++ b/src/XML/fed/AbstractClaimTypesOfferedType.php @@ -7,9 +7,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\auth\ClaimType; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ClaimTypesOfferedType element @@ -56,7 +58,7 @@ public function getClaimType(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractClaimTypesRequestedType.php b/src/XML/fed/AbstractClaimTypesRequestedType.php index 890ee536..ecb4e1e0 100644 --- a/src/XML/fed/AbstractClaimTypesRequestedType.php +++ b/src/XML/fed/AbstractClaimTypesRequestedType.php @@ -7,9 +7,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\auth\ClaimType; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the ClaimTypesRequestedType element @@ -56,7 +58,7 @@ public function getClaimType(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractClientPseudonymType.php b/src/XML/fed/AbstractClientPseudonymType.php index c5853293..1ab91a08 100644 --- a/src/XML/fed/AbstractClientPseudonymType.php +++ b/src/XML/fed/AbstractClientPseudonymType.php @@ -6,9 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -98,7 +100,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractEndpointType.php b/src/XML/fed/AbstractEndpointType.php index 4d2f945d..a1e3b777 100644 --- a/src/XML/fed/AbstractEndpointType.php +++ b/src/XML/fed/AbstractEndpointType.php @@ -7,7 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsa_200508\EndpointReference; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException}; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; /** * An EndpointType @@ -44,7 +45,7 @@ public function getEndpointReference(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractFederationMetadataHandlerType.php b/src/XML/fed/AbstractFederationMetadataHandlerType.php index a73b9567..f47fc57a 100644 --- a/src/XML/fed/AbstractFederationMetadataHandlerType.php +++ b/src/XML/fed/AbstractFederationMetadataHandlerType.php @@ -6,9 +6,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the FederationMetadataHandlerType element @@ -52,7 +52,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractFederationMetadataType.php b/src/XML/fed/AbstractFederationMetadataType.php index dec182ef..b13bf94c 100644 --- a/src/XML/fed/AbstractFederationMetadataType.php +++ b/src/XML/fed/AbstractFederationMetadataType.php @@ -6,9 +6,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\InvalidDOMElementException; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the FederationMetadataType element @@ -60,7 +61,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractFederationType.php b/src/XML/fed/AbstractFederationType.php index c6281d51..1670fe9a 100644 --- a/src/XML/fed/AbstractFederationType.php +++ b/src/XML/fed/AbstractFederationType.php @@ -6,10 +6,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the FederationType element @@ -31,7 +33,7 @@ abstract class AbstractFederationType extends AbstractFedElement /** * AbstractFederationType constructor * - * @param \SimpleSAML\XML\Type\AnyURIValue|null $FederationID + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $FederationID * @param list<\SimpleSAML\XML\SerializableElementInterface> $children * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ @@ -46,7 +48,7 @@ final public function __construct( /** - * @return \SimpleSAML\XML\Type\AnyURIValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ public function getFederationID(): ?AnyURIValue { @@ -73,7 +75,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractFilterPseudonymsType.php b/src/XML/fed/AbstractFilterPseudonymsType.php index ce67f1b5..335be721 100644 --- a/src/XML/fed/AbstractFilterPseudonymsType.php +++ b/src/XML/fed/AbstractFilterPseudonymsType.php @@ -6,9 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, TooManyElementsException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, ExtendableElementTrait}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\TooManyElementsException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * A FilterPseudonymsType @@ -88,7 +90,7 @@ public function isEmptyElement(): bool * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractFreshnessType.php b/src/XML/fed/AbstractFreshnessType.php index 83cd44f4..8d5e43a9 100644 --- a/src/XML/fed/AbstractFreshnessType.php +++ b/src/XML/fed/AbstractFreshnessType.php @@ -6,10 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; -use SimpleSAML\XML\{ExtendableAttributesTrait, TypedTextContentTrait}; -use SimpleSAML\XML\Type\{BooleanValue, UnsignedIntValue}; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\TypedTextContentTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\UnsignedIntValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function var_export; @@ -33,8 +36,8 @@ abstract class AbstractFreshnessType extends AbstractFedElement /** * AbstractFreshnessType constructor * - * @param \SimpleSAML\XML\Type\UnsignedIntValue $content - * @param \SimpleSAML\XML\Type\BooleanValue|null $AllowCache + * @param \SimpleSAML\XMLSchema\Type\UnsignedIntValue $content + * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $AllowCache * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( @@ -48,7 +51,7 @@ final public function __construct( /** - * @return \SimpleSAML\XML\Type\BooleanValue|null + * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null */ public function getAllowCache(): ?BooleanValue { @@ -62,7 +65,7 @@ public function getAllowCache(): ?BooleanValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractIssuerNameType.php b/src/XML/fed/AbstractIssuerNameType.php index f7b1c04e..e8da853f 100644 --- a/src/XML/fed/AbstractIssuerNameType.php +++ b/src/XML/fed/AbstractIssuerNameType.php @@ -6,10 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the IssuerNameType element @@ -27,7 +28,7 @@ abstract class AbstractIssuerNameType extends AbstractFedElement /** * AbstractIssuerNameType constructor * - * @param \SimpleSAML\XML\Type\AnyURIValue $Uri + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $Uri * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( @@ -39,7 +40,7 @@ final public function __construct( /** - * @return \SimpleSAML\XML\Type\AnyURIValue + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue */ public function getUri(): AnyURIValue { @@ -53,7 +54,7 @@ public function getUri(): AnyURIValue * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php index 3726bab7..b63813b3 100644 --- a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php +++ b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php @@ -7,9 +7,10 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\fed\IssuerName; -use SimpleSAML\XML\Exception\{InvalidDOMElementException, MissingElementException, SchemaViolationException}; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XML\XsNamespace as NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Exception\MissingElementException; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Class defining the LogicalServiceNamesOfferedType element @@ -34,7 +35,7 @@ final public function __construct( protected array $issuerName, array $namespacedAttributes = [], ) { - Assert::notEmpty($issuerName, SchemaViolationException::class); + Assert::minCount($issuerName, 1, MissingElementException::class); Assert::allIsInstanceOf($issuerName, IssuerName::class); $this->setAttributesNS($namespacedAttributes); @@ -56,7 +57,7 @@ public function getIssuerName(): array * @param \DOMElement $xml * @return static * - * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException + * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ public static function fromXML(DOMElement $xml): static diff --git a/src/XML/fed/AbstractPseudonymServiceType.php b/src/XML/fed/AbstractPseudonymServiceType.php index 8dd85ed6..ac3b0328 100644 --- a/src/XML/fed/AbstractPseudonymServiceType.php +++ b/src/XML/fed/AbstractPseudonymServiceType.php @@ -5,8 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\AnyURIListValue; use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; use SimpleSAML\SAML2\XML\md\Extensions; @@ -40,7 +40,7 @@ abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptor * PseudonymServiceType constructor. * * @param \SimpleSAML\XMLSchema\Type\QNameValue $type - * @param \SimpleSAML\SAML2\Type\AnyURIListValue $protocolSupportEnumeration + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration * A set of URI specifying the protocols supported. * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil @@ -71,7 +71,7 @@ abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptor */ final public function __construct( QNameValue $type, - AnyURIListValue $protocolSupportEnumeration, + SAMLAnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, diff --git a/src/XML/fed/AbstractSecurityTokenServiceType.php b/src/XML/fed/AbstractSecurityTokenServiceType.php index ffbc10c3..da0dbe7d 100644 --- a/src/XML/fed/AbstractSecurityTokenServiceType.php +++ b/src/XML/fed/AbstractSecurityTokenServiceType.php @@ -5,7 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\AnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; @@ -40,7 +40,7 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri * SecurityTokenServiceType constructor. * * @param \SimpleSAML\XMLSchema\Type\QNameValue $type - * @param \SimpleSAML\SAML2\Type\AnyURIListValue $protocolSupportEnumeration + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration * A set of URI specifying the protocols supported. * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil @@ -73,7 +73,7 @@ abstract class AbstractSecurityTokenServiceType extends AbstractWebServiceDescri */ final public function __construct( QNameValue $type, - AnyURIListValue $protocolSupportEnumeration, + SAMLAnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, diff --git a/src/XML/fed/AbstractWebServiceDescriptorType.php b/src/XML/fed/AbstractWebServiceDescriptorType.php index 5f5d7e6e..0c27f022 100644 --- a/src/XML/fed/AbstractWebServiceDescriptorType.php +++ b/src/XML/fed/AbstractWebServiceDescriptorType.php @@ -5,7 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\AnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; @@ -27,7 +27,7 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptor * WebServiceDescriptorType constructor. * * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi-type of the element - * @param \SimpleSAML\SAML2\Type\AnyURIListValue $protocolSupportEnumeration + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration * A set of URI specifying the protocols supported. * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil @@ -56,7 +56,7 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptor */ protected function __construct( QNameValue $type, - AnyURIListValue $protocolSupportEnumeration, + SAMLAnyURIListValue $protocolSupportEnumeration, ?IDValue $ID = null, ?SAMLDateTimeValue $validUntil = null, ?DurationValue $cacheDuration = null, diff --git a/src/XML/fed/SecurityTokenServiceType.php b/src/XML/fed/SecurityTokenServiceType.php index c675b770..dac5a749 100644 --- a/src/XML/fed/SecurityTokenServiceType.php +++ b/src/XML/fed/SecurityTokenServiceType.php @@ -5,8 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\AnyURIListValue; use SimpleSAML\SAML2\Type\SAMLAnyURIValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; use SimpleSAML\SAML2\XML\md\ContactPerson; @@ -136,7 +136,7 @@ public static function fromXML(DOMElement $xml): static $securityTokenServiceType = new static( $type, - self::getAttribute($xml, 'protocolSupportEnumeration', AnyURIListValue::class), + self::getAttribute($xml, 'protocolSupportEnumeration', SAMLAnyURIListValue::class), self::getOptionalAttribute($xml, 'ID', IDValue::class, null), self::getOptionalAttribute($xml, 'validUntil', SAMLDateTimeValue::class, null), self::getOptionalAttribute($xml, 'cacheDuration', DurationValue::class, null), From 152f1c43f590067b19e32aebbb888d39fee40cf5 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 6 Dec 2025 16:29:27 +0100 Subject: [PATCH 23/34] Migrate to xsd-types --- src/XML/auth/AbstractAdditionalContextType.php | 1 + src/XML/auth/AbstractClaimType.php | 6 +++++- src/XML/auth/AbstractConstrainedValueType.php | 1 + src/XML/auth/AbstractContextItemType.php | 1 + src/XML/auth/AbstractDescriptionType.php | 1 + src/XML/auth/AbstractDisplayNameType.php | 1 + src/XML/auth/AbstractDisplayValueType.php | 1 + src/XML/auth/AbstractStructuredValueType.php | 1 + src/XML/auth/Value.php | 1 + src/XML/fed/AbstractApplicationServiceType.php | 15 +++++++++------ src/XML/fed/AbstractAssertionType.php | 1 + .../fed/AbstractAttributeExtensibleString.php | 1 + src/XML/fed/AbstractAttributeExtensibleURI.php | 1 + src/XML/fed/AbstractAttributeServiceType.php | 14 +++++++++----- src/XML/fed/AbstractClaimDialectType.php | 2 +- .../fed/AbstractClaimDialectsOfferedType.php | 1 + src/XML/fed/AbstractClaimTypesOfferedType.php | 1 + src/XML/fed/AbstractClaimTypesRequestedType.php | 1 + src/XML/fed/AbstractClientPseudonymType.php | 1 + .../AbstractFederationMetadataHandlerType.php | 1 + src/XML/fed/AbstractFederationMetadataType.php | 1 + src/XML/fed/AbstractFederationType.php | 2 +- src/XML/fed/AbstractFilterPseudonymsType.php | 1 + src/XML/fed/AbstractFreshnessType.php | 2 +- src/XML/fed/AbstractIssuerNameType.php | 2 +- .../AbstractLogicalServiceNamesOfferedType.php | 1 + src/XML/fed/AbstractProofTokenType.php | 1 + src/XML/fed/AbstractPseudonymBasisType.php | 1 + src/XML/fed/AbstractPseudonymServiceType.php | 2 +- src/XML/fed/AbstractPseudonymType.php | 1 + src/XML/fed/AbstractReferenceDigestType.php | 1 + src/XML/fed/AbstractReferenceTokenType.php | 1 + src/XML/fed/AbstractRelativeToType.php | 1 + src/XML/fed/AbstractRequestProofTokenType.php | 1 + src/XML/fed/AbstractRequestPseudonymType.php | 1 + src/XML/fed/AbstractSecurityTokenType.php | 1 + src/XML/fed/AbstractSignOutBasisType.php | 1 + src/XML/fed/AbstractSignOutType.php | 1 + src/XML/fed/AbstractTokenType.php | 2 +- src/XML/fed/AbstractTokenTypesOfferedType.php | 1 + src/XML/fed/AdditionalContextProcessed.php | 3 ++- src/XML/fed/ApplicationServiceEndpoint.php | 3 ++- src/XML/fed/AttributeServiceEndpoint.php | 3 ++- src/XML/fed/AttributeServiceEndpoints.php | 3 ++- src/XML/fed/AuthenticationToken.php | 4 +++- src/XML/fed/AutomaticPseudonyms.php | 1 + src/XML/fed/ClaimDialectsOffered.php | 3 ++- src/XML/fed/ClaimTypesOffered.php | 3 ++- src/XML/fed/ClaimTypesRequested.php | 3 ++- src/XML/fed/ClientPseudonym.php | 3 ++- src/XML/fed/FederationID.php | 3 ++- src/XML/fed/FederationMetadata.php | 3 ++- src/XML/fed/FederationMetadataHandler.php | 3 ++- src/XML/fed/FilterPseudonyms.php | 3 ++- src/XML/fed/Freshness.php | 3 ++- src/XML/fed/IssuesSpecificPolicyFault.php | 3 ++- src/XML/fed/LogicalServiceNamesOffered.php | 3 ++- src/XML/fed/PassiveRequestorEndpoint.php | 3 ++- src/XML/fed/PassiveRequestorEndpoints.php | 3 ++- src/XML/fed/ProofToken.php | 3 ++- src/XML/fed/Pseudonym.php | 3 ++- src/XML/fed/PseudonymBasis.php | 3 ++- src/XML/fed/PseudonymServiceEndpoint.php | 3 ++- src/XML/fed/PseudonymServiceEndpoints.php | 3 ++- src/XML/fed/Realm.php | 1 + src/XML/fed/ReferenceToken.php | 3 ++- src/XML/fed/ReferenceToken11.php | 3 ++- src/XML/fed/RelativeTo.php | 3 ++- src/XML/fed/RequestProofToken.php | 3 ++- src/XML/fed/RequestPseudonym.php | 3 ++- src/XML/fed/RequireBearerTokens.php | 3 ++- src/XML/fed/RequireReferenceToken.php | 4 +++- src/XML/fed/RequireSharedCookies.php | 3 ++- src/XML/fed/RequireSignedTokens.php | 3 ++- src/XML/fed/RequiresGenericClaimDialect.php | 3 ++- src/XML/fed/SecurityToken.php | 3 ++- src/XML/fed/SecurityTokenServiceEndpoint.php | 3 ++- src/XML/fed/SecurityTokenServiceType.php | 2 +- src/XML/fed/SignOut.php | 3 ++- .../fed/SingleSignOutNotificationEndpoint.php | 3 ++- .../fed/SingleSignOutNotificationEndpoints.php | 3 ++- .../fed/SingleSignOutSubscriptionEndpoint.php | 3 ++- .../fed/SingleSignOutSubscriptionEndpoints.php | 3 ++- src/XML/fed/TargetScopes.php | 3 ++- src/XML/fed/TokenTypesOffered.php | 3 ++- src/XML/fed/WebBinding.php | 4 +++- src/XML/mssp/MustNotSendCancel.php | 1 + src/XML/mssp/RequireClientCertificate.php | 1 + src/XML/mssp/RsaToken.php | 1 + src/XML/mssp/SslContextToken.php | 1 + src/XML/sp_200507/AbstractHeaderType.php | 3 ++- src/XML/sp_200507/AbstractHttpsTokenType.php | 1 + src/XML/sp_200507/AbstractIssuedTokenType.php | 1 + src/XML/sp_200507/AbstractNestedPolicyType.php | 1 + .../sp_200507/AbstractQNameAssertionType.php | 3 ++- ...AbstractRequestSecurityTokenTemplateType.php | 5 +++-- src/XML/sp_200507/AbstractSePartsType.php | 1 + .../AbstractSecureConversationTokenType.php | 1 + src/XML/sp_200507/AbstractSerElementsType.php | 3 ++- .../AbstractSpnegoContextTokenType.php | 1 + .../sp_200507/AbstractTokenAssertionType.php | 1 + src/XML/sp_200507/XPath.php | 1 + src/XML/sp_200702/AbstractHeaderType.php | 3 ++- src/XML/sp_200702/AbstractIssuedTokenType.php | 1 + src/XML/sp_200702/AbstractKeyValueTokenType.php | 1 + src/XML/sp_200702/AbstractNestedPolicyType.php | 2 +- .../sp_200702/AbstractQNameAssertionType.php | 1 + src/XML/sp_200702/AbstractReqPartsType.php | 1 + ...AbstractRequestSecurityTokenTemplateType.php | 1 + src/XML/sp_200702/AbstractSePartsType.php | 1 + .../AbstractSecureConversationTokenType.php | 1 + src/XML/sp_200702/AbstractSerElementsType.php | 1 + .../AbstractSpnegoContextTokenType.php | 1 + .../sp_200702/AbstractTokenAssertionType.php | 1 + .../wsa_200408/AbstractAttributedQNameType.php | 1 + .../AbstractEndpointReferenceType.php | 1 + src/XML/wsa_200408/AbstractRelationshipType.php | 1 + src/XML/wsa_200408/AbstractServiceNameType.php | 1 + src/XML/wsa_200408/ReferenceParameters.php | 1 + src/XML/wsa_200408/ReferenceProperties.php | 1 + .../wsa_200508/AbstractAttributedURIType.php | 1 + .../AbstractEndpointReferenceType.php | 1 + .../wsa_200508/AbstractProblemActionType.php | 1 + src/XML/wsa_200508/Metadata.php | 1 + src/XML/wsa_200508/ProblemAction.php | 1 + src/XML/wsa_200508/ReferenceParameters.php | 1 + src/XML/wsa_200508/RelatesTo.php | 1 + src/XML/wsaw/AbstractAttributedQNameType.php | 3 ++- src/XML/wsaw/AbstractServiceNameType.php | 2 +- src/XML/wsaw/ActionTrait.php | 1 - src/XML/wsaw/Anonymous.php | 3 ++- src/XML/wsaw/InterfaceName.php | 1 + src/XML/wsaw/ServiceName.php | 1 + src/XML/wsaw/UsingAddressing.php | 1 + src/XML/wsp/AbstractOperatorContentType.php | 1 + src/XML/wsp/AppliesTo.php | 1 + src/XML/wsp/Policy.php | 2 +- src/XML/wsp/PolicyAttachment.php | 1 + src/XML/wsp/PolicyReference.php | 4 +--- src/XML/wsp/PolicyURIsTrait.php | 17 +++++++---------- .../wsse/AbstractBinarySecurityTokenType.php | 3 +-- src/XML/wsse/AbstractReferenceType.php | 2 +- .../wst_200512/AbstractAuthenticatorType.php | 1 + .../wst_200512/AbstractBinaryExchangeType.php | 1 - src/XML/wst_200512/AbstractBinarySecretType.php | 1 - src/XML/wst_200512/AbstractCancelTargetType.php | 1 + src/XML/wst_200512/AbstractClaimsType.php | 2 +- .../wst_200512/AbstractComputedKeyOpenEnum.php | 1 + src/XML/wst_200512/AbstractDelegateToType.php | 1 + src/XML/wst_200512/AbstractEncryptionType.php | 1 + src/XML/wst_200512/AbstractEntropyType.php | 1 + .../wst_200512/AbstractKeyExchangeTokenType.php | 1 + src/XML/wst_200512/AbstractOnBehalfOfType.php | 1 + src/XML/wst_200512/AbstractParticipantType.php | 1 + src/XML/wst_200512/AbstractParticipantsType.php | 1 + .../wst_200512/AbstractProofEncryptionType.php | 1 + src/XML/wst_200512/AbstractRenewTargetType.php | 1 + ...questSecurityTokenResponseCollectionType.php | 1 + ...AbstractRequestSecurityTokenResponseType.php | 2 +- .../AbstractRequestSecurityTokenType.php | 2 +- .../AbstractRequestedProofTokenType.php | 1 + .../AbstractRequestedSecurityTokenType.php | 1 + .../wst_200512/AbstractSignChallengeType.php | 1 + .../wst_200512/AbstractStatusCodeOpenEnum.php | 1 + src/XML/wst_200512/AbstractUseKeyType.php | 2 +- .../wst_200512/AbstractValidateTargetType.php | 1 + src/XML/wst_200512/AllowPostdating.php | 1 + src/XML/wst_200512/AuthenticationType.php | 1 + src/XML/wst_200512/Authenticator.php | 3 ++- src/XML/wst_200512/BinaryExchange.php | 3 ++- src/XML/wst_200512/BinarySecret.php | 3 ++- src/XML/wst_200512/CancelTarget.php | 3 ++- src/XML/wst_200512/Challenge.php | 1 + src/XML/wst_200512/Claims.php | 3 ++- src/XML/wst_200512/ComputedKey.php | 3 ++- src/XML/wst_200512/ComputedKeyAlgorithm.php | 1 + src/XML/wst_200512/Delegatable.php | 2 +- src/XML/wst_200512/DelegateTo.php | 3 ++- src/XML/wst_200512/Encryption.php | 3 ++- src/XML/wst_200512/Entropy.php | 3 ++- src/XML/wst_200512/IssuedTokens.php | 3 ++- src/XML/wst_200512/Issuer.php | 4 +++- src/XML/wst_200512/KeyExchangeToken.php | 3 ++- src/XML/wst_200512/KeySize.php | 2 -- src/XML/wst_200512/KeyType.php | 3 ++- src/XML/wst_200512/Lifetime.php | 3 ++- src/XML/wst_200512/OnBehalfOf.php | 3 ++- src/XML/wst_200512/Participants.php | 3 ++- src/XML/wst_200512/ProofEncryption.php | 3 ++- src/XML/wst_200512/RenewTarget.php | 3 ++- src/XML/wst_200512/Renewing.php | 3 ++- src/XML/wst_200512/RequestKET.php | 1 + src/XML/wst_200512/RequestSecurityToken.php | 3 ++- .../RequestSecurityTokenCollection.php | 3 ++- .../wst_200512/RequestSecurityTokenResponse.php | 3 ++- .../RequestSecurityTokenResponseCollection.php | 3 ++- src/XML/wst_200512/RequestType.php | 3 ++- .../wst_200512/RequestedAttachedReference.php | 3 ++- src/XML/wst_200512/RequestedProofToken.php | 3 ++- src/XML/wst_200512/RequestedSecurityToken.php | 3 ++- src/XML/wst_200512/RequestedTokenCancelled.php | 1 + .../wst_200512/RequestedUnattachedReference.php | 3 ++- src/XML/wst_200512/SignChallenge.php | 3 ++- src/XML/wst_200512/SignChallengeResponse.php | 3 ++- src/XML/wst_200512/Status.php | 3 ++- src/XML/wst_200512/UseKey.php | 3 ++- src/XML/wst_200512/ValidateTarget.php | 3 ++- src/XML/wsu/AbstractAttributedDateTime.php | 6 ++---- src/XML/wsu/AbstractAttributedURI.php | 2 +- src/XML/wsu/AbstractTimestamp.php | 2 +- src/XML/wsu/Created.php | 3 ++- src/XML/wsu/Expires.php | 3 ++- src/XML/wsu/Timestamp.php | 3 ++- src/XML/wsu/Type/DateTimeValue.php | 5 ++++- src/XML/wsx/GetMetadata.php | 1 + src/XML/wsx/Metadata.php | 1 + src/XML/wsx/MetadataReference.php | 1 + src/XML/wsx/MetadataSection.php | 1 + 218 files changed, 335 insertions(+), 142 deletions(-) diff --git a/src/XML/auth/AbstractAdditionalContextType.php b/src/XML/auth/AbstractAdditionalContextType.php index 7475f2a9..0e3ffd23 100644 --- a/src/XML/auth/AbstractAdditionalContextType.php +++ b/src/XML/auth/AbstractAdditionalContextType.php @@ -22,6 +22,7 @@ abstract class AbstractAdditionalContextType extends AbstractAuthElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/auth/AbstractClaimType.php b/src/XML/auth/AbstractClaimType.php index 2f4c397f..fa02b798 100644 --- a/src/XML/auth/AbstractClaimType.php +++ b/src/XML/auth/AbstractClaimType.php @@ -37,6 +37,7 @@ abstract class AbstractClaimType extends AbstractAuthElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; @@ -79,7 +80,10 @@ final public function __construct( $value instanceof EncryptedValue) ) { /** @var \SimpleSAML\XML\Chunk|\SimpleSAML\XML\AbstractElement $value */ - Assert::notSame($value instanceof Chunk ? $value->getNamespaceURI() : $value::getNamespaceURI(), static::NS); + Assert::notSame( + $value instanceof Chunk ? $value->getNamespaceURI() : $value::getNamespaceURI(), + static::NS, + ); } $this->setAttributesNS($namespacedAttributes); } diff --git a/src/XML/auth/AbstractConstrainedValueType.php b/src/XML/auth/AbstractConstrainedValueType.php index b852502f..270e8c02 100644 --- a/src/XML/auth/AbstractConstrainedValueType.php +++ b/src/XML/auth/AbstractConstrainedValueType.php @@ -26,6 +26,7 @@ abstract class AbstractConstrainedValueType extends AbstractAuthElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/auth/AbstractContextItemType.php b/src/XML/auth/AbstractContextItemType.php index 1d123b64..de0e6486 100644 --- a/src/XML/auth/AbstractContextItemType.php +++ b/src/XML/auth/AbstractContextItemType.php @@ -27,6 +27,7 @@ abstract class AbstractContextItemType extends AbstractAuthElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/auth/AbstractDescriptionType.php b/src/XML/auth/AbstractDescriptionType.php index c4f21fd5..b10a2de7 100644 --- a/src/XML/auth/AbstractDescriptionType.php +++ b/src/XML/auth/AbstractDescriptionType.php @@ -22,6 +22,7 @@ abstract class AbstractDescriptionType extends AbstractAuthElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; diff --git a/src/XML/auth/AbstractDisplayNameType.php b/src/XML/auth/AbstractDisplayNameType.php index 7a8d8dfb..8f064ee3 100644 --- a/src/XML/auth/AbstractDisplayNameType.php +++ b/src/XML/auth/AbstractDisplayNameType.php @@ -22,6 +22,7 @@ abstract class AbstractDisplayNameType extends AbstractAuthElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; diff --git a/src/XML/auth/AbstractDisplayValueType.php b/src/XML/auth/AbstractDisplayValueType.php index 73a916e5..a9805c99 100644 --- a/src/XML/auth/AbstractDisplayValueType.php +++ b/src/XML/auth/AbstractDisplayValueType.php @@ -22,6 +22,7 @@ abstract class AbstractDisplayValueType extends AbstractAuthElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; diff --git a/src/XML/auth/AbstractStructuredValueType.php b/src/XML/auth/AbstractStructuredValueType.php index 99a7a61c..11950aa2 100644 --- a/src/XML/auth/AbstractStructuredValueType.php +++ b/src/XML/auth/AbstractStructuredValueType.php @@ -21,6 +21,7 @@ abstract class AbstractStructuredValueType extends AbstractAuthElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/auth/Value.php b/src/XML/auth/Value.php index 3ac8dc87..2dd7dd04 100644 --- a/src/XML/auth/Value.php +++ b/src/XML/auth/Value.php @@ -16,6 +16,7 @@ final class Value extends AbstractAuthElement { use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/fed/AbstractApplicationServiceType.php b/src/XML/fed/AbstractApplicationServiceType.php index 06120a81..a7202ec6 100644 --- a/src/XML/fed/AbstractApplicationServiceType.php +++ b/src/XML/fed/AbstractApplicationServiceType.php @@ -5,8 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; use SimpleSAML\SAML2\XML\md\Extensions; @@ -15,7 +15,6 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\DurationValue; use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -41,12 +40,16 @@ abstract class AbstractApplicationServiceType extends AbstractWebServiceDescript * ApplicationServiceType constructor. * * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi-type of the element - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration A set of URI specifying the protocols supported. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration + * A set of URI specifying the protocols supported. * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. - * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil + * Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration + * Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL + * An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization diff --git a/src/XML/fed/AbstractAssertionType.php b/src/XML/fed/AbstractAssertionType.php index 1910301f..8cca9e49 100644 --- a/src/XML/fed/AbstractAssertionType.php +++ b/src/XML/fed/AbstractAssertionType.php @@ -21,6 +21,7 @@ abstract class AbstractAssertionType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractAttributeExtensibleString.php b/src/XML/fed/AbstractAttributeExtensibleString.php index 08082629..fd7f65aa 100644 --- a/src/XML/fed/AbstractAttributeExtensibleString.php +++ b/src/XML/fed/AbstractAttributeExtensibleString.php @@ -22,6 +22,7 @@ abstract class AbstractAttributeExtensibleString extends AbstractFedElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; diff --git a/src/XML/fed/AbstractAttributeExtensibleURI.php b/src/XML/fed/AbstractAttributeExtensibleURI.php index 82781f6b..edd6c7d8 100644 --- a/src/XML/fed/AbstractAttributeExtensibleURI.php +++ b/src/XML/fed/AbstractAttributeExtensibleURI.php @@ -22,6 +22,7 @@ abstract class AbstractAttributeExtensibleURI extends AbstractFedElement use TypedTextContentTrait; use ExtendableAttributesTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; diff --git a/src/XML/fed/AbstractAttributeServiceType.php b/src/XML/fed/AbstractAttributeServiceType.php index 15a15ab1..0708a9d3 100644 --- a/src/XML/fed/AbstractAttributeServiceType.php +++ b/src/XML/fed/AbstractAttributeServiceType.php @@ -5,8 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; use SimpleSAML\SAML2\XML\md\Extensions; @@ -40,12 +40,16 @@ abstract class AbstractAttributeServiceType extends AbstractWebServiceDescriptor * AttributeServiceType constructor. * * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi-type of the element - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration A set of URI specifying the protocols supported. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIListValue $protocolSupportEnumeration + * A set of URI specifying the protocols supported. * @param \SimpleSAML\XMLSchema\Type\IDValue|null $ID The ID for this document. Defaults to null. - * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil Unix time of validity for this document. Defaults to null. - * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration Maximum time this document can be cached. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLDateTimeValue|null $validUntil + * Unix time of validity for this document. Defaults to null. + * @param \SimpleSAML\XMLSchema\Type\DurationValue|null $cacheDuration + * Maximum time this document can be cached. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\Extensions|null $extensions An array of extensions. Defaults to an empty array. - * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL An URI where to redirect users for support. Defaults to null. + * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $errorURL + * An URI where to redirect users for support. Defaults to null. * @param \SimpleSAML\SAML2\XML\md\KeyDescriptor[] $keyDescriptor An array of KeyDescriptor elements. * Defaults to an empty array. * @param \SimpleSAML\SAML2\XML\md\Organization|null $organization diff --git a/src/XML/fed/AbstractClaimDialectType.php b/src/XML/fed/AbstractClaimDialectType.php index adea6d0e..36c10c37 100644 --- a/src/XML/fed/AbstractClaimDialectType.php +++ b/src/XML/fed/AbstractClaimDialectType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -23,6 +22,7 @@ abstract class AbstractClaimDialectType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractClaimDialectsOfferedType.php b/src/XML/fed/AbstractClaimDialectsOfferedType.php index 55c5bf01..b5853d5e 100644 --- a/src/XML/fed/AbstractClaimDialectsOfferedType.php +++ b/src/XML/fed/AbstractClaimDialectsOfferedType.php @@ -22,6 +22,7 @@ abstract class AbstractClaimDialectsOfferedType extends AbstractFedElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractClaimTypesOfferedType.php b/src/XML/fed/AbstractClaimTypesOfferedType.php index 3156d108..31176725 100644 --- a/src/XML/fed/AbstractClaimTypesOfferedType.php +++ b/src/XML/fed/AbstractClaimTypesOfferedType.php @@ -22,6 +22,7 @@ abstract class AbstractClaimTypesOfferedType extends AbstractFedElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractClaimTypesRequestedType.php b/src/XML/fed/AbstractClaimTypesRequestedType.php index ecb4e1e0..e61a9c39 100644 --- a/src/XML/fed/AbstractClaimTypesRequestedType.php +++ b/src/XML/fed/AbstractClaimTypesRequestedType.php @@ -22,6 +22,7 @@ abstract class AbstractClaimTypesRequestedType extends AbstractFedElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractClientPseudonymType.php b/src/XML/fed/AbstractClientPseudonymType.php index 1ab91a08..ce3d4555 100644 --- a/src/XML/fed/AbstractClientPseudonymType.php +++ b/src/XML/fed/AbstractClientPseudonymType.php @@ -24,6 +24,7 @@ abstract class AbstractClientPseudonymType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractFederationMetadataHandlerType.php b/src/XML/fed/AbstractFederationMetadataHandlerType.php index f47fc57a..dfb5ef1e 100644 --- a/src/XML/fed/AbstractFederationMetadataHandlerType.php +++ b/src/XML/fed/AbstractFederationMetadataHandlerType.php @@ -19,6 +19,7 @@ abstract class AbstractFederationMetadataHandlerType extends AbstractFedElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractFederationMetadataType.php b/src/XML/fed/AbstractFederationMetadataType.php index b13bf94c..b66d43c2 100644 --- a/src/XML/fed/AbstractFederationMetadataType.php +++ b/src/XML/fed/AbstractFederationMetadataType.php @@ -21,6 +21,7 @@ abstract class AbstractFederationMetadataType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractFederationType.php b/src/XML/fed/AbstractFederationType.php index 1670fe9a..bb301830 100644 --- a/src/XML/fed/AbstractFederationType.php +++ b/src/XML/fed/AbstractFederationType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -23,6 +22,7 @@ abstract class AbstractFederationType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractFilterPseudonymsType.php b/src/XML/fed/AbstractFilterPseudonymsType.php index 335be721..71f2bc4e 100644 --- a/src/XML/fed/AbstractFilterPseudonymsType.php +++ b/src/XML/fed/AbstractFilterPseudonymsType.php @@ -22,6 +22,7 @@ abstract class AbstractFilterPseudonymsType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractFreshnessType.php b/src/XML/fed/AbstractFreshnessType.php index 8d5e43a9..a5e55993 100644 --- a/src/XML/fed/AbstractFreshnessType.php +++ b/src/XML/fed/AbstractFreshnessType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\BooleanValue; use SimpleSAML\XMLSchema\Type\UnsignedIntValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -26,6 +25,7 @@ abstract class AbstractFreshnessType extends AbstractFedElement use TypedTextContentTrait; use ExtendableAttributesTrait; + /** @var string */ public const TEXTCONTENT_TYPE = UnsignedIntValue::class; diff --git a/src/XML/fed/AbstractIssuerNameType.php b/src/XML/fed/AbstractIssuerNameType.php index e8da853f..52e5df09 100644 --- a/src/XML/fed/AbstractIssuerNameType.php +++ b/src/XML/fed/AbstractIssuerNameType.php @@ -8,7 +8,6 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -21,6 +20,7 @@ abstract class AbstractIssuerNameType extends AbstractFedElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php index b63813b3..5e63dfb8 100644 --- a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php +++ b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php @@ -21,6 +21,7 @@ abstract class AbstractLogicalServiceNamesOfferedType extends AbstractFedElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractProofTokenType.php b/src/XML/fed/AbstractProofTokenType.php index 0b58c6d2..e14c1edd 100644 --- a/src/XML/fed/AbstractProofTokenType.php +++ b/src/XML/fed/AbstractProofTokenType.php @@ -23,6 +23,7 @@ abstract class AbstractProofTokenType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractPseudonymBasisType.php b/src/XML/fed/AbstractPseudonymBasisType.php index e333d9b3..89812cfb 100644 --- a/src/XML/fed/AbstractPseudonymBasisType.php +++ b/src/XML/fed/AbstractPseudonymBasisType.php @@ -26,6 +26,7 @@ abstract class AbstractPseudonymBasisType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractPseudonymServiceType.php b/src/XML/fed/AbstractPseudonymServiceType.php index ac3b0328..ff2637b2 100644 --- a/src/XML/fed/AbstractPseudonymServiceType.php +++ b/src/XML/fed/AbstractPseudonymServiceType.php @@ -5,8 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; use SimpleSAML\SAML2\XML\md\Extensions; diff --git a/src/XML/fed/AbstractPseudonymType.php b/src/XML/fed/AbstractPseudonymType.php index 3ba0bbdc..0a82f649 100644 --- a/src/XML/fed/AbstractPseudonymType.php +++ b/src/XML/fed/AbstractPseudonymType.php @@ -22,6 +22,7 @@ abstract class AbstractPseudonymType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractReferenceDigestType.php b/src/XML/fed/AbstractReferenceDigestType.php index 96305464..03403066 100644 --- a/src/XML/fed/AbstractReferenceDigestType.php +++ b/src/XML/fed/AbstractReferenceDigestType.php @@ -22,6 +22,7 @@ abstract class AbstractReferenceDigestType extends AbstractFedElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = Base64BinaryValue::class; diff --git a/src/XML/fed/AbstractReferenceTokenType.php b/src/XML/fed/AbstractReferenceTokenType.php index 4351e554..33b8e586 100644 --- a/src/XML/fed/AbstractReferenceTokenType.php +++ b/src/XML/fed/AbstractReferenceTokenType.php @@ -23,6 +23,7 @@ abstract class AbstractReferenceTokenType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractRelativeToType.php b/src/XML/fed/AbstractRelativeToType.php index 62bb9ccd..96957d74 100644 --- a/src/XML/fed/AbstractRelativeToType.php +++ b/src/XML/fed/AbstractRelativeToType.php @@ -21,6 +21,7 @@ abstract class AbstractRelativeToType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractRequestProofTokenType.php b/src/XML/fed/AbstractRequestProofTokenType.php index 58e142b2..f9a12bcf 100644 --- a/src/XML/fed/AbstractRequestProofTokenType.php +++ b/src/XML/fed/AbstractRequestProofTokenType.php @@ -21,6 +21,7 @@ abstract class AbstractRequestProofTokenType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/fed/AbstractRequestPseudonymType.php b/src/XML/fed/AbstractRequestPseudonymType.php index 91b34a89..989c3278 100644 --- a/src/XML/fed/AbstractRequestPseudonymType.php +++ b/src/XML/fed/AbstractRequestPseudonymType.php @@ -24,6 +24,7 @@ abstract class AbstractRequestPseudonymType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractSecurityTokenType.php b/src/XML/fed/AbstractSecurityTokenType.php index be18473e..36488fbc 100644 --- a/src/XML/fed/AbstractSecurityTokenType.php +++ b/src/XML/fed/AbstractSecurityTokenType.php @@ -23,6 +23,7 @@ abstract class AbstractSecurityTokenType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractSignOutBasisType.php b/src/XML/fed/AbstractSignOutBasisType.php index e248c6e1..0c2d4ae5 100644 --- a/src/XML/fed/AbstractSignOutBasisType.php +++ b/src/XML/fed/AbstractSignOutBasisType.php @@ -22,6 +22,7 @@ abstract class AbstractSignOutBasisType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractSignOutType.php b/src/XML/fed/AbstractSignOutType.php index 740ac85e..98ca933e 100644 --- a/src/XML/fed/AbstractSignOutType.php +++ b/src/XML/fed/AbstractSignOutType.php @@ -26,6 +26,7 @@ abstract class AbstractSignOutType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractTokenType.php b/src/XML/fed/AbstractTokenType.php index 3f438ce2..60508b9c 100644 --- a/src/XML/fed/AbstractTokenType.php +++ b/src/XML/fed/AbstractTokenType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -23,6 +22,7 @@ abstract class AbstractTokenType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AbstractTokenTypesOfferedType.php b/src/XML/fed/AbstractTokenTypesOfferedType.php index 5f8f16a4..0fbfad68 100644 --- a/src/XML/fed/AbstractTokenTypesOfferedType.php +++ b/src/XML/fed/AbstractTokenTypesOfferedType.php @@ -24,6 +24,7 @@ abstract class AbstractTokenTypesOfferedType extends AbstractFedElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/fed/AdditionalContextProcessed.php b/src/XML/fed/AdditionalContextProcessed.php index a29ca741..12396490 100644 --- a/src/XML/fed/AdditionalContextProcessed.php +++ b/src/XML/fed/AdditionalContextProcessed.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AdditionalContextProcessed element diff --git a/src/XML/fed/ApplicationServiceEndpoint.php b/src/XML/fed/ApplicationServiceEndpoint.php index 681ba8b7..c10dc617 100644 --- a/src/XML/fed/ApplicationServiceEndpoint.php +++ b/src/XML/fed/ApplicationServiceEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the ApplicationServiceEndpoint element diff --git a/src/XML/fed/AttributeServiceEndpoint.php b/src/XML/fed/AttributeServiceEndpoint.php index 366a9756..8b06c505 100644 --- a/src/XML/fed/AttributeServiceEndpoint.php +++ b/src/XML/fed/AttributeServiceEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the AttributeServiceEndpoint element diff --git a/src/XML/fed/AttributeServiceEndpoints.php b/src/XML/fed/AttributeServiceEndpoints.php index a6764a20..8f417f0b 100644 --- a/src/XML/fed/AttributeServiceEndpoints.php +++ b/src/XML/fed/AttributeServiceEndpoints.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the AttributeServiceEndpoints element diff --git a/src/XML/fed/AuthenticationToken.php b/src/XML/fed/AuthenticationToken.php index 683ac5a5..67950cef 100644 --- a/src/XML/fed/AuthenticationToken.php +++ b/src/XML/fed/AuthenticationToken.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractNestedPolicyType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An AuthenticationToken element @@ -16,6 +17,7 @@ final class AuthenticationToken extends AbstractNestedPolicyType implements Sche { use SchemaValidatableElementTrait; + /** @var string */ public const NS = AbstractFedElement::NS; diff --git a/src/XML/fed/AutomaticPseudonyms.php b/src/XML/fed/AutomaticPseudonyms.php index 746bd39a..d4511c23 100644 --- a/src/XML/fed/AutomaticPseudonyms.php +++ b/src/XML/fed/AutomaticPseudonyms.php @@ -19,6 +19,7 @@ final class AutomaticPseudonyms extends AbstractFedElement implements SchemaVali use SchemaValidatableElementTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = BooleanValue::class; } diff --git a/src/XML/fed/ClaimDialectsOffered.php b/src/XML/fed/ClaimDialectsOffered.php index ccead457..2b67d2c8 100644 --- a/src/XML/fed/ClaimDialectsOffered.php +++ b/src/XML/fed/ClaimDialectsOffered.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the ClaimDialectsOffered element diff --git a/src/XML/fed/ClaimTypesOffered.php b/src/XML/fed/ClaimTypesOffered.php index 0f28c931..50c4e32c 100644 --- a/src/XML/fed/ClaimTypesOffered.php +++ b/src/XML/fed/ClaimTypesOffered.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ClaimTypesOffered element diff --git a/src/XML/fed/ClaimTypesRequested.php b/src/XML/fed/ClaimTypesRequested.php index f1c19af1..39fd9c2e 100644 --- a/src/XML/fed/ClaimTypesRequested.php +++ b/src/XML/fed/ClaimTypesRequested.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ClaimTypesRequested element diff --git a/src/XML/fed/ClientPseudonym.php b/src/XML/fed/ClientPseudonym.php index 64f6b687..f1c66faa 100644 --- a/src/XML/fed/ClientPseudonym.php +++ b/src/XML/fed/ClientPseudonym.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ClientPseudonym element diff --git a/src/XML/fed/FederationID.php b/src/XML/fed/FederationID.php index 4d675325..da4191e4 100644 --- a/src/XML/fed/FederationID.php +++ b/src/XML/fed/FederationID.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A FederationID element diff --git a/src/XML/fed/FederationMetadata.php b/src/XML/fed/FederationMetadata.php index b091e518..239392ee 100644 --- a/src/XML/fed/FederationMetadata.php +++ b/src/XML/fed/FederationMetadata.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A FederationMetadata element diff --git a/src/XML/fed/FederationMetadataHandler.php b/src/XML/fed/FederationMetadataHandler.php index 62073031..40b15ca4 100644 --- a/src/XML/fed/FederationMetadataHandler.php +++ b/src/XML/fed/FederationMetadataHandler.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A FederationMetadataHandler element diff --git a/src/XML/fed/FilterPseudonyms.php b/src/XML/fed/FilterPseudonyms.php index d5b1a02e..5eede0b9 100644 --- a/src/XML/fed/FilterPseudonyms.php +++ b/src/XML/fed/FilterPseudonyms.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A FilterPseudonyms element diff --git a/src/XML/fed/Freshness.php b/src/XML/fed/Freshness.php index 1c339dc7..80a3f6b7 100644 --- a/src/XML/fed/Freshness.php +++ b/src/XML/fed/Freshness.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Freshness element diff --git a/src/XML/fed/IssuesSpecificPolicyFault.php b/src/XML/fed/IssuesSpecificPolicyFault.php index 67294296..86cd31eb 100644 --- a/src/XML/fed/IssuesSpecificPolicyFault.php +++ b/src/XML/fed/IssuesSpecificPolicyFault.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A IssuesSpecificPolicyFault element diff --git a/src/XML/fed/LogicalServiceNamesOffered.php b/src/XML/fed/LogicalServiceNamesOffered.php index c3acd509..b839b333 100644 --- a/src/XML/fed/LogicalServiceNamesOffered.php +++ b/src/XML/fed/LogicalServiceNamesOffered.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the LogicalServiceNamesOffered element diff --git a/src/XML/fed/PassiveRequestorEndpoint.php b/src/XML/fed/PassiveRequestorEndpoint.php index 5dbe76a2..3b9f8cc3 100644 --- a/src/XML/fed/PassiveRequestorEndpoint.php +++ b/src/XML/fed/PassiveRequestorEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the PassiveRequestorEndpoint element diff --git a/src/XML/fed/PassiveRequestorEndpoints.php b/src/XML/fed/PassiveRequestorEndpoints.php index ad8c30eb..eb84daa7 100644 --- a/src/XML/fed/PassiveRequestorEndpoints.php +++ b/src/XML/fed/PassiveRequestorEndpoints.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the PassiveRequestorEndpoints element diff --git a/src/XML/fed/ProofToken.php b/src/XML/fed/ProofToken.php index 1e48028d..f44d5a91 100644 --- a/src/XML/fed/ProofToken.php +++ b/src/XML/fed/ProofToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ProofToken element diff --git a/src/XML/fed/Pseudonym.php b/src/XML/fed/Pseudonym.php index 9ec34f93..9d1ed1c6 100644 --- a/src/XML/fed/Pseudonym.php +++ b/src/XML/fed/Pseudonym.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Pseudonym element diff --git a/src/XML/fed/PseudonymBasis.php b/src/XML/fed/PseudonymBasis.php index 387d7b89..90147913 100644 --- a/src/XML/fed/PseudonymBasis.php +++ b/src/XML/fed/PseudonymBasis.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A PseudonymBasis element diff --git a/src/XML/fed/PseudonymServiceEndpoint.php b/src/XML/fed/PseudonymServiceEndpoint.php index 74758275..0650af5b 100644 --- a/src/XML/fed/PseudonymServiceEndpoint.php +++ b/src/XML/fed/PseudonymServiceEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the PseudonymServiceEndpoint element diff --git a/src/XML/fed/PseudonymServiceEndpoints.php b/src/XML/fed/PseudonymServiceEndpoints.php index 3df14229..33f8e3cc 100644 --- a/src/XML/fed/PseudonymServiceEndpoints.php +++ b/src/XML/fed/PseudonymServiceEndpoints.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the PseudonymServiceEndpointz element diff --git a/src/XML/fed/Realm.php b/src/XML/fed/Realm.php index 7d2da008..c413c094 100644 --- a/src/XML/fed/Realm.php +++ b/src/XML/fed/Realm.php @@ -19,6 +19,7 @@ final class Realm extends AbstractFedElement implements SchemaValidatableElement use SchemaValidatableElementTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/fed/ReferenceToken.php b/src/XML/fed/ReferenceToken.php index 175782c7..b23fb679 100644 --- a/src/XML/fed/ReferenceToken.php +++ b/src/XML/fed/ReferenceToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ReferenceToken element diff --git a/src/XML/fed/ReferenceToken11.php b/src/XML/fed/ReferenceToken11.php index eddfba10..34f7e5db 100644 --- a/src/XML/fed/ReferenceToken11.php +++ b/src/XML/fed/ReferenceToken11.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ReferenceToken11 element diff --git a/src/XML/fed/RelativeTo.php b/src/XML/fed/RelativeTo.php index 3528ab86..5af82802 100644 --- a/src/XML/fed/RelativeTo.php +++ b/src/XML/fed/RelativeTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RelativeTo element diff --git a/src/XML/fed/RequestProofToken.php b/src/XML/fed/RequestProofToken.php index 34eda274..2d4c8100 100644 --- a/src/XML/fed/RequestProofToken.php +++ b/src/XML/fed/RequestProofToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestProofToken element diff --git a/src/XML/fed/RequestPseudonym.php b/src/XML/fed/RequestPseudonym.php index cf329d3e..5cd4be82 100644 --- a/src/XML/fed/RequestPseudonym.php +++ b/src/XML/fed/RequestPseudonym.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestPseudonym element diff --git a/src/XML/fed/RequireBearerTokens.php b/src/XML/fed/RequireBearerTokens.php index 1a339a4e..aa9d9e09 100644 --- a/src/XML/fed/RequireBearerTokens.php +++ b/src/XML/fed/RequireBearerTokens.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequireBearerTokens element diff --git a/src/XML/fed/RequireReferenceToken.php b/src/XML/fed/RequireReferenceToken.php index 0a848c80..2c21f660 100644 --- a/src/XML/fed/RequireReferenceToken.php +++ b/src/XML/fed/RequireReferenceToken.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An RequireReferenceToken element @@ -16,6 +17,7 @@ final class RequireReferenceToken extends AbstractTokenAssertionType implements { use SchemaValidatableElementTrait; + /** @var string */ public const NS = AbstractFedElement::NS; diff --git a/src/XML/fed/RequireSharedCookies.php b/src/XML/fed/RequireSharedCookies.php index ed71afb2..af2516f1 100644 --- a/src/XML/fed/RequireSharedCookies.php +++ b/src/XML/fed/RequireSharedCookies.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequireSharedCookies element diff --git a/src/XML/fed/RequireSignedTokens.php b/src/XML/fed/RequireSignedTokens.php index c0cfe3ec..037a3b1e 100644 --- a/src/XML/fed/RequireSignedTokens.php +++ b/src/XML/fed/RequireSignedTokens.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequireSignedTokens element diff --git a/src/XML/fed/RequiresGenericClaimDialect.php b/src/XML/fed/RequiresGenericClaimDialect.php index 59e8be9b..37198cbe 100644 --- a/src/XML/fed/RequiresGenericClaimDialect.php +++ b/src/XML/fed/RequiresGenericClaimDialect.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\fed\AbstractAssertionType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequiresGenericClaimDialect element diff --git a/src/XML/fed/SecurityToken.php b/src/XML/fed/SecurityToken.php index d0e6ca4e..8c2a6374 100644 --- a/src/XML/fed/SecurityToken.php +++ b/src/XML/fed/SecurityToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A SecurityToken element diff --git a/src/XML/fed/SecurityTokenServiceEndpoint.php b/src/XML/fed/SecurityTokenServiceEndpoint.php index 7744f530..9dac5e24 100644 --- a/src/XML/fed/SecurityTokenServiceEndpoint.php +++ b/src/XML/fed/SecurityTokenServiceEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SecurityTokenServiceEndpoint element diff --git a/src/XML/fed/SecurityTokenServiceType.php b/src/XML/fed/SecurityTokenServiceType.php index dac5a749..371bfaa5 100644 --- a/src/XML/fed/SecurityTokenServiceType.php +++ b/src/XML/fed/SecurityTokenServiceType.php @@ -5,8 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLAnyURIListValue; +use SimpleSAML\SAML2\Type\SAMLAnyURIValue; use SimpleSAML\SAML2\Type\SAMLDateTimeValue; use SimpleSAML\SAML2\Type\SAMLStringValue; use SimpleSAML\SAML2\XML\md\ContactPerson; diff --git a/src/XML/fed/SignOut.php b/src/XML/fed/SignOut.php index e56e41bc..70d94272 100644 --- a/src/XML/fed/SignOut.php +++ b/src/XML/fed/SignOut.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SignOut element diff --git a/src/XML/fed/SingleSignOutNotificationEndpoint.php b/src/XML/fed/SingleSignOutNotificationEndpoint.php index 0920ba74..3842b979 100644 --- a/src/XML/fed/SingleSignOutNotificationEndpoint.php +++ b/src/XML/fed/SingleSignOutNotificationEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SingleSignOutNotificationEndpoint element diff --git a/src/XML/fed/SingleSignOutNotificationEndpoints.php b/src/XML/fed/SingleSignOutNotificationEndpoints.php index 13d6e4f6..c6b6207c 100644 --- a/src/XML/fed/SingleSignOutNotificationEndpoints.php +++ b/src/XML/fed/SingleSignOutNotificationEndpoints.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SingleSignOutNotificationEndpoints element diff --git a/src/XML/fed/SingleSignOutSubscriptionEndpoint.php b/src/XML/fed/SingleSignOutSubscriptionEndpoint.php index 132180cb..a6af9c88 100644 --- a/src/XML/fed/SingleSignOutSubscriptionEndpoint.php +++ b/src/XML/fed/SingleSignOutSubscriptionEndpoint.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SingleSignOutSubscriptionEndpoint element diff --git a/src/XML/fed/SingleSignOutSubscriptionEndpoints.php b/src/XML/fed/SingleSignOutSubscriptionEndpoints.php index a825cb08..a75c6010 100644 --- a/src/XML/fed/SingleSignOutSubscriptionEndpoints.php +++ b/src/XML/fed/SingleSignOutSubscriptionEndpoints.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the SingleSignOutSubscriptionEndpoints element diff --git a/src/XML/fed/TargetScopes.php b/src/XML/fed/TargetScopes.php index 53ee945d..f116ecf4 100644 --- a/src/XML/fed/TargetScopes.php +++ b/src/XML/fed/TargetScopes.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the TargetScopes element diff --git a/src/XML/fed/TokenTypesOffered.php b/src/XML/fed/TokenTypesOffered.php index fd8015fa..1ca09eef 100644 --- a/src/XML/fed/TokenTypesOffered.php +++ b/src/XML/fed/TokenTypesOffered.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the TokenTypesOffered element diff --git a/src/XML/fed/WebBinding.php b/src/XML/fed/WebBinding.php index 01becc66..c4c54454 100644 --- a/src/XML/fed/WebBinding.php +++ b/src/XML/fed/WebBinding.php @@ -5,7 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractNestedPolicyType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A WebBinding element @@ -16,6 +17,7 @@ final class WebBinding extends AbstractNestedPolicyType implements SchemaValidat { use SchemaValidatableElementTrait; + /** @var string */ public const NS = AbstractFedElement::NS; diff --git a/src/XML/mssp/MustNotSendCancel.php b/src/XML/mssp/MustNotSendCancel.php index ed3209da..c6b8bcce 100644 --- a/src/XML/mssp/MustNotSendCancel.php +++ b/src/XML/mssp/MustNotSendCancel.php @@ -18,6 +18,7 @@ final class MustNotSendCancel extends AbstractQNameAssertionType implements Sche { use SchemaValidatableElementTrait; + /** @var string */ public const NS = C::NS_MSSP; diff --git a/src/XML/mssp/RequireClientCertificate.php b/src/XML/mssp/RequireClientCertificate.php index 3484957a..b553ea0f 100644 --- a/src/XML/mssp/RequireClientCertificate.php +++ b/src/XML/mssp/RequireClientCertificate.php @@ -18,6 +18,7 @@ final class RequireClientCertificate extends AbstractQNameAssertionType implemen { use SchemaValidatableElementTrait; + /** @var string */ public const NS = C::NS_MSSP; diff --git a/src/XML/mssp/RsaToken.php b/src/XML/mssp/RsaToken.php index f72042c1..e0d1f105 100644 --- a/src/XML/mssp/RsaToken.php +++ b/src/XML/mssp/RsaToken.php @@ -18,6 +18,7 @@ final class RsaToken extends AbstractTokenAssertionType implements SchemaValidat { use SchemaValidatableElementTrait; + /** @var string */ public const NS = C::NS_MSSP; diff --git a/src/XML/mssp/SslContextToken.php b/src/XML/mssp/SslContextToken.php index 97723ad1..05f826e7 100644 --- a/src/XML/mssp/SslContextToken.php +++ b/src/XML/mssp/SslContextToken.php @@ -18,6 +18,7 @@ final class SslContextToken extends AbstractTokenAssertionType implements Schema { use SchemaValidatableElementTrait; + /** @var string */ public const NS = C::NS_MSSP; diff --git a/src/XML/sp_200507/AbstractHeaderType.php b/src/XML/sp_200507/AbstractHeaderType.php index 74b4611d..8855d19e 100644 --- a/src/XML/sp_200507/AbstractHeaderType.php +++ b/src/XML/sp_200507/AbstractHeaderType.php @@ -8,9 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -23,6 +23,7 @@ abstract class AbstractHeaderType extends AbstractSpElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/sp_200507/AbstractHttpsTokenType.php b/src/XML/sp_200507/AbstractHttpsTokenType.php index 87e629ce..fad9d4fd 100644 --- a/src/XML/sp_200507/AbstractHttpsTokenType.php +++ b/src/XML/sp_200507/AbstractHttpsTokenType.php @@ -24,6 +24,7 @@ abstract class AbstractHttpsTokenType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractIssuedTokenType.php b/src/XML/sp_200507/AbstractIssuedTokenType.php index 6ad78faa..4d2e68b2 100644 --- a/src/XML/sp_200507/AbstractIssuedTokenType.php +++ b/src/XML/sp_200507/AbstractIssuedTokenType.php @@ -30,6 +30,7 @@ abstract class AbstractIssuedTokenType extends AbstractSpElement use ExtendableElementTrait; use IncludeTokenTypeTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractNestedPolicyType.php b/src/XML/sp_200507/AbstractNestedPolicyType.php index fd9bc97a..24f6ab2d 100644 --- a/src/XML/sp_200507/AbstractNestedPolicyType.php +++ b/src/XML/sp_200507/AbstractNestedPolicyType.php @@ -21,6 +21,7 @@ abstract class AbstractNestedPolicyType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractQNameAssertionType.php b/src/XML/sp_200507/AbstractQNameAssertionType.php index ca6db389..836d8eb9 100644 --- a/src/XML/sp_200507/AbstractQNameAssertionType.php +++ b/src/XML/sp_200507/AbstractQNameAssertionType.php @@ -6,8 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -21,6 +21,7 @@ abstract class AbstractQNameAssertionType extends AbstractSpElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php index 27f3b2fb..a33f7248 100644 --- a/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php @@ -6,11 +6,11 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; -use SimpleSAML\XMLSchema\XML\Constants\NS; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -24,6 +24,7 @@ abstract class AbstractRequestSecurityTokenTemplateType extends AbstractSpElemen use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractSePartsType.php b/src/XML/sp_200507/AbstractSePartsType.php index ab3f3799..7fe51c62 100644 --- a/src/XML/sp_200507/AbstractSePartsType.php +++ b/src/XML/sp_200507/AbstractSePartsType.php @@ -25,6 +25,7 @@ abstract class AbstractSePartsType extends AbstractSpElement use ExtendableElementTrait; use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractSecureConversationTokenType.php b/src/XML/sp_200507/AbstractSecureConversationTokenType.php index 5b11de02..29a36d64 100644 --- a/src/XML/sp_200507/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200507/AbstractSecureConversationTokenType.php @@ -28,6 +28,7 @@ abstract class AbstractSecureConversationTokenType extends AbstractSpElement use ExtendableElementTrait; use IncludeTokenTypeTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractSerElementsType.php b/src/XML/sp_200507/AbstractSerElementsType.php index 26a99264..efb777e4 100644 --- a/src/XML/sp_200507/AbstractSerElementsType.php +++ b/src/XML/sp_200507/AbstractSerElementsType.php @@ -10,8 +10,8 @@ use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -25,6 +25,7 @@ abstract class AbstractSerElementsType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php index 13d6f492..254f5727 100644 --- a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php @@ -28,6 +28,7 @@ abstract class AbstractSpnegoContextTokenType extends AbstractSpElement use ExtendableElementTrait; use IncludeTokenTypeTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/AbstractTokenAssertionType.php b/src/XML/sp_200507/AbstractTokenAssertionType.php index 8e1a4a74..7c8159f5 100644 --- a/src/XML/sp_200507/AbstractTokenAssertionType.php +++ b/src/XML/sp_200507/AbstractTokenAssertionType.php @@ -23,6 +23,7 @@ abstract class AbstractTokenAssertionType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200507/XPath.php b/src/XML/sp_200507/XPath.php index b726d2c3..0b186d5f 100644 --- a/src/XML/sp_200507/XPath.php +++ b/src/XML/sp_200507/XPath.php @@ -20,6 +20,7 @@ final class XPath extends AbstractSpElement { use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; diff --git a/src/XML/sp_200702/AbstractHeaderType.php b/src/XML/sp_200702/AbstractHeaderType.php index e37313b7..4375ee97 100644 --- a/src/XML/sp_200702/AbstractHeaderType.php +++ b/src/XML/sp_200702/AbstractHeaderType.php @@ -8,9 +8,9 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; use function sprintf; @@ -23,6 +23,7 @@ abstract class AbstractHeaderType extends AbstractSpElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/sp_200702/AbstractIssuedTokenType.php b/src/XML/sp_200702/AbstractIssuedTokenType.php index 4b117229..3c01096d 100644 --- a/src/XML/sp_200702/AbstractIssuedTokenType.php +++ b/src/XML/sp_200702/AbstractIssuedTokenType.php @@ -26,6 +26,7 @@ abstract class AbstractIssuedTokenType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractKeyValueTokenType.php b/src/XML/sp_200702/AbstractKeyValueTokenType.php index e583d255..6620712c 100644 --- a/src/XML/sp_200702/AbstractKeyValueTokenType.php +++ b/src/XML/sp_200702/AbstractKeyValueTokenType.php @@ -23,6 +23,7 @@ abstract class AbstractKeyValueTokenType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractNestedPolicyType.php b/src/XML/sp_200702/AbstractNestedPolicyType.php index ff113a19..831ebfad 100644 --- a/src/XML/sp_200702/AbstractNestedPolicyType.php +++ b/src/XML/sp_200702/AbstractNestedPolicyType.php @@ -21,6 +21,7 @@ abstract class AbstractNestedPolicyType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; @@ -41,7 +42,6 @@ final public function __construct(array $elements = [], array $attributes = []) } - /** * Test if an object, at the state it's in, would produce an empty XML-element * diff --git a/src/XML/sp_200702/AbstractQNameAssertionType.php b/src/XML/sp_200702/AbstractQNameAssertionType.php index 99c1883d..2dc13196 100644 --- a/src/XML/sp_200702/AbstractQNameAssertionType.php +++ b/src/XML/sp_200702/AbstractQNameAssertionType.php @@ -21,6 +21,7 @@ abstract class AbstractQNameAssertionType extends AbstractSpElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/sp_200702/AbstractReqPartsType.php b/src/XML/sp_200702/AbstractReqPartsType.php index c7ae9940..c0bbe0e0 100644 --- a/src/XML/sp_200702/AbstractReqPartsType.php +++ b/src/XML/sp_200702/AbstractReqPartsType.php @@ -24,6 +24,7 @@ abstract class AbstractReqPartsType extends AbstractSpElement use ExtendableElementTrait; use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php index 923fe501..fa841e8e 100644 --- a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php @@ -24,6 +24,7 @@ abstract class AbstractRequestSecurityTokenTemplateType extends AbstractSpElemen use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractSePartsType.php b/src/XML/sp_200702/AbstractSePartsType.php index 5d90f872..4078fb96 100644 --- a/src/XML/sp_200702/AbstractSePartsType.php +++ b/src/XML/sp_200702/AbstractSePartsType.php @@ -25,6 +25,7 @@ abstract class AbstractSePartsType extends AbstractSpElement use ExtendableElementTrait; use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractSecureConversationTokenType.php b/src/XML/sp_200702/AbstractSecureConversationTokenType.php index 2846f88f..ffad5124 100644 --- a/src/XML/sp_200702/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200702/AbstractSecureConversationTokenType.php @@ -24,6 +24,7 @@ abstract class AbstractSecureConversationTokenType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractSerElementsType.php b/src/XML/sp_200702/AbstractSerElementsType.php index ba2378bd..a656c486 100644 --- a/src/XML/sp_200702/AbstractSerElementsType.php +++ b/src/XML/sp_200702/AbstractSerElementsType.php @@ -25,6 +25,7 @@ abstract class AbstractSerElementsType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php index 6fcb08dc..3e5558d1 100644 --- a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php @@ -24,6 +24,7 @@ abstract class AbstractSpnegoContextTokenType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/sp_200702/AbstractTokenAssertionType.php b/src/XML/sp_200702/AbstractTokenAssertionType.php index 7b69f5ce..a8258724 100644 --- a/src/XML/sp_200702/AbstractTokenAssertionType.php +++ b/src/XML/sp_200702/AbstractTokenAssertionType.php @@ -23,6 +23,7 @@ abstract class AbstractTokenAssertionType extends AbstractSpElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsa_200408/AbstractAttributedQNameType.php b/src/XML/wsa_200408/AbstractAttributedQNameType.php index 6998d7c7..5d734a80 100644 --- a/src/XML/wsa_200408/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200408/AbstractAttributedQNameType.php @@ -26,6 +26,7 @@ abstract class AbstractAttributedQNameType extends AbstractWsaElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = QNameValue::class; diff --git a/src/XML/wsa_200408/AbstractEndpointReferenceType.php b/src/XML/wsa_200408/AbstractEndpointReferenceType.php index 7b6ecca7..a1fb2dfd 100644 --- a/src/XML/wsa_200408/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200408/AbstractEndpointReferenceType.php @@ -30,6 +30,7 @@ abstract class AbstractEndpointReferenceType extends AbstractWsaElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsa_200408/AbstractRelationshipType.php b/src/XML/wsa_200408/AbstractRelationshipType.php index 1133b468..270d8f1f 100644 --- a/src/XML/wsa_200408/AbstractRelationshipType.php +++ b/src/XML/wsa_200408/AbstractRelationshipType.php @@ -26,6 +26,7 @@ abstract class AbstractRelationshipType extends AbstractWsaElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; diff --git a/src/XML/wsa_200408/AbstractServiceNameType.php b/src/XML/wsa_200408/AbstractServiceNameType.php index 6d5abf6e..2a2644b1 100644 --- a/src/XML/wsa_200408/AbstractServiceNameType.php +++ b/src/XML/wsa_200408/AbstractServiceNameType.php @@ -27,6 +27,7 @@ abstract class AbstractServiceNameType extends AbstractWsaElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = QNameValue::class; diff --git a/src/XML/wsa_200408/ReferenceParameters.php b/src/XML/wsa_200408/ReferenceParameters.php index b89660bf..60e1c07e 100644 --- a/src/XML/wsa_200408/ReferenceParameters.php +++ b/src/XML/wsa_200408/ReferenceParameters.php @@ -19,6 +19,7 @@ final class ReferenceParameters extends AbstractWsaElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wsa_200408/ReferenceProperties.php b/src/XML/wsa_200408/ReferenceProperties.php index e3f8c246..d72275b5 100644 --- a/src/XML/wsa_200408/ReferenceProperties.php +++ b/src/XML/wsa_200408/ReferenceProperties.php @@ -19,6 +19,7 @@ final class ReferenceProperties extends AbstractWsaElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wsa_200508/AbstractAttributedURIType.php b/src/XML/wsa_200508/AbstractAttributedURIType.php index 4b969fdc..96826f11 100644 --- a/src/XML/wsa_200508/AbstractAttributedURIType.php +++ b/src/XML/wsa_200508/AbstractAttributedURIType.php @@ -25,6 +25,7 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; diff --git a/src/XML/wsa_200508/AbstractEndpointReferenceType.php b/src/XML/wsa_200508/AbstractEndpointReferenceType.php index f7b585fe..0b497104 100644 --- a/src/XML/wsa_200508/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200508/AbstractEndpointReferenceType.php @@ -30,6 +30,7 @@ abstract class AbstractEndpointReferenceType extends AbstractWsaElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsa_200508/AbstractProblemActionType.php b/src/XML/wsa_200508/AbstractProblemActionType.php index 52141c33..84487698 100644 --- a/src/XML/wsa_200508/AbstractProblemActionType.php +++ b/src/XML/wsa_200508/AbstractProblemActionType.php @@ -21,6 +21,7 @@ abstract class AbstractProblemActionType extends AbstractWsaElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsa_200508/Metadata.php b/src/XML/wsa_200508/Metadata.php index 54840cf1..2381df71 100644 --- a/src/XML/wsa_200508/Metadata.php +++ b/src/XML/wsa_200508/Metadata.php @@ -24,6 +24,7 @@ final class Metadata extends AbstractWsaElement implements SchemaValidatableElem use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wsa_200508/ProblemAction.php b/src/XML/wsa_200508/ProblemAction.php index f32d4708..5567bb82 100644 --- a/src/XML/wsa_200508/ProblemAction.php +++ b/src/XML/wsa_200508/ProblemAction.php @@ -22,6 +22,7 @@ final class ProblemAction extends AbstractProblemActionType implements SchemaVal { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * diff --git a/src/XML/wsa_200508/ReferenceParameters.php b/src/XML/wsa_200508/ReferenceParameters.php index 8fa28fe1..7e51ee70 100644 --- a/src/XML/wsa_200508/ReferenceParameters.php +++ b/src/XML/wsa_200508/ReferenceParameters.php @@ -24,6 +24,7 @@ final class ReferenceParameters extends AbstractWsaElement implements SchemaVali use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wsa_200508/RelatesTo.php b/src/XML/wsa_200508/RelatesTo.php index b76da147..991a05d8 100644 --- a/src/XML/wsa_200508/RelatesTo.php +++ b/src/XML/wsa_200508/RelatesTo.php @@ -26,6 +26,7 @@ final class RelatesTo extends AbstractWsaElement implements SchemaValidatableEle use SchemaValidatableElementTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; diff --git a/src/XML/wsaw/AbstractAttributedQNameType.php b/src/XML/wsaw/AbstractAttributedQNameType.php index 1e4f8717..bef3b263 100644 --- a/src/XML/wsaw/AbstractAttributedQNameType.php +++ b/src/XML/wsaw/AbstractAttributedQNameType.php @@ -7,8 +7,8 @@ use DOMElement; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\XML\Constants\NS; /** * Abstract class defining the AttributedQName type @@ -20,6 +20,7 @@ abstract class AbstractAttributedQNameType extends AbstractWsawElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsaw/AbstractServiceNameType.php b/src/XML/wsaw/AbstractServiceNameType.php index aaeff1e6..5cfcb668 100644 --- a/src/XML/wsaw/AbstractServiceNameType.php +++ b/src/XML/wsaw/AbstractServiceNameType.php @@ -5,7 +5,6 @@ namespace SimpleSAML\WSSecurity\XML\wsaw; use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -22,6 +21,7 @@ abstract class AbstractServiceNameType extends AbstractWsawElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsaw/ActionTrait.php b/src/XML/wsaw/ActionTrait.php index 73a115d4..551a573a 100644 --- a/src/XML/wsaw/ActionTrait.php +++ b/src/XML/wsaw/ActionTrait.php @@ -4,7 +4,6 @@ namespace SimpleSAML\WSSecurity\XML\wsaw; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XMLSchema\Type\AnyURIValue; /** diff --git a/src/XML/wsaw/Anonymous.php b/src/XML/wsaw/Anonymous.php index 5d9dbc58..157a642c 100644 --- a/src/XML/wsaw/Anonymous.php +++ b/src/XML/wsaw/Anonymous.php @@ -9,9 +9,9 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; -use SimpleSAML\XMLSchema\XML\Constants\NS; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\SchemaViolationException; +use SimpleSAML\XMLSchema\XML\Constants\NS; use ValueError; use function sprintf; @@ -26,6 +26,7 @@ final class Anonymous extends AbstractAnonymousType implements SchemaValidatable use ExtendableAttributesTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsaw/InterfaceName.php b/src/XML/wsaw/InterfaceName.php index 963e6256..944c3ce4 100644 --- a/src/XML/wsaw/InterfaceName.php +++ b/src/XML/wsaw/InterfaceName.php @@ -20,6 +20,7 @@ final class InterfaceName extends AbstractAttributedQNameType implements SchemaV { use SchemaValidatableElementTrait; + /** * Create an instance of this object from its XML representation. * diff --git a/src/XML/wsaw/ServiceName.php b/src/XML/wsaw/ServiceName.php index b50c3ae0..5972edec 100644 --- a/src/XML/wsaw/ServiceName.php +++ b/src/XML/wsaw/ServiceName.php @@ -21,6 +21,7 @@ final class ServiceName extends AbstractServiceNameType implements SchemaValidat { use SchemaValidatableElementTrait; + /** * Create an instance of this object from its XML representation. * diff --git a/src/XML/wsaw/UsingAddressing.php b/src/XML/wsaw/UsingAddressing.php index 090bf223..10661a8d 100644 --- a/src/XML/wsaw/UsingAddressing.php +++ b/src/XML/wsaw/UsingAddressing.php @@ -22,6 +22,7 @@ final class UsingAddressing extends AbstractWsawElement implements SchemaValidat use ExtendableAttributesTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsp/AbstractOperatorContentType.php b/src/XML/wsp/AbstractOperatorContentType.php index 02927a7a..d17aaa93 100644 --- a/src/XML/wsp/AbstractOperatorContentType.php +++ b/src/XML/wsp/AbstractOperatorContentType.php @@ -25,6 +25,7 @@ abstract class AbstractOperatorContentType extends AbstractWspElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsp/AppliesTo.php b/src/XML/wsp/AppliesTo.php index e4eb99cb..71404da6 100644 --- a/src/XML/wsp/AppliesTo.php +++ b/src/XML/wsp/AppliesTo.php @@ -24,6 +24,7 @@ final class AppliesTo extends AbstractWspElement implements SchemaValidatableEle use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wsp/Policy.php b/src/XML/wsp/Policy.php index b9974c23..8638f05b 100644 --- a/src/XML/wsp/Policy.php +++ b/src/XML/wsp/Policy.php @@ -13,7 +13,6 @@ use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -27,6 +26,7 @@ final class Policy extends AbstractOperatorContentType implements SchemaValidata use ExtendableAttributesTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/wsp/PolicyAttachment.php b/src/XML/wsp/PolicyAttachment.php index b32e2c10..73f2fe61 100644 --- a/src/XML/wsp/PolicyAttachment.php +++ b/src/XML/wsp/PolicyAttachment.php @@ -31,6 +31,7 @@ final class PolicyAttachment extends AbstractWspElement implements SchemaValidat use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsp/PolicyReference.php b/src/XML/wsp/PolicyReference.php index 69b2a35a..04992410 100644 --- a/src/XML/wsp/PolicyReference.php +++ b/src/XML/wsp/PolicyReference.php @@ -10,13 +10,10 @@ use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use function str_replace; - /** * Class defining the PolicyReference element * @@ -27,6 +24,7 @@ final class PolicyReference extends AbstractWspElement implements SchemaValidata use ExtendableAttributesTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; diff --git a/src/XML/wsp/PolicyURIsTrait.php b/src/XML/wsp/PolicyURIsTrait.php index 7118f446..9d575b83 100644 --- a/src/XML/wsp/PolicyURIsTrait.php +++ b/src/XML/wsp/PolicyURIsTrait.php @@ -4,9 +4,7 @@ namespace SimpleSAML\WSSecurity\XML\wsp; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; /** * Trait grouping common functionality for elements that can hold a PolicyURIs attribute. @@ -19,17 +17,17 @@ trait PolicyURIsTrait /** * The PolicyURIs. * - * @var \SimpleSAML\XMLSchema\Type\AnyURIValue[] + * @var \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue */ - protected array $PolicyURIs; + protected AnyURIListValue $PolicyURIs; /** * Collect the value of the PolicyURIs-property * - * @return \SimpleSAML\XMLSchema\Type\AnyURIValue[] + * @return \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue */ - public function getPolicyURIs(): array + public function getPolicyURIs(): AnyURIListValue { return $this->PolicyURIs; } @@ -38,11 +36,10 @@ public function getPolicyURIs(): array /** * Set the value of the PolicyURIs-property * - * @param \SimpleSAML\XMLSchema\Type\AnyURIValue[] $PolicyURIs + * @param \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue $PolicyURIs */ - protected function setPolicyURIs(array $PolicyURIs): void + protected function setPolicyURIs(AnyURIListValue $PolicyURIs): void { - Assert::allIsInstanceOf($PolicyURIs, AnyURIValue::class, SchemaViolationException::class); $this->PolicyURIs = $PolicyURIs; } } diff --git a/src/XML/wsse/AbstractBinarySecurityTokenType.php b/src/XML/wsse/AbstractBinarySecurityTokenType.php index b26a288b..064e7f16 100644 --- a/src/XML/wsse/AbstractBinarySecurityTokenType.php +++ b/src/XML/wsse/AbstractBinarySecurityTokenType.php @@ -7,10 +7,9 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; -use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Constants\NS; diff --git a/src/XML/wsse/AbstractReferenceType.php b/src/XML/wsse/AbstractReferenceType.php index 9abdc8a6..5e5ab11e 100644 --- a/src/XML/wsse/AbstractReferenceType.php +++ b/src/XML/wsse/AbstractReferenceType.php @@ -7,8 +7,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; -use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; /** diff --git a/src/XML/wst_200512/AbstractAuthenticatorType.php b/src/XML/wst_200512/AbstractAuthenticatorType.php index 4d8aee28..b31d796d 100644 --- a/src/XML/wst_200512/AbstractAuthenticatorType.php +++ b/src/XML/wst_200512/AbstractAuthenticatorType.php @@ -21,6 +21,7 @@ abstract class AbstractAuthenticatorType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wst_200512/AbstractBinaryExchangeType.php b/src/XML/wst_200512/AbstractBinaryExchangeType.php index 407f7a78..5ab217c6 100644 --- a/src/XML/wst_200512/AbstractBinaryExchangeType.php +++ b/src/XML/wst_200512/AbstractBinaryExchangeType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Constants\NS; diff --git a/src/XML/wst_200512/AbstractBinarySecretType.php b/src/XML/wst_200512/AbstractBinarySecretType.php index a2d9c01f..40f3a045 100644 --- a/src/XML/wst_200512/AbstractBinarySecretType.php +++ b/src/XML/wst_200512/AbstractBinarySecretType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; use SimpleSAML\XMLSchema\XML\Constants\NS; diff --git a/src/XML/wst_200512/AbstractCancelTargetType.php b/src/XML/wst_200512/AbstractCancelTargetType.php index 3a0939a8..9b52f0b3 100644 --- a/src/XML/wst_200512/AbstractCancelTargetType.php +++ b/src/XML/wst_200512/AbstractCancelTargetType.php @@ -24,6 +24,7 @@ abstract class AbstractCancelTargetType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wst_200512/AbstractClaimsType.php b/src/XML/wst_200512/AbstractClaimsType.php index 42ff681b..c60d3167 100644 --- a/src/XML/wst_200512/AbstractClaimsType.php +++ b/src/XML/wst_200512/AbstractClaimsType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -23,6 +22,7 @@ abstract class AbstractClaimsType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php index 87191c96..f69e1fa8 100644 --- a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php @@ -18,6 +18,7 @@ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement { use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIListValue::class; } diff --git a/src/XML/wst_200512/AbstractDelegateToType.php b/src/XML/wst_200512/AbstractDelegateToType.php index a4aa4293..39c9d0be 100644 --- a/src/XML/wst_200512/AbstractDelegateToType.php +++ b/src/XML/wst_200512/AbstractDelegateToType.php @@ -22,6 +22,7 @@ abstract class AbstractDelegateToType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractEncryptionType.php b/src/XML/wst_200512/AbstractEncryptionType.php index 61b04258..d857a7ce 100644 --- a/src/XML/wst_200512/AbstractEncryptionType.php +++ b/src/XML/wst_200512/AbstractEncryptionType.php @@ -22,6 +22,7 @@ abstract class AbstractEncryptionType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractEntropyType.php b/src/XML/wst_200512/AbstractEntropyType.php index 5dc39cd4..24ac0ba3 100644 --- a/src/XML/wst_200512/AbstractEntropyType.php +++ b/src/XML/wst_200512/AbstractEntropyType.php @@ -21,6 +21,7 @@ abstract class AbstractEntropyType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractKeyExchangeTokenType.php b/src/XML/wst_200512/AbstractKeyExchangeTokenType.php index 91752ee8..64cb8f6c 100644 --- a/src/XML/wst_200512/AbstractKeyExchangeTokenType.php +++ b/src/XML/wst_200512/AbstractKeyExchangeTokenType.php @@ -19,6 +19,7 @@ abstract class AbstractKeyExchangeTokenType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractOnBehalfOfType.php b/src/XML/wst_200512/AbstractOnBehalfOfType.php index d7bfeb19..178f7e9b 100644 --- a/src/XML/wst_200512/AbstractOnBehalfOfType.php +++ b/src/XML/wst_200512/AbstractOnBehalfOfType.php @@ -22,6 +22,7 @@ abstract class AbstractOnBehalfOfType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractParticipantType.php b/src/XML/wst_200512/AbstractParticipantType.php index c176113c..079d9450 100644 --- a/src/XML/wst_200512/AbstractParticipantType.php +++ b/src/XML/wst_200512/AbstractParticipantType.php @@ -22,6 +22,7 @@ abstract class AbstractParticipantType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractParticipantsType.php b/src/XML/wst_200512/AbstractParticipantsType.php index d232e46b..506f796c 100644 --- a/src/XML/wst_200512/AbstractParticipantsType.php +++ b/src/XML/wst_200512/AbstractParticipantsType.php @@ -20,6 +20,7 @@ abstract class AbstractParticipantsType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wst_200512/AbstractProofEncryptionType.php b/src/XML/wst_200512/AbstractProofEncryptionType.php index ee4b1a0e..75fc72b4 100644 --- a/src/XML/wst_200512/AbstractProofEncryptionType.php +++ b/src/XML/wst_200512/AbstractProofEncryptionType.php @@ -22,6 +22,7 @@ abstract class AbstractProofEncryptionType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractRenewTargetType.php b/src/XML/wst_200512/AbstractRenewTargetType.php index 4fc2a5ff..9db10b5b 100644 --- a/src/XML/wst_200512/AbstractRenewTargetType.php +++ b/src/XML/wst_200512/AbstractRenewTargetType.php @@ -24,6 +24,7 @@ abstract class AbstractRenewTargetType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php index ad6b9d24..0f105f3d 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseCollectionType.php @@ -21,6 +21,7 @@ abstract class AbstractRequestSecurityTokenResponseCollectionType extends Abstra { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php index a4a0b336..d7487334 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenResponseType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -23,6 +22,7 @@ abstract class AbstractRequestSecurityTokenResponseType extends AbstractWstEleme use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractRequestSecurityTokenType.php b/src/XML/wst_200512/AbstractRequestSecurityTokenType.php index 19623e29..57074123 100644 --- a/src/XML/wst_200512/AbstractRequestSecurityTokenType.php +++ b/src/XML/wst_200512/AbstractRequestSecurityTokenType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -25,6 +24,7 @@ abstract class AbstractRequestSecurityTokenType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractRequestedProofTokenType.php b/src/XML/wst_200512/AbstractRequestedProofTokenType.php index 3aae090b..de9a882d 100644 --- a/src/XML/wst_200512/AbstractRequestedProofTokenType.php +++ b/src/XML/wst_200512/AbstractRequestedProofTokenType.php @@ -22,6 +22,7 @@ abstract class AbstractRequestedProofTokenType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php b/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php index c2cf80b5..6b1a8629 100644 --- a/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php +++ b/src/XML/wst_200512/AbstractRequestedSecurityTokenType.php @@ -24,6 +24,7 @@ abstract class AbstractRequestedSecurityTokenType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractSignChallengeType.php b/src/XML/wst_200512/AbstractSignChallengeType.php index 6f7dc759..59961500 100644 --- a/src/XML/wst_200512/AbstractSignChallengeType.php +++ b/src/XML/wst_200512/AbstractSignChallengeType.php @@ -23,6 +23,7 @@ abstract class AbstractSignChallengeType extends AbstractWstElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php index 08cd30fa..bf546802 100644 --- a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php @@ -18,6 +18,7 @@ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement { use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIListValue::class; } diff --git a/src/XML/wst_200512/AbstractUseKeyType.php b/src/XML/wst_200512/AbstractUseKeyType.php index 0e8dcb9e..d2fc365b 100644 --- a/src/XML/wst_200512/AbstractUseKeyType.php +++ b/src/XML/wst_200512/AbstractUseKeyType.php @@ -9,7 +9,6 @@ use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\SerializableElementInterface; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -23,6 +22,7 @@ abstract class AbstractUseKeyType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::ANY; diff --git a/src/XML/wst_200512/AbstractValidateTargetType.php b/src/XML/wst_200512/AbstractValidateTargetType.php index 8848c4a5..0071e78b 100644 --- a/src/XML/wst_200512/AbstractValidateTargetType.php +++ b/src/XML/wst_200512/AbstractValidateTargetType.php @@ -24,6 +24,7 @@ abstract class AbstractValidateTargetType extends AbstractWstElement { use ExtendableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wst_200512/AllowPostdating.php b/src/XML/wst_200512/AllowPostdating.php index b435b431..11726f3d 100644 --- a/src/XML/wst_200512/AllowPostdating.php +++ b/src/XML/wst_200512/AllowPostdating.php @@ -19,6 +19,7 @@ final class AllowPostdating extends AbstractWstElement implements SchemaValidata { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * diff --git a/src/XML/wst_200512/AuthenticationType.php b/src/XML/wst_200512/AuthenticationType.php index c8b5e075..c58c43c2 100644 --- a/src/XML/wst_200512/AuthenticationType.php +++ b/src/XML/wst_200512/AuthenticationType.php @@ -8,6 +8,7 @@ use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\AnyURIValue; + /** * A AuthenticationType element * diff --git a/src/XML/wst_200512/Authenticator.php b/src/XML/wst_200512/Authenticator.php index 9e3e95ef..1bac186e 100644 --- a/src/XML/wst_200512/Authenticator.php +++ b/src/XML/wst_200512/Authenticator.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Authenticator element diff --git a/src/XML/wst_200512/BinaryExchange.php b/src/XML/wst_200512/BinaryExchange.php index 52058c98..e2f34cd5 100644 --- a/src/XML/wst_200512/BinaryExchange.php +++ b/src/XML/wst_200512/BinaryExchange.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A BinaryExchange element diff --git a/src/XML/wst_200512/BinarySecret.php b/src/XML/wst_200512/BinarySecret.php index b97b9d01..5dda60ca 100644 --- a/src/XML/wst_200512/BinarySecret.php +++ b/src/XML/wst_200512/BinarySecret.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A BinarySecret element diff --git a/src/XML/wst_200512/CancelTarget.php b/src/XML/wst_200512/CancelTarget.php index 5ed46f1b..a26a61f9 100644 --- a/src/XML/wst_200512/CancelTarget.php +++ b/src/XML/wst_200512/CancelTarget.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A CancelTarget element diff --git a/src/XML/wst_200512/Challenge.php b/src/XML/wst_200512/Challenge.php index 0558e150..28dc56c1 100644 --- a/src/XML/wst_200512/Challenge.php +++ b/src/XML/wst_200512/Challenge.php @@ -19,6 +19,7 @@ final class Challenge extends AbstractWstElement implements SchemaValidatableEle use SchemaValidatableElementTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/wst_200512/Claims.php b/src/XML/wst_200512/Claims.php index 3d1cb14b..410b4e3f 100644 --- a/src/XML/wst_200512/Claims.php +++ b/src/XML/wst_200512/Claims.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Claims element diff --git a/src/XML/wst_200512/ComputedKey.php b/src/XML/wst_200512/ComputedKey.php index 26b22a20..b7a76a19 100644 --- a/src/XML/wst_200512/ComputedKey.php +++ b/src/XML/wst_200512/ComputedKey.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ComputedKey element diff --git a/src/XML/wst_200512/ComputedKeyAlgorithm.php b/src/XML/wst_200512/ComputedKeyAlgorithm.php index 7135e79f..680d59f3 100644 --- a/src/XML/wst_200512/ComputedKeyAlgorithm.php +++ b/src/XML/wst_200512/ComputedKeyAlgorithm.php @@ -19,6 +19,7 @@ final class ComputedKeyAlgorithm extends AbstractWstElement implements SchemaVal use SchemaValidatableElementTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/Delegatable.php b/src/XML/wst_200512/Delegatable.php index ef8fca01..3146abf9 100644 --- a/src/XML/wst_200512/Delegatable.php +++ b/src/XML/wst_200512/Delegatable.php @@ -4,9 +4,9 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; +use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\BooleanValue; /** diff --git a/src/XML/wst_200512/DelegateTo.php b/src/XML/wst_200512/DelegateTo.php index 39ff0126..46f5b095 100644 --- a/src/XML/wst_200512/DelegateTo.php +++ b/src/XML/wst_200512/DelegateTo.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A DelegateTo element diff --git a/src/XML/wst_200512/Encryption.php b/src/XML/wst_200512/Encryption.php index 2636a465..f1beb26b 100644 --- a/src/XML/wst_200512/Encryption.php +++ b/src/XML/wst_200512/Encryption.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Encryption element diff --git a/src/XML/wst_200512/Entropy.php b/src/XML/wst_200512/Entropy.php index 95e157e6..0f0cec6a 100644 --- a/src/XML/wst_200512/Entropy.php +++ b/src/XML/wst_200512/Entropy.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Entropy element diff --git a/src/XML/wst_200512/IssuedTokens.php b/src/XML/wst_200512/IssuedTokens.php index be0b8404..e15d6fe2 100644 --- a/src/XML/wst_200512/IssuedTokens.php +++ b/src/XML/wst_200512/IssuedTokens.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A IssuedTokens element diff --git a/src/XML/wst_200512/Issuer.php b/src/XML/wst_200512/Issuer.php index c9770354..c1025aad 100644 --- a/src/XML/wst_200512/Issuer.php +++ b/src/XML/wst_200512/Issuer.php @@ -6,7 +6,8 @@ use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractEndpointReferenceType; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An Issuer element @@ -17,6 +18,7 @@ final class Issuer extends AbstractEndpointReferenceType implements SchemaValida { use SchemaValidatableElementTrait; + /** @var string */ public const NS = C::NS_TRUST_200512; diff --git a/src/XML/wst_200512/KeyExchangeToken.php b/src/XML/wst_200512/KeyExchangeToken.php index 5ba195a5..fe69e5d5 100644 --- a/src/XML/wst_200512/KeyExchangeToken.php +++ b/src/XML/wst_200512/KeyExchangeToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A KeyEchangeToken element diff --git a/src/XML/wst_200512/KeySize.php b/src/XML/wst_200512/KeySize.php index 3512c409..eb3b31bc 100644 --- a/src/XML/wst_200512/KeySize.php +++ b/src/XML/wst_200512/KeySize.php @@ -4,8 +4,6 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\XML\Exception\SchemaViolationException; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; use SimpleSAML\XML\TypedTextContentTrait; diff --git a/src/XML/wst_200512/KeyType.php b/src/XML/wst_200512/KeyType.php index 3e6c5364..f1723393 100644 --- a/src/XML/wst_200512/KeyType.php +++ b/src/XML/wst_200512/KeyType.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A KeyType element diff --git a/src/XML/wst_200512/Lifetime.php b/src/XML/wst_200512/Lifetime.php index 0f1d38b7..d149ba31 100644 --- a/src/XML/wst_200512/Lifetime.php +++ b/src/XML/wst_200512/Lifetime.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Lifetime element diff --git a/src/XML/wst_200512/OnBehalfOf.php b/src/XML/wst_200512/OnBehalfOf.php index ad435c68..a89296de 100644 --- a/src/XML/wst_200512/OnBehalfOf.php +++ b/src/XML/wst_200512/OnBehalfOf.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A OnBehalfOf element diff --git a/src/XML/wst_200512/Participants.php b/src/XML/wst_200512/Participants.php index 345ae72e..f54148b3 100644 --- a/src/XML/wst_200512/Participants.php +++ b/src/XML/wst_200512/Participants.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Participants element diff --git a/src/XML/wst_200512/ProofEncryption.php b/src/XML/wst_200512/ProofEncryption.php index 4313d424..91f491a5 100644 --- a/src/XML/wst_200512/ProofEncryption.php +++ b/src/XML/wst_200512/ProofEncryption.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ProofEncryption element diff --git a/src/XML/wst_200512/RenewTarget.php b/src/XML/wst_200512/RenewTarget.php index 4c217820..2938b786 100644 --- a/src/XML/wst_200512/RenewTarget.php +++ b/src/XML/wst_200512/RenewTarget.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RenewTarget element diff --git a/src/XML/wst_200512/Renewing.php b/src/XML/wst_200512/Renewing.php index 2a76a61e..6c5e67a0 100644 --- a/src/XML/wst_200512/Renewing.php +++ b/src/XML/wst_200512/Renewing.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Renewing element diff --git a/src/XML/wst_200512/RequestKET.php b/src/XML/wst_200512/RequestKET.php index 228132f7..ed452ea0 100644 --- a/src/XML/wst_200512/RequestKET.php +++ b/src/XML/wst_200512/RequestKET.php @@ -19,6 +19,7 @@ final class RequestKET extends AbstractWstElement implements SchemaValidatableEl { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * diff --git a/src/XML/wst_200512/RequestSecurityToken.php b/src/XML/wst_200512/RequestSecurityToken.php index 87ea8ef7..a480a22b 100644 --- a/src/XML/wst_200512/RequestSecurityToken.php +++ b/src/XML/wst_200512/RequestSecurityToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityToken element diff --git a/src/XML/wst_200512/RequestSecurityTokenCollection.php b/src/XML/wst_200512/RequestSecurityTokenCollection.php index fbe43e20..42b4b92d 100644 --- a/src/XML/wst_200512/RequestSecurityTokenCollection.php +++ b/src/XML/wst_200512/RequestSecurityTokenCollection.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityTokenCollection element diff --git a/src/XML/wst_200512/RequestSecurityTokenResponse.php b/src/XML/wst_200512/RequestSecurityTokenResponse.php index e9f5e82f..eaa2252b 100644 --- a/src/XML/wst_200512/RequestSecurityTokenResponse.php +++ b/src/XML/wst_200512/RequestSecurityTokenResponse.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityTokenResponse element diff --git a/src/XML/wst_200512/RequestSecurityTokenResponseCollection.php b/src/XML/wst_200512/RequestSecurityTokenResponseCollection.php index 50d617ff..0ca4756d 100644 --- a/src/XML/wst_200512/RequestSecurityTokenResponseCollection.php +++ b/src/XML/wst_200512/RequestSecurityTokenResponseCollection.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestSecurityTokenResponseCollection element diff --git a/src/XML/wst_200512/RequestType.php b/src/XML/wst_200512/RequestType.php index 6923fd0d..c37bb888 100644 --- a/src/XML/wst_200512/RequestType.php +++ b/src/XML/wst_200512/RequestType.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestType element diff --git a/src/XML/wst_200512/RequestedAttachedReference.php b/src/XML/wst_200512/RequestedAttachedReference.php index f2fabafe..b35cb2a6 100644 --- a/src/XML/wst_200512/RequestedAttachedReference.php +++ b/src/XML/wst_200512/RequestedAttachedReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedAttachedReference element diff --git a/src/XML/wst_200512/RequestedProofToken.php b/src/XML/wst_200512/RequestedProofToken.php index 8beed89a..6ddcf8a9 100644 --- a/src/XML/wst_200512/RequestedProofToken.php +++ b/src/XML/wst_200512/RequestedProofToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedProofToken element diff --git a/src/XML/wst_200512/RequestedSecurityToken.php b/src/XML/wst_200512/RequestedSecurityToken.php index 7ad4ff47..83ec8209 100644 --- a/src/XML/wst_200512/RequestedSecurityToken.php +++ b/src/XML/wst_200512/RequestedSecurityToken.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedSecurityToken element diff --git a/src/XML/wst_200512/RequestedTokenCancelled.php b/src/XML/wst_200512/RequestedTokenCancelled.php index 521933f7..1ea2c4dd 100644 --- a/src/XML/wst_200512/RequestedTokenCancelled.php +++ b/src/XML/wst_200512/RequestedTokenCancelled.php @@ -19,6 +19,7 @@ final class RequestedTokenCancelled extends AbstractWstElement implements Schema { use SchemaValidatableElementTrait; + /** * Convert XML into a class instance * diff --git a/src/XML/wst_200512/RequestedUnattachedReference.php b/src/XML/wst_200512/RequestedUnattachedReference.php index 4cd0bdc2..0fbc0fc8 100644 --- a/src/XML/wst_200512/RequestedUnattachedReference.php +++ b/src/XML/wst_200512/RequestedUnattachedReference.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A RequestedUnattachedReference element diff --git a/src/XML/wst_200512/SignChallenge.php b/src/XML/wst_200512/SignChallenge.php index 6b61b67e..aa80dcd9 100644 --- a/src/XML/wst_200512/SignChallenge.php +++ b/src/XML/wst_200512/SignChallenge.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignChallenge element diff --git a/src/XML/wst_200512/SignChallengeResponse.php b/src/XML/wst_200512/SignChallengeResponse.php index 2310758d..7723e28b 100644 --- a/src/XML/wst_200512/SignChallengeResponse.php +++ b/src/XML/wst_200512/SignChallengeResponse.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * An SignChallengeResponse element diff --git a/src/XML/wst_200512/Status.php b/src/XML/wst_200512/Status.php index 165d54ea..4fd2bb8b 100644 --- a/src/XML/wst_200512/Status.php +++ b/src/XML/wst_200512/Status.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A Status element diff --git a/src/XML/wst_200512/UseKey.php b/src/XML/wst_200512/UseKey.php index fdd36bc8..0aadbddc 100644 --- a/src/XML/wst_200512/UseKey.php +++ b/src/XML/wst_200512/UseKey.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A UseKey element diff --git a/src/XML/wst_200512/ValidateTarget.php b/src/XML/wst_200512/ValidateTarget.php index 10037d76..ae8bf58f 100644 --- a/src/XML/wst_200512/ValidateTarget.php +++ b/src/XML/wst_200512/ValidateTarget.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * A ValidateTarget element diff --git a/src/XML/wsu/AbstractAttributedDateTime.php b/src/XML/wsu/AbstractAttributedDateTime.php index 33df51d9..16a07f0f 100644 --- a/src/XML/wsu/AbstractAttributedDateTime.php +++ b/src/XML/wsu/AbstractAttributedDateTime.php @@ -6,11 +6,8 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; -use SimpleSAML\WSSecurity\Constants as C; -use SimpleSAML\WSSecurity\Exception\ProtocolViolationException; -use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; -use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -24,6 +21,7 @@ abstract class AbstractAttributedDateTime extends AbstractWsuElement { use ExtendableAttributesTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsu/AbstractAttributedURI.php b/src/XML/wsu/AbstractAttributedURI.php index d91c7f00..a5819923 100644 --- a/src/XML/wsu/AbstractAttributedURI.php +++ b/src/XML/wsu/AbstractAttributedURI.php @@ -7,7 +7,6 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -24,6 +23,7 @@ abstract class AbstractAttributedURI extends AbstractWsuElement use ExtendableAttributesTrait; use TypedTextContentTrait; + /** @var string */ public const TEXTCONTENT_TYPE = AnyURIValue::class; diff --git a/src/XML/wsu/AbstractTimestamp.php b/src/XML/wsu/AbstractTimestamp.php index 20081f44..09d23039 100644 --- a/src/XML/wsu/AbstractTimestamp.php +++ b/src/XML/wsu/AbstractTimestamp.php @@ -7,7 +7,6 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -25,6 +24,7 @@ abstract class AbstractTimestamp extends AbstractWsuElement use ExtendableAttributesTrait; use ExtendableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsu/Created.php b/src/XML/wsu/Created.php index 2d30ad97..69d99b38 100644 --- a/src/XML/wsu/Created.php +++ b/src/XML/wsu/Created.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsu; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Created element diff --git a/src/XML/wsu/Expires.php b/src/XML/wsu/Expires.php index 0eaec2fa..5d4fa8b0 100644 --- a/src/XML/wsu/Expires.php +++ b/src/XML/wsu/Expires.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsu; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Expires element diff --git a/src/XML/wsu/Timestamp.php b/src/XML/wsu/Timestamp.php index 9999b231..15054b35 100644 --- a/src/XML/wsu/Timestamp.php +++ b/src/XML/wsu/Timestamp.php @@ -4,7 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wsu; -use SimpleSAML\XML\{SchemaValidatableElementInterface, SchemaValidatableElementTrait}; +use SimpleSAML\XML\SchemaValidatableElementInterface; +use SimpleSAML\XML\SchemaValidatableElementTrait; /** * Class defining the Timestamp element diff --git a/src/XML/wsu/Type/DateTimeValue.php b/src/XML/wsu/Type/DateTimeValue.php index 9f8a58dc..eeae968b 100644 --- a/src/XML/wsu/Type/DateTimeValue.php +++ b/src/XML/wsu/Type/DateTimeValue.php @@ -13,7 +13,10 @@ */ class DateTimeValue extends BaseDateTimeValue { - // Lowercase p as opposed to the base-class to covert the timestamp to UTC as demanded by the WSSecurity specifications + /** + * Lowercase p as opposed to the base-class to covert the timestamp to UTC as required + * by the WSSecurity specifications + */ public const DATETIME_FORMAT = 'Y-m-d\\TH:i:sp'; diff --git a/src/XML/wsx/GetMetadata.php b/src/XML/wsx/GetMetadata.php index 9a580660..b9846f28 100644 --- a/src/XML/wsx/GetMetadata.php +++ b/src/XML/wsx/GetMetadata.php @@ -25,6 +25,7 @@ final class GetMetadata extends AbstractWsxElement implements SchemaValidatableE use ExtendableAttributesTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsx/Metadata.php b/src/XML/wsx/Metadata.php index 2d37bb93..3eb5f351 100644 --- a/src/XML/wsx/Metadata.php +++ b/src/XML/wsx/Metadata.php @@ -24,6 +24,7 @@ final class Metadata extends AbstractWsxElement implements SchemaValidatableElem use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsx/MetadataReference.php b/src/XML/wsx/MetadataReference.php index 795c9a80..75cab2c1 100644 --- a/src/XML/wsx/MetadataReference.php +++ b/src/XML/wsx/MetadataReference.php @@ -23,6 +23,7 @@ final class MetadataReference extends AbstractWsxElement implements SchemaValida use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:any element */ public const XS_ANY_ELT_NAMESPACE = NS::OTHER; diff --git a/src/XML/wsx/MetadataSection.php b/src/XML/wsx/MetadataSection.php index b97f7a53..f7b6d296 100644 --- a/src/XML/wsx/MetadataSection.php +++ b/src/XML/wsx/MetadataSection.php @@ -31,6 +31,7 @@ final class MetadataSection extends AbstractWsxElement implements SchemaValidata use ExtendableElementTrait; use SchemaValidatableElementTrait; + /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; From 4072268db764ad2a87294834cb58f7a5aa321ca4 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 6 Dec 2025 21:17:52 +0100 Subject: [PATCH 24/34] Migrate to xsd-types --- src/XML/sp_200507/AbstractIssuedTokenType.php | 22 ++++-------------- .../AbstractSecureConversationTokenType.php | 22 ++++-------------- .../AbstractSpnegoContextTokenType.php | 21 ++++------------- src/XML/sp_200507/IncludeTokenTypeTrait.php | 20 ++++++---------- src/XML/sp_200507/Type/IncludeTokenValue.php | 23 +++++++++++++++++++ src/XML/sp_200702/IncludeTokenTypeTrait.php | 20 ++++++---------- src/XML/sp_200702/Type/IncludeTokenValue.php | 23 +++++++++++++++++++ ...auth_ConstrainedValueWithValueInRangen.xml | 4 ++-- .../auth_ConstrainedValueWithValueOneOf.xml | 6 ++--- tests/resources/xml/auth_EncryptedValue.xml | 6 ++--- tests/resources/xml/auth_ValueGreaterThan.xml | 4 ++-- .../xml/auth_ValueGreaterThanOrEqual.xml | 4 ++-- tests/resources/xml/auth_ValueInRangen.xml | 4 ++-- tests/resources/xml/auth_ValueLessThan.xml | 4 ++-- .../xml/auth_ValueLessThanOrEqual.xml | 4 ++-- .../auth_ValueOneOfWithStructuredValues.xml | 6 ++--- tests/resources/xml/auth_ValueUpperBound.xml | 4 ++-- .../xml/fed_ApplicationServiceEndpoint.xml | 12 +++++----- .../xml/fed_AttributeServiceEndpoint.xml | 12 +++++----- .../xml/fed_AttributeServiceEndpoints.xml | 12 +++++----- tests/resources/xml/fed_ClaimTypesOffered.xml | 4 ++-- .../resources/xml/fed_ClaimTypesRequested.xml | 4 ++-- .../resources/xml/fed_FederationMetadata.xml | 2 +- tests/resources/xml/fed_FilterPseudonyms.xml | 4 ++-- .../xml/fed_PassiveRequestorEndpoint.xml | 12 +++++----- .../xml/fed_PassiveRequestorEndpoints.xml | 12 +++++----- tests/resources/xml/fed_Pseudonym.xml | 4 ++-- .../xml/fed_PseudonymServiceEndpoint.xml | 12 +++++----- .../xml/fed_PseudonymServiceEndpoints.xml | 12 +++++----- tests/resources/xml/fed_ReferenceEPR.xml | 12 +++++----- .../xml/fed_SecurityTokenServiceEndpoint.xml | 12 +++++----- .../fed_SingleSignOutNotificationEndpoint.xml | 12 +++++----- ...fed_SingleSignOutNotificationEndpoints.xml | 12 +++++----- .../fed_SingleSignOutSubscriptionEndpoint.xml | 12 +++++----- ...fed_SingleSignOutSubscriptionEndpoints.xml | 12 +++++----- tests/resources/xml/fed_TargetScopes.xml | 12 +++++----- .../xml/sp/200507/AlgorithmSuite.xml | 4 ++-- .../xml/sp/200507/AsymmetricBinding.xml | 4 ++-- .../xml/sp/200507/BootstrapPolicy.xml | 4 ++-- .../xml/sp/200507/EncryptedParts.xml | 6 ++--- .../xml/sp/200507/EncryptionToken.xml | 4 ++-- .../sp/200507/EndorsingSupportingTokens.xml | 4 ++-- .../xml/sp/200507/InitiatorToken.xml | 4 ++-- tests/resources/xml/sp/200507/IssuedToken.xml | 16 ++++++------- tests/resources/xml/sp/200507/Issuer.xml | 16 ++++++------- tests/resources/xml/sp/200507/Layout.xml | 4 ++-- .../xml/sp/200507/ProtectionToken.xml | 4 ++-- .../xml/sp/200507/RecipientToken.xml | 4 ++-- .../xml/sp/200507/SecureConversationToken.xml | 16 ++++++------- .../xml/sp/200507/SignatureToken.xml | 4 ++-- .../SignedEndorsingSupportingTokens.xml | 4 ++-- tests/resources/xml/sp/200507/SignedParts.xml | 4 ++-- .../xml/sp/200507/SignedSupportingTokens.xml | 4 ++-- .../xml/sp/200507/SpnegoContextToken.xml | 16 ++++++------- .../xml/sp/200507/SupportingTokens.xml | 4 ++-- .../xml/sp/200507/SymmetricBinding.xml | 4 ++-- .../xml/sp/200507/TransportBinding.xml | 4 ++-- .../xml/sp/200507/TransportToken.xml | 4 ++-- tests/resources/xml/sp/200507/Trust10.xml | 4 ++-- tests/resources/xml/sp/200507/Wss10.xml | 4 ++-- tests/resources/xml/sp/200507/Wss11.xml | 4 ++-- .../xml/sp/200702/EncryptedParts.xml | 6 ++--- tests/resources/xml/sp/200702/Issuer.xml | 12 +++++----- .../resources/xml/sp/200702/RequiredParts.xml | 2 +- tests/resources/xml/sp/200702/SignedParts.xml | 6 ++--- .../xml/wsa/200408/EndpointReference.xml | 6 ++--- tests/resources/xml/wsa/200408/FaultTo.xml | 6 ++--- tests/resources/xml/wsa/200408/From.xml | 6 ++--- .../xml/wsa/200408/ReferenceParameters.xml | 4 ++-- .../xml/wsa/200408/ReferenceProperties.xml | 4 ++-- tests/resources/xml/wsa/200408/ReplyTo.xml | 6 ++--- .../xml/wsa/200508/EndpointReference.xml | 8 +++---- tests/resources/xml/wsa/200508/FaultTo.xml | 8 +++---- tests/resources/xml/wsa/200508/From.xml | 8 +++---- tests/resources/xml/wsa/200508/Metadata.xml | 4 ++-- .../xml/wsa/200508/ReferenceParameters.xml | 4 ++-- tests/resources/xml/wsa/200508/ReplyTo.xml | 6 ++--- tests/resources/xml/wsse_UsernameToken.xml | 2 +- .../xml/wst/200502/Authenticator.xml | 4 ++-- .../resources/xml/wst/200502/CancelTarget.xml | 4 ++-- tests/resources/xml/wst/200502/DelegateTo.xml | 4 ++-- tests/resources/xml/wst/200502/Encryption.xml | 4 ++-- tests/resources/xml/wst/200502/Issuer.xml | 8 +++---- .../xml/wst/200502/KeyExchangeToken.xml | 4 ++-- tests/resources/xml/wst/200502/Lifetime.xml | 6 ++--- tests/resources/xml/wst/200502/OnBehalfOf.xml | 4 ++-- .../resources/xml/wst/200502/Participant.xml | 4 ++-- .../resources/xml/wst/200502/Participants.xml | 8 +++---- tests/resources/xml/wst/200502/Primary.xml | 4 ++-- .../xml/wst/200502/ProofEncryption.xml | 4 ++-- .../resources/xml/wst/200502/RenewTarget.xml | 4 ++-- .../xml/wst/200502/RequestSecurityToken.xml | 4 ++-- .../200502/RequestSecurityTokenResponse.xml | 4 ++-- .../wst/200502/RequestedAttachedReference.xml | 4 ++-- .../xml/wst/200502/RequestedProofToken.xml | 4 ++-- .../xml/wst/200502/RequestedSecurityToken.xml | 4 ++-- .../200502/RequestedUnattachedReference.xml | 4 ++-- tests/resources/xml/wst/200502/UseKey.xml | 4 ++-- .../xml/wst/200512/Authenticator.xml | 4 ++-- .../resources/xml/wst/200512/CancelTarget.xml | 4 ++-- tests/resources/xml/wst/200512/DelegateTo.xml | 4 ++-- tests/resources/xml/wst/200512/Encryption.xml | 4 ++-- tests/resources/xml/wst/200512/Issuer.xml | 12 +++++----- .../xml/wst/200512/KeyExchangeToken.xml | 4 ++-- tests/resources/xml/wst/200512/Lifetime.xml | 6 ++--- tests/resources/xml/wst/200512/OnBehalfOf.xml | 4 ++-- .../resources/xml/wst/200512/Participant.xml | 4 ++-- .../resources/xml/wst/200512/Participants.xml | 8 +++---- tests/resources/xml/wst/200512/Primary.xml | 4 ++-- .../xml/wst/200512/ProofEncryption.xml | 4 ++-- .../resources/xml/wst/200512/RenewTarget.xml | 4 ++-- .../xml/wst/200512/RequestSecurityToken.xml | 4 ++-- .../200512/RequestSecurityTokenCollection.xml | 10 ++++---- .../200512/RequestSecurityTokenResponse.xml | 4 ++-- .../wst/200512/RequestedAttachedReference.xml | 4 ++-- .../xml/wst/200512/RequestedProofToken.xml | 4 ++-- .../xml/wst/200512/RequestedSecurityToken.xml | 4 ++-- .../200512/RequestedUnattachedReference.xml | 4 ++-- tests/resources/xml/wst/200512/UseKey.xml | 4 ++-- .../xml/wst/200512/ValidateTarget.xml | 4 ++-- tests/resources/xml/wsx_MetadataReference.xml | 4 ++-- 121 files changed, 416 insertions(+), 417 deletions(-) create mode 100644 src/XML/sp_200507/Type/IncludeTokenValue.php create mode 100644 src/XML/sp_200702/Type/IncludeTokenValue.php diff --git a/src/XML/sp_200507/AbstractIssuedTokenType.php b/src/XML/sp_200507/AbstractIssuedTokenType.php index 4d2e68b2..98b70827 100644 --- a/src/XML/sp_200507/AbstractIssuedTokenType.php +++ b/src/XML/sp_200507/AbstractIssuedTokenType.php @@ -6,17 +6,15 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use ValueError; use function array_pop; -use function is_string; use function sprintf; /** @@ -48,14 +46,14 @@ abstract class AbstractIssuedTokenType extends AbstractSpElement * * @param \SimpleSAML\WSSecurity\XML\sp_200507\RequestSecurityTokenTemplate $requestSecurityTokenTemplate * @param \SimpleSAML\WSSecurity\XML\sp_200507\Issuer|null $issuer - * @param \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken|string|null $includeToken + * @param \SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue|null $includeToken * @param list<\SimpleSAML\XML\SerializableElementInterface> $elts * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected RequestSecurityTokenTemplate $requestSecurityTokenTemplate, protected ?Issuer $issuer = null, - IncludeToken|string|null $includeToken = null, + ?IncludeTokenValue $includeToken = null, array $elts = [], array $namespacedAttributes = [], ) { @@ -114,16 +112,10 @@ public static function fromXML(DOMElement $xml): static Assert::minCount($requestSecurityTokenTemplate, 1, MissingElementException::class); Assert::maxCount($requestSecurityTokenTemplate, 1, TooManyElementsException::class); - $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', StringValue::class, null); - try { - $includeToken = IncludeToken::from($includeToken->getValue()); - } catch (ValueError) { - } - return new static( $requestSecurityTokenTemplate[0], array_pop($issuer), - $includeToken, + self::getOptionalAttribute($xml, 'IncludeToken', IncludeTokenValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -141,10 +133,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getIncludeToken() !== null) { - $e->setAttribute( - 'IncludeToken', - is_string($this->getIncludeToken()) ? $this->getIncludeToken() : $this->getIncludeToken()->value, - ); + $e->setAttribute('IncludeToken', $this->getIncludeToken()->getValue()); } if ($this->getIssuer() !== null) { @@ -154,7 +143,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $this->getRequestSecurityTokenTemplate()->toXML($e); foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200507/AbstractSecureConversationTokenType.php b/src/XML/sp_200507/AbstractSecureConversationTokenType.php index 29a36d64..092a3a7e 100644 --- a/src/XML/sp_200507/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200507/AbstractSecureConversationTokenType.php @@ -6,15 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use ValueError; use function array_pop; -use function is_string; use function sprintf; /** @@ -45,13 +43,13 @@ abstract class AbstractSecureConversationTokenType extends AbstractSpElement * SecureConversationTokenType constructor. * * @param \SimpleSAML\WSSecurity\XML\sp_200507\Issuer|null $issuer - * @param \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken|string|null $includeToken + * @param \SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue|null $includeToken * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?Issuer $issuer, - IncludeToken|string|null $includeToken = null, + ?IncludeTokenValue $includeToken = null, array $elts = [], array $namespacedAttributes = [], ) { @@ -109,15 +107,9 @@ public static function fromXML(DOMElement $xml): static $issuer = Issuer::getChildrenOfClass($xml); - $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', StringValue::class, null); - try { - $includeToken = IncludeToken::from($includeToken->getValue()); - } catch (ValueError) { - } - return new static( array_pop($issuer), - $includeToken, + self::getOptionalAttribute($xml, 'IncludeToken', IncludeTokenValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -135,10 +127,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getIncludeToken() !== null) { - $e->setAttribute( - 'IncludeToken', - is_string($this->getIncludeToken()) ? $this->getIncludeToken() : $this->getIncludeToken()->value, - ); + $e->setAttribute('IncludeToken', $this->getIncludeToken()->getValue()); } if ($this->getIssuer() !== null) { @@ -146,7 +135,6 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php index 254f5727..edb0face 100644 --- a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php @@ -6,15 +6,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Constants\NS; -use ValueError; use function array_pop; -use function is_string; use function sprintf; /** @@ -45,13 +43,13 @@ abstract class AbstractSpnegoContextTokenType extends AbstractSpElement * SpnegoContextTokenType constructor. * * @param \SimpleSAML\WSSecurity\XML\sp_200507\Issuer|null $issuer - * @param \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken|string|null $includeToken + * @param \SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue|null $includeToken * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?Issuer $issuer, - IncludeToken|string|null $includeToken = null, + ?IncludeTokenValue $includeToken = null, array $elts = [], array $namespacedAttributes = [], ) { @@ -109,15 +107,9 @@ public static function fromXML(DOMElement $xml): static $issuer = Issuer::getChildrenOfClass($xml); - $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', StringValue::class, null); - try { - $includeToken = IncludeToken::from($includeToken->getValue()); - } catch (ValueError) { - } - return new static( array_pop($issuer), - $includeToken, + self::getOptionalAttribute($xml, 'IncludeToken', IncludeTokenValue::class, null), self::getChildElementsFromXML($xml), self::getAttributesNSFromXML($xml), ); @@ -135,10 +127,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); if ($this->getIncludeToken() !== null) { - $e->setAttribute( - 'IncludeToken', - is_string($this->getIncludeToken()) ? $this->getIncludeToken() : $this->getIncludeToken()->value, - ); + $e->setAttribute('IncludeToken', $this->getIncludeToken()->getValue()); } if ($this->getIssuer() !== null) { diff --git a/src/XML/sp_200507/IncludeTokenTypeTrait.php b/src/XML/sp_200507/IncludeTokenTypeTrait.php index 770f9954..ff2b43cb 100644 --- a/src/XML/sp_200507/IncludeTokenTypeTrait.php +++ b/src/XML/sp_200507/IncludeTokenTypeTrait.php @@ -4,9 +4,7 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507; -use SimpleSAML\WSSecurity\Assert\Assert; - -use function is_string; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; /** * Trait grouping common functionality for elements that can hold IncludeToken attributes. @@ -18,17 +16,17 @@ trait IncludeTokenTypeTrait /** * The included token. * - * @var \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken|string|null + * @var \SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue|null */ - protected IncludeToken|string|null $includeToken; + protected ?IncludeTokenValue $includeToken; /** * Collect the value of the includeToken-property * - * @return \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken|string|null + * @return \SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue|null */ - public function getIncludeToken(): IncludeToken|string|null + public function getIncludeToken(): ?IncludeTokenValue { return $this->includeToken; } @@ -37,14 +35,10 @@ public function getIncludeToken(): IncludeToken|string|null /** * Set the value of the includeToken-property * - * @param \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken|string|null $includeToken + * @param \SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue|null $includeToken */ - protected function setIncludeToken(IncludeToken|string|null $includeToken): void + protected function setIncludeToken(?IncludeTokenValue $includeToken = null): void { - if (is_string($includeToken)) { - Assert::validURI($includeToken); - } - $this->includeToken = $includeToken; } } diff --git a/src/XML/sp_200507/Type/IncludeTokenValue.php b/src/XML/sp_200507/Type/IncludeTokenValue.php new file mode 100644 index 00000000..2edad7e9 --- /dev/null +++ b/src/XML/sp_200507/Type/IncludeTokenValue.php @@ -0,0 +1,23 @@ +value); + } +} diff --git a/src/XML/sp_200702/IncludeTokenTypeTrait.php b/src/XML/sp_200702/IncludeTokenTypeTrait.php index b9bc61f8..8a6a7062 100644 --- a/src/XML/sp_200702/IncludeTokenTypeTrait.php +++ b/src/XML/sp_200702/IncludeTokenTypeTrait.php @@ -4,9 +4,7 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702; -use SimpleSAML\WSSecurity\Assert\Assert; - -use function is_string; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; /** * Trait grouping common functionality for elements that can hold IncludeToken attributes. @@ -20,17 +18,17 @@ trait IncludeTokenTypeTrait /** * The included token. * - * @var \SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken|string|null + * @var \SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue|null */ - protected IncludeToken|string|null $includeToken; + protected ?IncludeTokenValue $includeToken; /** * Collect the value of the includeToken-property * - * @return \SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken|string|null + * @return \SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue|null */ - public function getIncludeToken(): IncludeToken|string|null + public function getIncludeToken(): ?IncludeTokenValue { return $this->includeToken; } @@ -39,14 +37,10 @@ public function getIncludeToken(): IncludeToken|string|null /** * Set the value of the includeToken-property * - * @param \SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken|string|null $includeToken + * @param \SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue|null $includeToken */ - protected function setIncludeToken(IncludeToken|string|null $includeToken): void + protected function setIncludeToken(?IncludeTokenValue $includeToken): void { - if (is_string($includeToken)) { - Assert::validURI($includeToken); - } - $this->includeToken = $includeToken; } } diff --git a/src/XML/sp_200702/Type/IncludeTokenValue.php b/src/XML/sp_200702/Type/IncludeTokenValue.php new file mode 100644 index 00000000..ce1c025b --- /dev/null +++ b/src/XML/sp_200702/Type/IncludeTokenValue.php @@ -0,0 +1,23 @@ +value); + } +} diff --git a/tests/resources/xml/auth_ConstrainedValueWithValueInRangen.xml b/tests/resources/xml/auth_ConstrainedValueWithValueInRangen.xml index 25fbfbfb..c5312b09 100644 --- a/tests/resources/xml/auth_ConstrainedValueWithValueInRangen.xml +++ b/tests/resources/xml/auth_ConstrainedValueWithValueInRangen.xml @@ -1,7 +1,7 @@ - + - + SomeChunk diff --git a/tests/resources/xml/auth_ConstrainedValueWithValueOneOf.xml b/tests/resources/xml/auth_ConstrainedValueWithValueOneOf.xml index 75b79a5a..4d08c75f 100644 --- a/tests/resources/xml/auth_ConstrainedValueWithValueOneOf.xml +++ b/tests/resources/xml/auth_ConstrainedValueWithValueOneOf.xml @@ -1,9 +1,9 @@ - + - + SomeChunk - + SomeOtherChunk diff --git a/tests/resources/xml/auth_EncryptedValue.xml b/tests/resources/xml/auth_EncryptedValue.xml index d0d1c472..474a5234 100644 --- a/tests/resources/xml/auth_EncryptedValue.xml +++ b/tests/resources/xml/auth_EncryptedValue.xml @@ -1,7 +1,7 @@ - - + + - + diff --git a/tests/resources/xml/auth_ValueGreaterThan.xml b/tests/resources/xml/auth_ValueGreaterThan.xml index 50c21f42..0aa717e3 100644 --- a/tests/resources/xml/auth_ValueGreaterThan.xml +++ b/tests/resources/xml/auth_ValueGreaterThan.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/auth_ValueGreaterThanOrEqual.xml b/tests/resources/xml/auth_ValueGreaterThanOrEqual.xml index 47085c7b..6f1fec1b 100644 --- a/tests/resources/xml/auth_ValueGreaterThanOrEqual.xml +++ b/tests/resources/xml/auth_ValueGreaterThanOrEqual.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/auth_ValueInRangen.xml b/tests/resources/xml/auth_ValueInRangen.xml index c027c9a3..4f29765d 100644 --- a/tests/resources/xml/auth_ValueInRangen.xml +++ b/tests/resources/xml/auth_ValueInRangen.xml @@ -1,6 +1,6 @@ - + - + SomeChunk diff --git a/tests/resources/xml/auth_ValueLessThan.xml b/tests/resources/xml/auth_ValueLessThan.xml index 2ea0e287..0a738662 100644 --- a/tests/resources/xml/auth_ValueLessThan.xml +++ b/tests/resources/xml/auth_ValueLessThan.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/auth_ValueLessThanOrEqual.xml b/tests/resources/xml/auth_ValueLessThanOrEqual.xml index f9ee4739..77000308 100644 --- a/tests/resources/xml/auth_ValueLessThanOrEqual.xml +++ b/tests/resources/xml/auth_ValueLessThanOrEqual.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/auth_ValueOneOfWithStructuredValues.xml b/tests/resources/xml/auth_ValueOneOfWithStructuredValues.xml index aeed7fb2..ecf967fb 100644 --- a/tests/resources/xml/auth_ValueOneOfWithStructuredValues.xml +++ b/tests/resources/xml/auth_ValueOneOfWithStructuredValues.xml @@ -1,8 +1,8 @@ - - + + SomeChunk - + SomeOtherChunk diff --git a/tests/resources/xml/auth_ValueUpperBound.xml b/tests/resources/xml/auth_ValueUpperBound.xml index 76e20866..0f197c84 100644 --- a/tests/resources/xml/auth_ValueUpperBound.xml +++ b/tests/resources/xml/auth_ValueUpperBound.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/fed_ApplicationServiceEndpoint.xml b/tests/resources/xml/fed_ApplicationServiceEndpoint.xml index 186204ce..6f572ddb 100644 --- a/tests/resources/xml/fed_ApplicationServiceEndpoint.xml +++ b/tests/resources/xml/fed_ApplicationServiceEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_AttributeServiceEndpoint.xml b/tests/resources/xml/fed_AttributeServiceEndpoint.xml index 360ed792..1cc98632 100644 --- a/tests/resources/xml/fed_AttributeServiceEndpoint.xml +++ b/tests/resources/xml/fed_AttributeServiceEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_AttributeServiceEndpoints.xml b/tests/resources/xml/fed_AttributeServiceEndpoints.xml index 55aded81..87a49bd5 100644 --- a/tests/resources/xml/fed_AttributeServiceEndpoints.xml +++ b/tests/resources/xml/fed_AttributeServiceEndpoints.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_ClaimTypesOffered.xml b/tests/resources/xml/fed_ClaimTypesOffered.xml index 9bbfc07c..3ddebce0 100644 --- a/tests/resources/xml/fed_ClaimTypesOffered.xml +++ b/tests/resources/xml/fed_ClaimTypesOffered.xml @@ -1,5 +1,5 @@ - - + + someDisplayName someDescription someDisplayValue diff --git a/tests/resources/xml/fed_ClaimTypesRequested.xml b/tests/resources/xml/fed_ClaimTypesRequested.xml index 6f956868..53b578c3 100644 --- a/tests/resources/xml/fed_ClaimTypesRequested.xml +++ b/tests/resources/xml/fed_ClaimTypesRequested.xml @@ -1,5 +1,5 @@ - - + + someDisplayName someDescription someDisplayValue diff --git a/tests/resources/xml/fed_FederationMetadata.xml b/tests/resources/xml/fed_FederationMetadata.xml index 811078fa..5867a537 100644 --- a/tests/resources/xml/fed_FederationMetadata.xml +++ b/tests/resources/xml/fed_FederationMetadata.xml @@ -1,5 +1,5 @@ - + Some Other diff --git a/tests/resources/xml/fed_FilterPseudonyms.xml b/tests/resources/xml/fed_FilterPseudonyms.xml index 62fe5774..194a0f21 100644 --- a/tests/resources/xml/fed_FilterPseudonyms.xml +++ b/tests/resources/xml/fed_FilterPseudonyms.xml @@ -1,9 +1,9 @@ - + Basis Relative - + diff --git a/tests/resources/xml/fed_PassiveRequestorEndpoint.xml b/tests/resources/xml/fed_PassiveRequestorEndpoint.xml index 213a89a3..c5d808a4 100644 --- a/tests/resources/xml/fed_PassiveRequestorEndpoint.xml +++ b/tests/resources/xml/fed_PassiveRequestorEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_PassiveRequestorEndpoints.xml b/tests/resources/xml/fed_PassiveRequestorEndpoints.xml index e2d380ae..153420f4 100644 --- a/tests/resources/xml/fed_PassiveRequestorEndpoints.xml +++ b/tests/resources/xml/fed_PassiveRequestorEndpoints.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_Pseudonym.xml b/tests/resources/xml/fed_Pseudonym.xml index 2298a7cf..4d8564f0 100644 --- a/tests/resources/xml/fed_Pseudonym.xml +++ b/tests/resources/xml/fed_Pseudonym.xml @@ -1,11 +1,11 @@ - + Basis Relative - 2001-10-13T09:00:00Z + 2001-10-13T09:00:00Z Security diff --git a/tests/resources/xml/fed_PseudonymServiceEndpoint.xml b/tests/resources/xml/fed_PseudonymServiceEndpoint.xml index 48f3bfd9..ee323780 100644 --- a/tests/resources/xml/fed_PseudonymServiceEndpoint.xml +++ b/tests/resources/xml/fed_PseudonymServiceEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_PseudonymServiceEndpoints.xml b/tests/resources/xml/fed_PseudonymServiceEndpoints.xml index 2f5715b3..46262e6c 100644 --- a/tests/resources/xml/fed_PseudonymServiceEndpoints.xml +++ b/tests/resources/xml/fed_PseudonymServiceEndpoints.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_ReferenceEPR.xml b/tests/resources/xml/fed_ReferenceEPR.xml index e5cf7b91..d5b2c02f 100644 --- a/tests/resources/xml/fed_ReferenceEPR.xml +++ b/tests/resources/xml/fed_ReferenceEPR.xml @@ -1,12 +1,12 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Pears - - + + Apples diff --git a/tests/resources/xml/fed_SecurityTokenServiceEndpoint.xml b/tests/resources/xml/fed_SecurityTokenServiceEndpoint.xml index 0b9b22dd..d468eef8 100644 --- a/tests/resources/xml/fed_SecurityTokenServiceEndpoint.xml +++ b/tests/resources/xml/fed_SecurityTokenServiceEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_SingleSignOutNotificationEndpoint.xml b/tests/resources/xml/fed_SingleSignOutNotificationEndpoint.xml index f3303fc0..b117cf02 100644 --- a/tests/resources/xml/fed_SingleSignOutNotificationEndpoint.xml +++ b/tests/resources/xml/fed_SingleSignOutNotificationEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_SingleSignOutNotificationEndpoints.xml b/tests/resources/xml/fed_SingleSignOutNotificationEndpoints.xml index 2c719398..563c00b6 100644 --- a/tests/resources/xml/fed_SingleSignOutNotificationEndpoints.xml +++ b/tests/resources/xml/fed_SingleSignOutNotificationEndpoints.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoint.xml b/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoint.xml index 7896d018..c9bcf276 100644 --- a/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoint.xml +++ b/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoint.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoints.xml b/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoints.xml index e9f501e1..b1b525f9 100644 --- a/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoints.xml +++ b/tests/resources/xml/fed_SingleSignOutSubscriptionEndpoints.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/fed_TargetScopes.xml b/tests/resources/xml/fed_TargetScopes.xml index 0dee9e47..60d50222 100644 --- a/tests/resources/xml/fed_TargetScopes.xml +++ b/tests/resources/xml/fed_TargetScopes.xml @@ -1,16 +1,16 @@ - - + + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples - SomeChunk + SomeChunk diff --git a/tests/resources/xml/sp/200507/AlgorithmSuite.xml b/tests/resources/xml/sp/200507/AlgorithmSuite.xml index 19a0a412..cf05d766 100644 --- a/tests/resources/xml/sp/200507/AlgorithmSuite.xml +++ b/tests/resources/xml/sp/200507/AlgorithmSuite.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/AsymmetricBinding.xml b/tests/resources/xml/sp/200507/AsymmetricBinding.xml index 7ee314a4..d017715f 100644 --- a/tests/resources/xml/sp/200507/AsymmetricBinding.xml +++ b/tests/resources/xml/sp/200507/AsymmetricBinding.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/BootstrapPolicy.xml b/tests/resources/xml/sp/200507/BootstrapPolicy.xml index 85fc737e..93f6432d 100644 --- a/tests/resources/xml/sp/200507/BootstrapPolicy.xml +++ b/tests/resources/xml/sp/200507/BootstrapPolicy.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/EncryptedParts.xml b/tests/resources/xml/sp/200507/EncryptedParts.xml index 77e05f80..53f6d371 100644 --- a/tests/resources/xml/sp/200507/EncryptedParts.xml +++ b/tests/resources/xml/sp/200507/EncryptedParts.xml @@ -1,5 +1,5 @@ - - - + + + some diff --git a/tests/resources/xml/sp/200507/EncryptionToken.xml b/tests/resources/xml/sp/200507/EncryptionToken.xml index 1ac9ca44..107206a5 100644 --- a/tests/resources/xml/sp/200507/EncryptionToken.xml +++ b/tests/resources/xml/sp/200507/EncryptionToken.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml b/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml index 341f7232..f05316f0 100644 --- a/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml +++ b/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/InitiatorToken.xml b/tests/resources/xml/sp/200507/InitiatorToken.xml index d4df08cd..50ff69e4 100644 --- a/tests/resources/xml/sp/200507/InitiatorToken.xml +++ b/tests/resources/xml/sp/200507/InitiatorToken.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/IssuedToken.xml b/tests/resources/xml/sp/200507/IssuedToken.xml index ccf4cd05..ae7550df 100644 --- a/tests/resources/xml/sp/200507/IssuedToken.xml +++ b/tests/resources/xml/sp/200507/IssuedToken.xml @@ -1,18 +1,18 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Apples - - + + Pears - ssp:Chunk - ssp:Chunk + ssp:Chunk + ssp:Chunk some diff --git a/tests/resources/xml/sp/200507/Issuer.xml b/tests/resources/xml/sp/200507/Issuer.xml index 7d0323d5..0f9a1667 100644 --- a/tests/resources/xml/sp/200507/Issuer.xml +++ b/tests/resources/xml/sp/200507/Issuer.xml @@ -1,16 +1,16 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Apples - - + + Pears - ssp:Chunk - ssp:Chunk + ssp:Chunk + ssp:Chunk some diff --git a/tests/resources/xml/sp/200507/Layout.xml b/tests/resources/xml/sp/200507/Layout.xml index b4ab9272..3a0b2cbf 100644 --- a/tests/resources/xml/sp/200507/Layout.xml +++ b/tests/resources/xml/sp/200507/Layout.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/ProtectionToken.xml b/tests/resources/xml/sp/200507/ProtectionToken.xml index 09eb52de..9555c76d 100644 --- a/tests/resources/xml/sp/200507/ProtectionToken.xml +++ b/tests/resources/xml/sp/200507/ProtectionToken.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/RecipientToken.xml b/tests/resources/xml/sp/200507/RecipientToken.xml index d1e7f6c4..793bc8e9 100644 --- a/tests/resources/xml/sp/200507/RecipientToken.xml +++ b/tests/resources/xml/sp/200507/RecipientToken.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/SecureConversationToken.xml b/tests/resources/xml/sp/200507/SecureConversationToken.xml index 3d0bac06..964928f2 100644 --- a/tests/resources/xml/sp/200507/SecureConversationToken.xml +++ b/tests/resources/xml/sp/200507/SecureConversationToken.xml @@ -1,18 +1,18 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Apples - - + + Pears - ssp:Chunk - ssp:Chunk + ssp:Chunk + ssp:Chunk some some diff --git a/tests/resources/xml/sp/200507/SignatureToken.xml b/tests/resources/xml/sp/200507/SignatureToken.xml index aede00b2..e59e897e 100644 --- a/tests/resources/xml/sp/200507/SignatureToken.xml +++ b/tests/resources/xml/sp/200507/SignatureToken.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml b/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml index 0c4a35fb..79661704 100644 --- a/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml +++ b/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/SignedParts.xml b/tests/resources/xml/sp/200507/SignedParts.xml index 039deebb..110dfc7f 100644 --- a/tests/resources/xml/sp/200507/SignedParts.xml +++ b/tests/resources/xml/sp/200507/SignedParts.xml @@ -1,5 +1,5 @@ - - + + some diff --git a/tests/resources/xml/sp/200507/SignedSupportingTokens.xml b/tests/resources/xml/sp/200507/SignedSupportingTokens.xml index 52949b4c..06dd7ad1 100644 --- a/tests/resources/xml/sp/200507/SignedSupportingTokens.xml +++ b/tests/resources/xml/sp/200507/SignedSupportingTokens.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/SpnegoContextToken.xml b/tests/resources/xml/sp/200507/SpnegoContextToken.xml index f125696c..4577d679 100644 --- a/tests/resources/xml/sp/200507/SpnegoContextToken.xml +++ b/tests/resources/xml/sp/200507/SpnegoContextToken.xml @@ -1,18 +1,18 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Apples - - + + Pears - ssp:Chunk - ssp:Chunk + ssp:Chunk + ssp:Chunk some some diff --git a/tests/resources/xml/sp/200507/SupportingTokens.xml b/tests/resources/xml/sp/200507/SupportingTokens.xml index e112c4f3..cf7a9973 100644 --- a/tests/resources/xml/sp/200507/SupportingTokens.xml +++ b/tests/resources/xml/sp/200507/SupportingTokens.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/SymmetricBinding.xml b/tests/resources/xml/sp/200507/SymmetricBinding.xml index 6e42e19e..d8ee37eb 100644 --- a/tests/resources/xml/sp/200507/SymmetricBinding.xml +++ b/tests/resources/xml/sp/200507/SymmetricBinding.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/TransportBinding.xml b/tests/resources/xml/sp/200507/TransportBinding.xml index 59f0bf5e..3d5fa69e 100644 --- a/tests/resources/xml/sp/200507/TransportBinding.xml +++ b/tests/resources/xml/sp/200507/TransportBinding.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/TransportToken.xml b/tests/resources/xml/sp/200507/TransportToken.xml index ac8e88ce..4d5504f1 100644 --- a/tests/resources/xml/sp/200507/TransportToken.xml +++ b/tests/resources/xml/sp/200507/TransportToken.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/Trust10.xml b/tests/resources/xml/sp/200507/Trust10.xml index 47091eac..fb7a9bb7 100644 --- a/tests/resources/xml/sp/200507/Trust10.xml +++ b/tests/resources/xml/sp/200507/Trust10.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/Wss10.xml b/tests/resources/xml/sp/200507/Wss10.xml index 9b4693e4..c5d631a3 100644 --- a/tests/resources/xml/sp/200507/Wss10.xml +++ b/tests/resources/xml/sp/200507/Wss10.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200507/Wss11.xml b/tests/resources/xml/sp/200507/Wss11.xml index a4e9713f..86f67daf 100644 --- a/tests/resources/xml/sp/200507/Wss11.xml +++ b/tests/resources/xml/sp/200507/Wss11.xml @@ -1,5 +1,5 @@ - - + + Other diff --git a/tests/resources/xml/sp/200702/EncryptedParts.xml b/tests/resources/xml/sp/200702/EncryptedParts.xml index c9ce63b1..f2c2697a 100644 --- a/tests/resources/xml/sp/200702/EncryptedParts.xml +++ b/tests/resources/xml/sp/200702/EncryptedParts.xml @@ -1,6 +1,6 @@ - - - + + + some diff --git a/tests/resources/xml/sp/200702/Issuer.xml b/tests/resources/xml/sp/200702/Issuer.xml index 1bbf720d..0f2359d2 100644 --- a/tests/resources/xml/sp/200702/Issuer.xml +++ b/tests/resources/xml/sp/200702/Issuer.xml @@ -1,12 +1,12 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Pears - - + + Apples diff --git a/tests/resources/xml/sp/200702/RequiredParts.xml b/tests/resources/xml/sp/200702/RequiredParts.xml index 45ddb1e9..f8b7354c 100644 --- a/tests/resources/xml/sp/200702/RequiredParts.xml +++ b/tests/resources/xml/sp/200702/RequiredParts.xml @@ -1,4 +1,4 @@ - + some diff --git a/tests/resources/xml/sp/200702/SignedParts.xml b/tests/resources/xml/sp/200702/SignedParts.xml index 87c91e57..06fabad7 100644 --- a/tests/resources/xml/sp/200702/SignedParts.xml +++ b/tests/resources/xml/sp/200702/SignedParts.xml @@ -1,6 +1,6 @@ - - - + + + some diff --git a/tests/resources/xml/wsa/200408/EndpointReference.xml b/tests/resources/xml/wsa/200408/EndpointReference.xml index 909ea666..e8c8b4ab 100644 --- a/tests/resources/xml/wsa/200408/EndpointReference.xml +++ b/tests/resources/xml/wsa/200408/EndpointReference.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - + Apples - + Pears diff --git a/tests/resources/xml/wsa/200408/FaultTo.xml b/tests/resources/xml/wsa/200408/FaultTo.xml index 0c8cd7f3..f4c0746b 100644 --- a/tests/resources/xml/wsa/200408/FaultTo.xml +++ b/tests/resources/xml/wsa/200408/FaultTo.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - + Apples - + Pears diff --git a/tests/resources/xml/wsa/200408/From.xml b/tests/resources/xml/wsa/200408/From.xml index f4d8267f..c7be563a 100644 --- a/tests/resources/xml/wsa/200408/From.xml +++ b/tests/resources/xml/wsa/200408/From.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - + Apples - + Pears diff --git a/tests/resources/xml/wsa/200408/ReferenceParameters.xml b/tests/resources/xml/wsa/200408/ReferenceParameters.xml index 73aa6838..ca50575c 100644 --- a/tests/resources/xml/wsa/200408/ReferenceParameters.xml +++ b/tests/resources/xml/wsa/200408/ReferenceParameters.xml @@ -1,5 +1,5 @@ - - + + Apples diff --git a/tests/resources/xml/wsa/200408/ReferenceProperties.xml b/tests/resources/xml/wsa/200408/ReferenceProperties.xml index a0783086..b7a8dd3a 100644 --- a/tests/resources/xml/wsa/200408/ReferenceProperties.xml +++ b/tests/resources/xml/wsa/200408/ReferenceProperties.xml @@ -1,5 +1,5 @@ - - + + Apples diff --git a/tests/resources/xml/wsa/200408/ReplyTo.xml b/tests/resources/xml/wsa/200408/ReplyTo.xml index 30507f05..c700af13 100644 --- a/tests/resources/xml/wsa/200408/ReplyTo.xml +++ b/tests/resources/xml/wsa/200408/ReplyTo.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - + Apples - + Pears diff --git a/tests/resources/xml/wsa/200508/EndpointReference.xml b/tests/resources/xml/wsa/200508/EndpointReference.xml index 70fa00c8..a008b392 100644 --- a/tests/resources/xml/wsa/200508/EndpointReference.xml +++ b/tests/resources/xml/wsa/200508/EndpointReference.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples diff --git a/tests/resources/xml/wsa/200508/FaultTo.xml b/tests/resources/xml/wsa/200508/FaultTo.xml index 5b0e6ea4..b6c25391 100644 --- a/tests/resources/xml/wsa/200508/FaultTo.xml +++ b/tests/resources/xml/wsa/200508/FaultTo.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples diff --git a/tests/resources/xml/wsa/200508/From.xml b/tests/resources/xml/wsa/200508/From.xml index 320a2a0b..b9f6c191 100644 --- a/tests/resources/xml/wsa/200508/From.xml +++ b/tests/resources/xml/wsa/200508/From.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - - + + Pears - + Apples diff --git a/tests/resources/xml/wsa/200508/Metadata.xml b/tests/resources/xml/wsa/200508/Metadata.xml index ae1cc617..6f075a89 100644 --- a/tests/resources/xml/wsa/200508/Metadata.xml +++ b/tests/resources/xml/wsa/200508/Metadata.xml @@ -1,5 +1,5 @@ - - + + Apples diff --git a/tests/resources/xml/wsa/200508/ReferenceParameters.xml b/tests/resources/xml/wsa/200508/ReferenceParameters.xml index 1b5f6b02..137b4b95 100644 --- a/tests/resources/xml/wsa/200508/ReferenceParameters.xml +++ b/tests/resources/xml/wsa/200508/ReferenceParameters.xml @@ -1,5 +1,5 @@ - - + + Apples diff --git a/tests/resources/xml/wsa/200508/ReplyTo.xml b/tests/resources/xml/wsa/200508/ReplyTo.xml index 21e197d3..6eaf12e9 100644 --- a/tests/resources/xml/wsa/200508/ReplyTo.xml +++ b/tests/resources/xml/wsa/200508/ReplyTo.xml @@ -1,12 +1,12 @@ - + https://login.microsoftonline.com/login.srf - + Pears - + Apples diff --git a/tests/resources/xml/wsse_UsernameToken.xml b/tests/resources/xml/wsse_UsernameToken.xml index bf3c03f4..4016ffb8 100644 --- a/tests/resources/xml/wsse_UsernameToken.xml +++ b/tests/resources/xml/wsse_UsernameToken.xml @@ -1,4 +1,4 @@ - + johndoe@example.com SomeChunk diff --git a/tests/resources/xml/wst/200502/Authenticator.xml b/tests/resources/xml/wst/200502/Authenticator.xml index 73809aa4..cdf09646 100644 --- a/tests/resources/xml/wst/200502/Authenticator.xml +++ b/tests/resources/xml/wst/200502/Authenticator.xml @@ -1,4 +1,4 @@ - + /CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/CancelTarget.xml b/tests/resources/xml/wst/200502/CancelTarget.xml index b4add4ad..09a18e2e 100644 --- a/tests/resources/xml/wst/200502/CancelTarget.xml +++ b/tests/resources/xml/wst/200502/CancelTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/DelegateTo.xml b/tests/resources/xml/wst/200502/DelegateTo.xml index 5af4856f..694e8033 100644 --- a/tests/resources/xml/wst/200502/DelegateTo.xml +++ b/tests/resources/xml/wst/200502/DelegateTo.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Encryption.xml b/tests/resources/xml/wst/200502/Encryption.xml index ac9605e1..11f322ca 100644 --- a/tests/resources/xml/wst/200502/Encryption.xml +++ b/tests/resources/xml/wst/200502/Encryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Issuer.xml b/tests/resources/xml/wst/200502/Issuer.xml index 01557133..1aca10f7 100644 --- a/tests/resources/xml/wst/200502/Issuer.xml +++ b/tests/resources/xml/wst/200502/Issuer.xml @@ -1,7 +1,7 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Pears diff --git a/tests/resources/xml/wst/200502/KeyExchangeToken.xml b/tests/resources/xml/wst/200502/KeyExchangeToken.xml index 1e244361..21dc9494 100644 --- a/tests/resources/xml/wst/200502/KeyExchangeToken.xml +++ b/tests/resources/xml/wst/200502/KeyExchangeToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Lifetime.xml b/tests/resources/xml/wst/200502/Lifetime.xml index 4e68c2eb..748d9fba 100644 --- a/tests/resources/xml/wst/200502/Lifetime.xml +++ b/tests/resources/xml/wst/200502/Lifetime.xml @@ -1,4 +1,4 @@ - - 2001-09-13T08:42:00Z - 2001-10-13T09:00:00Z + + 2001-09-13T08:42:00Z + 2001-10-13T09:00:00Z diff --git a/tests/resources/xml/wst/200502/OnBehalfOf.xml b/tests/resources/xml/wst/200502/OnBehalfOf.xml index ae77c8be..f2d41fc4 100644 --- a/tests/resources/xml/wst/200502/OnBehalfOf.xml +++ b/tests/resources/xml/wst/200502/OnBehalfOf.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Participant.xml b/tests/resources/xml/wst/200502/Participant.xml index 93a8505c..d30eda61 100644 --- a/tests/resources/xml/wst/200502/Participant.xml +++ b/tests/resources/xml/wst/200502/Participant.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Participants.xml b/tests/resources/xml/wst/200502/Participants.xml index f880db69..be07d753 100644 --- a/tests/resources/xml/wst/200502/Participants.xml +++ b/tests/resources/xml/wst/200502/Participants.xml @@ -1,9 +1,9 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Primary.xml b/tests/resources/xml/wst/200502/Primary.xml index 68da9af0..6d8ee38b 100644 --- a/tests/resources/xml/wst/200502/Primary.xml +++ b/tests/resources/xml/wst/200502/Primary.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/ProofEncryption.xml b/tests/resources/xml/wst/200502/ProofEncryption.xml index d32fd451..0725100c 100644 --- a/tests/resources/xml/wst/200502/ProofEncryption.xml +++ b/tests/resources/xml/wst/200502/ProofEncryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RenewTarget.xml b/tests/resources/xml/wst/200502/RenewTarget.xml index 76b10231..b48728ac 100644 --- a/tests/resources/xml/wst/200502/RenewTarget.xml +++ b/tests/resources/xml/wst/200502/RenewTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestSecurityToken.xml b/tests/resources/xml/wst/200502/RequestSecurityToken.xml index 6779655e..369d349b 100644 --- a/tests/resources/xml/wst/200502/RequestSecurityToken.xml +++ b/tests/resources/xml/wst/200502/RequestSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml b/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml index 40b9ec2a..7b9bf1d2 100644 --- a/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml +++ b/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestedAttachedReference.xml b/tests/resources/xml/wst/200502/RequestedAttachedReference.xml index e8b56c33..8103766b 100644 --- a/tests/resources/xml/wst/200502/RequestedAttachedReference.xml +++ b/tests/resources/xml/wst/200502/RequestedAttachedReference.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/wst/200502/RequestedProofToken.xml b/tests/resources/xml/wst/200502/RequestedProofToken.xml index 34bcc821..a1681a58 100644 --- a/tests/resources/xml/wst/200502/RequestedProofToken.xml +++ b/tests/resources/xml/wst/200502/RequestedProofToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestedSecurityToken.xml b/tests/resources/xml/wst/200502/RequestedSecurityToken.xml index f0ce634d..1f18281a 100644 --- a/tests/resources/xml/wst/200502/RequestedSecurityToken.xml +++ b/tests/resources/xml/wst/200502/RequestedSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml b/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml index 3d44296c..ad70c03e 100644 --- a/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml +++ b/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/wst/200502/UseKey.xml b/tests/resources/xml/wst/200502/UseKey.xml index 54474e5a..98cf523e 100644 --- a/tests/resources/xml/wst/200502/UseKey.xml +++ b/tests/resources/xml/wst/200502/UseKey.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Authenticator.xml b/tests/resources/xml/wst/200512/Authenticator.xml index 77969174..0a728e53 100644 --- a/tests/resources/xml/wst/200512/Authenticator.xml +++ b/tests/resources/xml/wst/200512/Authenticator.xml @@ -1,4 +1,4 @@ - + /CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/CancelTarget.xml b/tests/resources/xml/wst/200512/CancelTarget.xml index 29c3da18..dca9cb38 100644 --- a/tests/resources/xml/wst/200512/CancelTarget.xml +++ b/tests/resources/xml/wst/200512/CancelTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/DelegateTo.xml b/tests/resources/xml/wst/200512/DelegateTo.xml index 40804dfd..24c37bb1 100644 --- a/tests/resources/xml/wst/200512/DelegateTo.xml +++ b/tests/resources/xml/wst/200512/DelegateTo.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Encryption.xml b/tests/resources/xml/wst/200512/Encryption.xml index b9c397e7..80a6127c 100644 --- a/tests/resources/xml/wst/200512/Encryption.xml +++ b/tests/resources/xml/wst/200512/Encryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Issuer.xml b/tests/resources/xml/wst/200512/Issuer.xml index 43de3c34..6d6ad995 100644 --- a/tests/resources/xml/wst/200512/Issuer.xml +++ b/tests/resources/xml/wst/200512/Issuer.xml @@ -1,12 +1,12 @@ - - https://login.microsoftonline.com/login.srf - - + + https://login.microsoftonline.com/login.srf + + Pears - - + + Apples diff --git a/tests/resources/xml/wst/200512/KeyExchangeToken.xml b/tests/resources/xml/wst/200512/KeyExchangeToken.xml index 90bb2e47..ccbc82c9 100644 --- a/tests/resources/xml/wst/200512/KeyExchangeToken.xml +++ b/tests/resources/xml/wst/200512/KeyExchangeToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Lifetime.xml b/tests/resources/xml/wst/200512/Lifetime.xml index 03ce16c8..1dd883e7 100644 --- a/tests/resources/xml/wst/200512/Lifetime.xml +++ b/tests/resources/xml/wst/200512/Lifetime.xml @@ -1,4 +1,4 @@ - - 2001-09-13T08:42:00Z - 2001-10-13T09:00:00Z + + 2001-09-13T08:42:00Z + 2001-10-13T09:00:00Z diff --git a/tests/resources/xml/wst/200512/OnBehalfOf.xml b/tests/resources/xml/wst/200512/OnBehalfOf.xml index 87805a6e..fe4ef45c 100644 --- a/tests/resources/xml/wst/200512/OnBehalfOf.xml +++ b/tests/resources/xml/wst/200512/OnBehalfOf.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Participant.xml b/tests/resources/xml/wst/200512/Participant.xml index 514dbfb6..4bcf265b 100644 --- a/tests/resources/xml/wst/200512/Participant.xml +++ b/tests/resources/xml/wst/200512/Participant.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Participants.xml b/tests/resources/xml/wst/200512/Participants.xml index f8a0168e..abccac3c 100644 --- a/tests/resources/xml/wst/200512/Participants.xml +++ b/tests/resources/xml/wst/200512/Participants.xml @@ -1,9 +1,9 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Primary.xml b/tests/resources/xml/wst/200512/Primary.xml index c3086ab2..814b4f37 100644 --- a/tests/resources/xml/wst/200512/Primary.xml +++ b/tests/resources/xml/wst/200512/Primary.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/ProofEncryption.xml b/tests/resources/xml/wst/200512/ProofEncryption.xml index 38f5b27e..5e6b75b5 100644 --- a/tests/resources/xml/wst/200512/ProofEncryption.xml +++ b/tests/resources/xml/wst/200512/ProofEncryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RenewTarget.xml b/tests/resources/xml/wst/200512/RenewTarget.xml index 1bbc923f..70a5686c 100644 --- a/tests/resources/xml/wst/200512/RenewTarget.xml +++ b/tests/resources/xml/wst/200512/RenewTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestSecurityToken.xml b/tests/resources/xml/wst/200512/RequestSecurityToken.xml index 95ff109d..73d9d256 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityToken.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml b/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml index 48b24e73..7d697b83 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml @@ -1,8 +1,8 @@ - - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df diff --git a/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml b/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml index d00d29bf..252f551b 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestedAttachedReference.xml b/tests/resources/xml/wst/200512/RequestedAttachedReference.xml index 459d5382..89435bd7 100644 --- a/tests/resources/xml/wst/200512/RequestedAttachedReference.xml +++ b/tests/resources/xml/wst/200512/RequestedAttachedReference.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/wst/200512/RequestedProofToken.xml b/tests/resources/xml/wst/200512/RequestedProofToken.xml index ec561bc3..78c8d54d 100644 --- a/tests/resources/xml/wst/200512/RequestedProofToken.xml +++ b/tests/resources/xml/wst/200512/RequestedProofToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestedSecurityToken.xml b/tests/resources/xml/wst/200512/RequestedSecurityToken.xml index a2f6feb5..1cf7b1bc 100644 --- a/tests/resources/xml/wst/200512/RequestedSecurityToken.xml +++ b/tests/resources/xml/wst/200512/RequestedSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml b/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml index 89308d25..01921083 100644 --- a/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml +++ b/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml @@ -1,5 +1,5 @@ - - + + SomeChunk diff --git a/tests/resources/xml/wst/200512/UseKey.xml b/tests/resources/xml/wst/200512/UseKey.xml index 8658b5d5..f7615a96 100644 --- a/tests/resources/xml/wst/200512/UseKey.xml +++ b/tests/resources/xml/wst/200512/UseKey.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/ValidateTarget.xml b/tests/resources/xml/wst/200512/ValidateTarget.xml index 711035de..ba3ace34 100644 --- a/tests/resources/xml/wst/200512/ValidateTarget.xml +++ b/tests/resources/xml/wst/200512/ValidateTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wsx_MetadataReference.xml b/tests/resources/xml/wsx_MetadataReference.xml index 7692170c..57b6c6ba 100644 --- a/tests/resources/xml/wsx_MetadataReference.xml +++ b/tests/resources/xml/wsx_MetadataReference.xml @@ -1,5 +1,5 @@ - - + + https://login.microsoftonline.com/login.srf SomeChunk From 6b57bb83baf6fccdba4093b59f76936f52d7686e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 6 Dec 2025 23:24:06 +0100 Subject: [PATCH 25/34] Migrate to xsd-types --- .../wst_200512/AbstractBinarySecretType.php | 12 +++++------ .../AbstractComputedKeyOpenEnum.php | 4 ++-- .../wst_200512/AbstractKeyTypeOpenEnum.php | 4 ++-- .../AbstractRequestTypeOpenEnum.php | 4 ++-- .../wst_200512/AbstractStatusCodeOpenEnum.php | 4 ++-- .../XML/fed/ClientPseudonymTest.php | 2 +- tests/WSSecurity/XML/fed/PseudonymTest.php | 2 +- .../XML/fed/ReferenceDigestTest.php | 4 ++-- tests/WSSecurity/XML/fed/ReferenceEPRTest.php | 4 ++-- .../XML/fed/ReferenceToken11Test.php | 2 +- .../WSSecurity/XML/fed/ReferenceTokenTest.php | 6 +++--- .../WSSecurity/XML/fed/ReferenceTypeTest.php | 4 ++-- .../XML/fed/RequestPseudonymTest.php | 4 ++-- tests/WSSecurity/XML/fed/SignOutTest.php | 2 +- .../XML/wsa_200508/RetryAfterTest.php | 4 ++-- .../XML/wst_200512/AuthenticationTypeTest.php | 3 ++- .../XML/wst_200512/AuthenticatorTest.php | 11 ++++++++-- .../XML/wst_200512/BinaryExchangeTest.php | 11 ++++++++-- .../XML/wst_200512/BinarySecretTest.php | 9 ++++++--- .../XML/wst_200512/CancelTargetTest.php | 6 +++++- .../CanonicalizationAlgorithmTest.php | 3 ++- .../XML/wst_200512/ChallengeTest.php | 3 ++- .../WSSecurity/XML/wst_200512/ClaimsTest.php | 11 +++++++--- tests/WSSecurity/XML/wst_200512/CodeTest.php | 3 ++- .../XML/wst_200512/CombinedHashTest.php | 5 ++++- .../wst_200512/ComputedKeyAlgorithmTest.php | 3 ++- .../XML/wst_200512/ComputedKeyTest.php | 3 ++- .../XML/wst_200512/DelegatableTest.php | 3 ++- .../XML/wst_200512/DelegateToTest.php | 6 +++++- .../XML/wst_200512/EncryptWithTest.php | 3 ++- .../wst_200512/EncryptionAlgorithmTest.php | 3 ++- .../XML/wst_200512/EncryptionTest.php | 6 +++++- .../WSSecurity/XML/wst_200512/EntropyTest.php | 9 +++++++-- .../XML/wst_200512/ForwardableTest.php | 3 ++- .../XML/wst_200512/IssuedTokensTest.php | 17 ++++++++++++---- .../WSSecurity/XML/wst_200512/IssuerTest.php | 15 +++++++++----- .../XML/wst_200512/KeyExchangeTokenTest.php | 6 +++++- .../WSSecurity/XML/wst_200512/KeySizeTest.php | 3 ++- .../WSSecurity/XML/wst_200512/KeyTypeTest.php | 3 ++- .../XML/wst_200512/KeyWrapAlgorithmTest.php | 3 ++- .../XML/wst_200512/LifetimeTest.php | 6 +++--- .../XML/wst_200512/OnBehalfOfTest.php | 6 +++++- .../XML/wst_200512/ParticipantTest.php | 6 +++++- .../XML/wst_200512/ParticipantsTest.php | 6 +++++- .../WSSecurity/XML/wst_200512/PrimaryTest.php | 6 +++++- .../XML/wst_200512/ProofEncryptionTest.php | 6 +++++- .../WSSecurity/XML/wst_200512/ReasonTest.php | 3 ++- .../XML/wst_200512/RenewTargetTest.php | 6 +++++- .../XML/wst_200512/RenewingTest.php | 6 +++++- .../RequestSecurityTokenCollectionTest.php | 20 +++++++++++++------ ...estSecurityTokenResponseCollectionTest.php | 17 ++++++++++++---- .../RequestSecurityTokenResponseTest.php | 17 ++++++++++++---- .../wst_200512/RequestSecurityTokenTest.php | 15 +++++++++++--- .../XML/wst_200512/RequestTypeTest.php | 3 ++- .../RequestedAttachedReferenceTest.php | 9 ++++++--- .../wst_200512/RequestedProofTokenTest.php | 6 +++++- .../wst_200512/RequestedSecurityTokenTest.php | 6 +++++- .../RequestedUnattachedReferenceTest.php | 9 ++++++--- .../wst_200512/SignChallengeResponseTest.php | 11 +++++++--- .../XML/wst_200512/SignChallengeTest.php | 11 +++++++--- .../XML/wst_200512/SignWithTest.php | 3 ++- .../XML/wst_200512/SignatureAlgorithmTest.php | 3 ++- .../WSSecurity/XML/wst_200512/StatusTest.php | 6 ++++-- .../XML/wst_200512/TokenTypeTest.php | 3 ++- .../WSSecurity/XML/wst_200512/UseKeyTest.php | 8 ++++++-- .../XML/wst_200512/ValidateTargetTest.php | 6 +++++- tests/WSSecurity/XML/wsu/CreatedTest.php | 4 ++-- tests/WSSecurity/XML/wsu/ExpiresTest.php | 4 ++-- tests/WSSecurity/XML/wsu/TimestampTest.php | 9 +++++---- tests/WSSecurity/XML/wsx/DialectTest.php | 3 ++- tests/WSSecurity/XML/wsx/GetMetadataTest.php | 8 +++++--- tests/WSSecurity/XML/wsx/IdentifierTest.php | 3 ++- tests/WSSecurity/XML/wsx/LocationTest.php | 3 ++- .../XML/wsx/MetadataReferenceTest.php | 8 +++++--- .../XML/wsx/MetadataSectionTest.php | 10 ++++++---- tests/WSSecurity/XML/wsx/MetadataTest.php | 12 ++++++----- .../xml/wst/200512/Authenticator.xml | 4 ++-- .../resources/xml/wst/200512/CancelTarget.xml | 4 ++-- tests/resources/xml/wst/200512/Claims.xml | 4 ++-- tests/resources/xml/wst/200512/DelegateTo.xml | 4 ++-- tests/resources/xml/wst/200512/Encryption.xml | 4 ++-- tests/resources/xml/wst/200512/Entropy.xml | 4 ++-- .../resources/xml/wst/200512/IssuedTokens.xml | 4 ++-- tests/resources/xml/wst/200512/Issuer.xml | 2 +- .../xml/wst/200512/KeyExchangeToken.xml | 4 ++-- tests/resources/xml/wst/200512/OnBehalfOf.xml | 4 ++-- .../resources/xml/wst/200512/Participant.xml | 4 ++-- .../resources/xml/wst/200512/Participants.xml | 8 ++++---- tests/resources/xml/wst/200512/Primary.xml | 4 ++-- .../xml/wst/200512/ProofEncryption.xml | 4 ++-- .../resources/xml/wst/200512/RenewTarget.xml | 4 ++-- .../xml/wst/200512/RequestSecurityToken.xml | 4 ++-- .../200512/RequestSecurityTokenCollection.xml | 6 +++--- .../200512/RequestSecurityTokenResponse.xml | 4 ++-- ...RequestSecurityTokenResponseCollection.xml | 4 ++-- .../xml/wst/200512/RequestedProofToken.xml | 4 ++-- .../xml/wst/200512/RequestedSecurityToken.xml | 4 ++-- .../200512/RequestedUnattachedReference.xml | 2 +- .../xml/wst/200512/SignChallenge.xml | 4 ++-- .../xml/wst/200512/SignChallengeResponse.xml | 4 ++-- tests/resources/xml/wst/200512/UseKey.xml | 4 ++-- .../xml/wst/200512/ValidateTarget.xml | 4 ++-- 102 files changed, 387 insertions(+), 200 deletions(-) diff --git a/src/XML/wst_200512/AbstractBinarySecretType.php b/src/XML/wst_200512/AbstractBinarySecretType.php index 40f3a045..f0905737 100644 --- a/src/XML/wst_200512/AbstractBinarySecretType.php +++ b/src/XML/wst_200512/AbstractBinarySecretType.php @@ -9,8 +9,8 @@ use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\Base64BinaryValue; -use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; use SimpleSAML\XMLSchema\XML\Constants\NS; /** @@ -33,12 +33,12 @@ abstract class AbstractBinarySecretType extends AbstractWstElement /** * @param \SimpleSAML\XMLSchema\Type\Base64BinaryValue $content - * @param \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue|null $Type + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Type * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( Base64BinaryValue $content, - protected ?AnyURIListValue $Type = null, + protected ?AnyURIValue $Type = null, array $namespacedAttributes = [], ) { $this->setContent($content); @@ -49,9 +49,9 @@ final public function __construct( /** * Get the Type property. * - * @return \SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getType(): ?AnyURIListValue + public function getType(): ?AnyURIValue { return $this->Type; } @@ -73,7 +73,7 @@ public static function fromXML(DOMElement $xml): static return new static( Base64BinaryValue::fromString($xml->textContent), - self::getAttribute($xml, 'Type', AnyURIListValue::class), + self::getAttribute($xml, 'Type', AnyURIValue::class), self::getAttributesNSFromXML($xml), ); } diff --git a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php index f69e1fa8..ee1ab2cf 100644 --- a/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst_200512/AbstractComputedKeyOpenEnum.php @@ -5,7 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A ComputedKeyOpenEnum element @@ -20,5 +20,5 @@ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = AnyURIListValue::class; + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php b/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php index 74a53020..f8e342c6 100644 --- a/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php +++ b/src/XML/wst_200512/AbstractKeyTypeOpenEnum.php @@ -5,7 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A KeyTypeOpenEnum element @@ -20,5 +20,5 @@ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = AnyURIListValue::class; + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php b/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php index d8af8b5d..31df61c3 100644 --- a/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php +++ b/src/XML/wst_200512/AbstractRequestTypeOpenEnum.php @@ -5,7 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A RequestTypeOpenEnum element @@ -20,5 +20,5 @@ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = AnyURIListValue::class; + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php index bf546802..c5bcc47a 100644 --- a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php @@ -5,7 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\wst_200512; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Type\Helper\AnyURIListValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A StatusCodeOpenEnum element @@ -20,5 +20,5 @@ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = AnyURIListValue::class; + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/tests/WSSecurity/XML/fed/ClientPseudonymTest.php b/tests/WSSecurity/XML/fed/ClientPseudonymTest.php index cfd3ffc3..fe93ec5e 100644 --- a/tests/WSSecurity/XML/fed/ClientPseudonymTest.php +++ b/tests/WSSecurity/XML/fed/ClientPseudonymTest.php @@ -18,7 +18,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Utils\XPath; +use SimpleSAML\XPath\XPath; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/PseudonymTest.php b/tests/WSSecurity/XML/fed/PseudonymTest.php index 02849070..752fc979 100644 --- a/tests/WSSecurity/XML/fed/PseudonymTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymTest.php @@ -21,7 +21,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Utils\XPath; +use SimpleSAML\XPath\XPath; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/ReferenceDigestTest.php b/tests/WSSecurity/XML/fed/ReferenceDigestTest.php index d4e5feab..9bad5b05 100644 --- a/tests/WSSecurity/XML/fed/ReferenceDigestTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceDigestTest.php @@ -14,8 +14,8 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\Base64BinaryValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; diff --git a/tests/WSSecurity/XML/fed/ReferenceEPRTest.php b/tests/WSSecurity/XML/fed/ReferenceEPRTest.php index 190aaa89..70080671 100644 --- a/tests/WSSecurity/XML/fed/ReferenceEPRTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceEPRTest.php @@ -18,8 +18,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/ReferenceToken11Test.php b/tests/WSSecurity/XML/fed/ReferenceToken11Test.php index 77e656f3..05f8d065 100644 --- a/tests/WSSecurity/XML/fed/ReferenceToken11Test.php +++ b/tests/WSSecurity/XML/fed/ReferenceToken11Test.php @@ -16,7 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; diff --git a/tests/WSSecurity/XML/fed/ReferenceTokenTest.php b/tests/WSSecurity/XML/fed/ReferenceTokenTest.php index 027735d7..44d7eedc 100644 --- a/tests/WSSecurity/XML/fed/ReferenceTokenTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceTokenTest.php @@ -25,9 +25,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\Type\Base64BinaryValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/ReferenceTypeTest.php b/tests/WSSecurity/XML/fed/ReferenceTypeTest.php index 38490131..66609fb5 100644 --- a/tests/WSSecurity/XML/fed/ReferenceTypeTest.php +++ b/tests/WSSecurity/XML/fed/ReferenceTypeTest.php @@ -15,8 +15,8 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\AnyURIValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; diff --git a/tests/WSSecurity/XML/fed/RequestPseudonymTest.php b/tests/WSSecurity/XML/fed/RequestPseudonymTest.php index bdf4bbbd..96c47381 100644 --- a/tests/WSSecurity/XML/fed/RequestPseudonymTest.php +++ b/tests/WSSecurity/XML/fed/RequestPseudonymTest.php @@ -15,8 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Type\BooleanValue; -use SimpleSAML\XML\Type\StringValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/fed/SignOutTest.php b/tests/WSSecurity/XML/fed/SignOutTest.php index 22883432..1c0af69c 100644 --- a/tests/WSSecurity/XML/fed/SignOutTest.php +++ b/tests/WSSecurity/XML/fed/SignOutTest.php @@ -17,7 +17,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; -use SimpleSAML\XML\Utils\XPath; +use SimpleSAML\XPath\XPath; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php b/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php index d6e40cb3..86d96da4 100644 --- a/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php +++ b/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractAttributedLongType; +use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractAttributedUnsignedLongType; use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement; use SimpleSAML\WSSecurity\XML\wsa_200508\RetryAfter; use SimpleSAML\XML\Attribute; @@ -25,7 +25,7 @@ */ #[Group('wsa')] #[CoversClass(RetryAfter::class)] -#[CoversClass(AbstractAttributedLongType::class)] +#[CoversClass(AbstractAttributedUnsignedLongType::class)] #[CoversClass(AbstractWsaElement::class)] final class RetryAfterTest extends TestCase { diff --git a/tests/WSSecurity/XML/wst_200512/AuthenticationTypeTest.php b/tests/WSSecurity/XML/wst_200512/AuthenticationTypeTest.php index e77466d3..d2ece971 100644 --- a/tests/WSSecurity/XML/wst_200512/AuthenticationTypeTest.php +++ b/tests/WSSecurity/XML/wst_200512/AuthenticationTypeTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $authenticationType = new AuthenticationType(C::NAMESPACE); + $authenticationType = new AuthenticationType(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php b/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php index 03f79740..d506fa0c 100644 --- a/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php +++ b/tests/WSSecurity/XML/wst_200512/AuthenticatorTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use function dirname; @@ -55,9 +57,14 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + $combinedHash = new CombinedHash( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + ); $authenticator = new Authenticator($combinedHash, [$msgId]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/BinaryExchangeTest.php b/tests/WSSecurity/XML/wst_200512/BinaryExchangeTest.php index 8fcadef8..2b137187 100644 --- a/tests/WSSecurity/XML/wst_200512/BinaryExchangeTest.php +++ b/tests/WSSecurity/XML/wst_200512/BinaryExchangeTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,8 +55,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $binaryExchange = new BinaryExchange('phpunit', C::NAMESPACE, C::NAMESPACE, [$attr1]); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $binaryExchange = new BinaryExchange( + StringValue::fromString('phpunit'), + AnyURIValue::fromString(C::NAMESPACE), + AnyURIValue::fromString(C::NAMESPACE), + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/BinarySecretTest.php b/tests/WSSecurity/XML/wst_200512/BinarySecretTest.php index a5b19927..258775ef 100644 --- a/tests/WSSecurity/XML/wst_200512/BinarySecretTest.php +++ b/tests/WSSecurity/XML/wst_200512/BinarySecretTest.php @@ -16,6 +16,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,11 +57,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $binarySecret = new BinarySecret( - '/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=', - [BinarySecretTypeEnum::Nonce], + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + AnyURIValue::fromString(BinarySecretTypeEnum::Nonce->value), [$attr1], ); diff --git a/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php b/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php index 5d2f653d..543119d3 100644 --- a/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php +++ b/tests/WSSecurity/XML/wst_200512/CancelTargetTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $cancelTarget = new CancelTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/CanonicalizationAlgorithmTest.php b/tests/WSSecurity/XML/wst_200512/CanonicalizationAlgorithmTest.php index 6ad5c162..2637191b 100644 --- a/tests/WSSecurity/XML/wst_200512/CanonicalizationAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200512/CanonicalizationAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $canonicalizationAlgorithm = new CanonicalizationAlgorithm(C::NAMESPACE); + $canonicalizationAlgorithm = new CanonicalizationAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/ChallengeTest.php b/tests/WSSecurity/XML/wst_200512/ChallengeTest.php index d6696b40..da8880cf 100644 --- a/tests/WSSecurity/XML/wst_200512/ChallengeTest.php +++ b/tests/WSSecurity/XML/wst_200512/ChallengeTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -49,7 +50,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $challenge = new Challenge('accepted'); + $challenge = new Challenge(StringValue::fromString('accepted')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/ClaimsTest.php b/tests/WSSecurity/XML/wst_200512/ClaimsTest.php index 24b0be02..6a768b81 100644 --- a/tests/WSSecurity/XML/wst_200512/ClaimsTest.php +++ b/tests/WSSecurity/XML/wst_200512/ClaimsTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,10 +58,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $claims = new Claims(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $claims = new Claims(AnyURIValue::fromString(C::NAMESPACE), [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/CodeTest.php b/tests/WSSecurity/XML/wst_200512/CodeTest.php index 657c110c..553d142f 100644 --- a/tests/WSSecurity/XML/wst_200512/CodeTest.php +++ b/tests/WSSecurity/XML/wst_200512/CodeTest.php @@ -13,6 +13,7 @@ use SimpleSAML\WSSecurity\XML\wst_200512\StatusCodeEnum; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $code = new Code([StatusCodeEnum::Invalid]); + $code = new Code(AnyURIValue::fromString(StatusCodeEnum::Invalid->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/CombinedHashTest.php b/tests/WSSecurity/XML/wst_200512/CombinedHashTest.php index 5c3166c2..96e04356 100644 --- a/tests/WSSecurity/XML/wst_200512/CombinedHashTest.php +++ b/tests/WSSecurity/XML/wst_200512/CombinedHashTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use function dirname; @@ -49,7 +50,9 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + $combinedHash = new CombinedHash( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/ComputedKeyAlgorithmTest.php b/tests/WSSecurity/XML/wst_200512/ComputedKeyAlgorithmTest.php index bded6219..dd28eead 100644 --- a/tests/WSSecurity/XML/wst_200512/ComputedKeyAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200512/ComputedKeyAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $computedKeyAlgorithm = new ComputedKeyAlgorithm(C::NAMESPACE); + $computedKeyAlgorithm = new ComputedKeyAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/ComputedKeyTest.php b/tests/WSSecurity/XML/wst_200512/ComputedKeyTest.php index 86962494..cfc17f32 100644 --- a/tests/WSSecurity/XML/wst_200512/ComputedKeyTest.php +++ b/tests/WSSecurity/XML/wst_200512/ComputedKeyTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $computedKey = new ComputedKey([ComputedKeyEnum::PSHA1]); + $computedKey = new ComputedKey(AnyURIValue::fromString(ComputedKeyEnum::PSHA1->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/DelegatableTest.php b/tests/WSSecurity/XML/wst_200512/DelegatableTest.php index 39e01186..7c731c69 100644 --- a/tests/WSSecurity/XML/wst_200512/DelegatableTest.php +++ b/tests/WSSecurity/XML/wst_200512/DelegatableTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -49,7 +50,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $delegatable = new Delegatable('true'); + $delegatable = new Delegatable(BooleanValue::fromBoolean(true)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/DelegateToTest.php b/tests/WSSecurity/XML/wst_200512/DelegateToTest.php index 180318e3..abea0913 100644 --- a/tests/WSSecurity/XML/wst_200512/DelegateToTest.php +++ b/tests/WSSecurity/XML/wst_200512/DelegateToTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $delegateTo = new DelegateTo($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/EncryptWithTest.php b/tests/WSSecurity/XML/wst_200512/EncryptWithTest.php index 0466e9cd..839d7fff 100644 --- a/tests/WSSecurity/XML/wst_200512/EncryptWithTest.php +++ b/tests/WSSecurity/XML/wst_200512/EncryptWithTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $encryptWith = new EncryptWith(C::NAMESPACE); + $encryptWith = new EncryptWith(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/EncryptionAlgorithmTest.php b/tests/WSSecurity/XML/wst_200512/EncryptionAlgorithmTest.php index fa474c32..0fd1a837 100644 --- a/tests/WSSecurity/XML/wst_200512/EncryptionAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200512/EncryptionAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $encryptionAlgorithm = new EncryptionAlgorithm(C::NAMESPACE); + $encryptionAlgorithm = new EncryptionAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/EncryptionTest.php b/tests/WSSecurity/XML/wst_200512/EncryptionTest.php index 835c89cc..9b199d5f 100644 --- a/tests/WSSecurity/XML/wst_200512/EncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200512/EncryptionTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $encryption = new Encryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/EntropyTest.php b/tests/WSSecurity/XML/wst_200512/EntropyTest.php index 97ec79aa..f310bfb7 100644 --- a/tests/WSSecurity/XML/wst_200512/EntropyTest.php +++ b/tests/WSSecurity/XML/wst_200512/EntropyTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,9 +58,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $entropy = new Entropy([$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/ForwardableTest.php b/tests/WSSecurity/XML/wst_200512/ForwardableTest.php index 66b917c7..25b4bbb3 100644 --- a/tests/WSSecurity/XML/wst_200512/ForwardableTest.php +++ b/tests/WSSecurity/XML/wst_200512/ForwardableTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -49,7 +50,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $forwardable = new Forwardable('true'); + $forwardable = new Forwardable(BooleanValue::fromBoolean(true)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php b/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php index a29f9b6e..61ed42ca 100644 --- a/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php +++ b/tests/WSSecurity/XML/wst_200512/IssuedTokensTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -57,11 +59,18 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $issuedTokens = new IssuedTokens( [$requestSecurityTokenResponse], diff --git a/tests/WSSecurity/XML/wst_200512/IssuerTest.php b/tests/WSSecurity/XML/wst_200512/IssuerTest.php index 44cc6252..0a34641f 100644 --- a/tests/WSSecurity/XML/wst_200512/IssuerTest.php +++ b/tests/WSSecurity/XML/wst_200512/IssuerTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -78,17 +80,20 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address( + AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), + [$attr2], + ), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php b/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php index 00fc5dab..6cb92af0 100644 --- a/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/KeyExchangeTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $keyExchangeToken = new KeyExchangeToken([$msgId]); diff --git a/tests/WSSecurity/XML/wst_200512/KeySizeTest.php b/tests/WSSecurity/XML/wst_200512/KeySizeTest.php index d90f374b..14a812ed 100644 --- a/tests/WSSecurity/XML/wst_200512/KeySizeTest.php +++ b/tests/WSSecurity/XML/wst_200512/KeySizeTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\UnsignedIntValue; use function dirname; @@ -49,7 +50,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $keySize = new KeySize('4096'); + $keySize = new KeySize(UnsignedIntValue::fromInteger(4096)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/KeyTypeTest.php b/tests/WSSecurity/XML/wst_200512/KeyTypeTest.php index 48ebfbf6..6481c408 100644 --- a/tests/WSSecurity/XML/wst_200512/KeyTypeTest.php +++ b/tests/WSSecurity/XML/wst_200512/KeyTypeTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $keyType = new KeyType([KeyTypeEnum::PublicKey]); + $keyType = new KeyType(AnyURIValue::fromString(KeyTypeEnum::PublicKey->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/KeyWrapAlgorithmTest.php b/tests/WSSecurity/XML/wst_200512/KeyWrapAlgorithmTest.php index a14cf062..23d74d08 100644 --- a/tests/WSSecurity/XML/wst_200512/KeyWrapAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200512/KeyWrapAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $keyWrapAlgorithm = new KeyWrapAlgorithm(C::NAMESPACE); + $keyWrapAlgorithm = new KeyWrapAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/LifetimeTest.php b/tests/WSSecurity/XML/wst_200512/LifetimeTest.php index ffacfbad..2b48f45a 100644 --- a/tests/WSSecurity/XML/wst_200512/LifetimeTest.php +++ b/tests/WSSecurity/XML/wst_200512/LifetimeTest.php @@ -4,7 +4,6 @@ namespace SimpleSAML\Test\WSSecurity\XML\wst_200512; -use DateTimeImmutable; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -13,6 +12,7 @@ use SimpleSAML\WSSecurity\XML\wst_200512\Lifetime; use SimpleSAML\WSSecurity\XML\wsu\Created; use SimpleSAML\WSSecurity\XML\wsu\Expires; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -54,8 +54,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $created = new Created(new DateTimeImmutable('2001-09-13T08:42:00Z')); - $expires = new Expires(new DateTimeImmutable('2001-10-13T09:00:00Z')); + $created = new Created(DateTimeValue::fromString('2001-09-13T08:42:00Z')); + $expires = new Expires(DateTimeValue::fromString('2001-10-13T09:00:00Z')); $lifetime = new Lifetime($created, $expires); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php b/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php index 90f2fbc1..5b02e06a 100644 --- a/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php +++ b/tests/WSSecurity/XML/wst_200512/OnBehalfOfTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $onBehalfOf = new OnBehalfOf($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ParticipantTest.php b/tests/WSSecurity/XML/wst_200512/ParticipantTest.php index 2ccc96e0..a3899052 100644 --- a/tests/WSSecurity/XML/wst_200512/ParticipantTest.php +++ b/tests/WSSecurity/XML/wst_200512/ParticipantTest.php @@ -14,6 +14,7 @@ use SimpleSAML\WSSecurity\XML\wst_200512\Participant; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php b/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php index 7e56186e..c93bf708 100644 --- a/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php +++ b/tests/WSSecurity/XML/wst_200512/ParticipantsTest.php @@ -18,6 +18,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -57,7 +58,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $primary = new Primary($msgId); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/PrimaryTest.php b/tests/WSSecurity/XML/wst_200512/PrimaryTest.php index 8476f3f5..d06a2936 100644 --- a/tests/WSSecurity/XML/wst_200512/PrimaryTest.php +++ b/tests/WSSecurity/XML/wst_200512/PrimaryTest.php @@ -14,6 +14,7 @@ use SimpleSAML\WSSecurity\XML\wst_200512\Primary; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $primary = new Primary($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php b/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php index 5b254d3f..be53f1e9 100644 --- a/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200512/ProofEncryptionTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $proofEncryption = new ProofEncryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/ReasonTest.php b/tests/WSSecurity/XML/wst_200512/ReasonTest.php index d778efad..d289b548 100644 --- a/tests/WSSecurity/XML/wst_200512/ReasonTest.php +++ b/tests/WSSecurity/XML/wst_200512/ReasonTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\wst_200512\Reason; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -47,7 +48,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $reason = new Reason('phpunit'); + $reason = new Reason(StringValue::fromString('phpunit')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php b/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php index c4c9f2b6..e6b510a0 100644 --- a/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php +++ b/tests/WSSecurity/XML/wst_200512/RenewTargetTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $renewTarget = new RenewTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/RenewingTest.php b/tests/WSSecurity/XML/wst_200512/RenewingTest.php index e0869366..a57dc7ed 100644 --- a/tests/WSSecurity/XML/wst_200512/RenewingTest.php +++ b/tests/WSSecurity/XML/wst_200512/RenewingTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -51,7 +52,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $renewing = new Renewing(true, false); + $renewing = new Renewing( + BooleanValue::fromBoolean(true), + BooleanValue::fromBoolean(false), + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php index 29dd3e93..cc28eb4d 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenCollectionTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -57,13 +59,19 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId1 = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); - $msgId2 = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df', [$mustUnderstand->toAttribute()]); + $msgId1 = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); + $msgId2 = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $requestSecurityToken1 = new RequestSecurityToken(C::NAMESPACE, [$msgId1], [$attr1]); - $requestSecurityToken2 = new RequestSecurityToken(C::NAMESPACE, [$msgId2], [$attr2]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $requestSecurityToken1 = new RequestSecurityToken(AnyURIValue::fromString(C::NAMESPACE), [$msgId1], [$attr1]); + $requestSecurityToken2 = new RequestSecurityToken(AnyURIValue::fromSTring(C::NAMESPACE), [$msgId2], [$attr2]); $requestSecurityTokenCollection = new RequestSecurityTokenCollection([ $requestSecurityToken1, diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php index a3b03b79..7b3cf187 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseCollectionTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -57,11 +59,18 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $requestSecurityTokenResponseCollection = new RequestSecurityTokenResponseCollection( [$requestSecurityTokenResponse], diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php index acf14712..96c59ab1 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenResponseTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -55,15 +57,22 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $RequestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($RequestSecurityTokenResponse), + strval($requestSecurityTokenResponse), ); } diff --git a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php index 97099291..86c12da4 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestSecurityTokenTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,10 +58,17 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $requestSecurityToken = new RequestSecurityToken(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $requestSecurityToken = new RequestSecurityToken( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/RequestTypeTest.php b/tests/WSSecurity/XML/wst_200512/RequestTypeTest.php index aca16e70..cd98f3d0 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestTypeTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestTypeTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $requestType = new RequestType([RequestTypeEnum::Issue]); + $requestType = new RequestType(AnyURIValue::fromString(RequestTypeEnum::Issue->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/RequestedAttachedReferenceTest.php b/tests/WSSecurity/XML/wst_200512/RequestedAttachedReferenceTest.php index 276299d4..e9740105 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestedAttachedReferenceTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestedAttachedReferenceTest.php @@ -11,11 +11,14 @@ use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestedReferenceType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\RequestedAttachedReference; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,14 +57,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $securityTokenReference = new SecurityTokenReference( - 'SomeID', - 'SomeUsage', + IDValue::fromString('SomeID'), + AnyURIValue::fromString('SomeUsage'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php b/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php index 60a412fc..f8314015 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestedProofTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $requestedProofToken = new RequestedProofToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php index ef012a79..7ee08173 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestedSecurityTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $requestedSecurityToken = new RequestedSecurityToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200512/RequestedUnattachedReferenceTest.php b/tests/WSSecurity/XML/wst_200512/RequestedUnattachedReferenceTest.php index 5e68c0c9..18c34869 100644 --- a/tests/WSSecurity/XML/wst_200512/RequestedUnattachedReferenceTest.php +++ b/tests/WSSecurity/XML/wst_200512/RequestedUnattachedReferenceTest.php @@ -11,11 +11,14 @@ use SimpleSAML\WSSecurity\XML\wst_200512\AbstractRequestedReferenceType; use SimpleSAML\WSSecurity\XML\wst_200512\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200512\RequestedUnattachedReference; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,14 +57,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $securityTokenReference = new SecurityTokenReference( - 'SomeID', - 'SomeUsage', + IDValue::fromString('SomeID'), + AnyURIValue::fromString('SomeUsage'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php b/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php index fe3b5274..19d1e836 100644 --- a/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php +++ b/tests/WSSecurity/XML/wst_200512/SignChallengeResponseTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -57,10 +59,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $challenge = new Challenge('accepted'); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $challenge = new Challenge(StringValue::fromString('accepted')); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $signChallengeResponse = new SignChallengeResponse($challenge, [$msgId], [$attr1]); diff --git a/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php b/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php index 4e24b80e..ea22c2c6 100644 --- a/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php +++ b/tests/WSSecurity/XML/wst_200512/SignChallengeTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -57,10 +59,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $challenge = new Challenge('accepted'); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $challenge = new Challenge(StringValue::fromString('accepted')); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $signChallenge = new SignChallenge($challenge, [$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/SignWithTest.php b/tests/WSSecurity/XML/wst_200512/SignWithTest.php index b39f2b3f..e0582c55 100644 --- a/tests/WSSecurity/XML/wst_200512/SignWithTest.php +++ b/tests/WSSecurity/XML/wst_200512/SignWithTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $signWith = new SignWith(C::NAMESPACE); + $signWith = new SignWith(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/SignatureAlgorithmTest.php b/tests/WSSecurity/XML/wst_200512/SignatureAlgorithmTest.php index 5d3e58f7..ae441e19 100644 --- a/tests/WSSecurity/XML/wst_200512/SignatureAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200512/SignatureAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $signatureAlgorithm = new SignatureAlgorithm(C::NAMESPACE); + $signatureAlgorithm = new SignatureAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/StatusTest.php b/tests/WSSecurity/XML/wst_200512/StatusTest.php index ca3c51bc..9f3d3760 100644 --- a/tests/WSSecurity/XML/wst_200512/StatusTest.php +++ b/tests/WSSecurity/XML/wst_200512/StatusTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $code = new Code([StatusCodeEnum::Invalid]); - $reason = new Reason('phpunit'); + $code = new Code(AnyURIValue::fromString(StatusCodeEnum::Invalid->value)); + $reason = new Reason(StringValue::fromString('phpunit')); $status = new Status($code, $reason); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200512/TokenTypeTest.php b/tests/WSSecurity/XML/wst_200512/TokenTypeTest.php index 085adb30..0b000ae9 100644 --- a/tests/WSSecurity/XML/wst_200512/TokenTypeTest.php +++ b/tests/WSSecurity/XML/wst_200512/TokenTypeTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $tokenType = new TokenType(C::NAMESPACE); + $tokenType = new TokenType(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/UseKeyTest.php b/tests/WSSecurity/XML/wst_200512/UseKeyTest.php index 19a98ec7..6b63f19f 100644 --- a/tests/WSSecurity/XML/wst_200512/UseKeyTest.php +++ b/tests/WSSecurity/XML/wst_200512/UseKeyTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -55,9 +56,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $useKey = new UseKey($msgId, C::NAMESPACE); + $useKey = new UseKey($msgId, AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php b/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php index f1ff37f7..3c9c9eb5 100644 --- a/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php +++ b/tests/WSSecurity/XML/wst_200512/ValidateTargetTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $validateTarget = new ValidateTarget($msgId); diff --git a/tests/WSSecurity/XML/wsu/CreatedTest.php b/tests/WSSecurity/XML/wsu/CreatedTest.php index f8358341..ebbc42ab 100644 --- a/tests/WSSecurity/XML/wsu/CreatedTest.php +++ b/tests/WSSecurity/XML/wsu/CreatedTest.php @@ -4,13 +4,13 @@ namespace SimpleSAML\Test\WSSecurity\XML\wsu; -use DateTimeImmutable; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\WSSecurity\XML\wsu\AbstractAttributedDateTime; use SimpleSAML\WSSecurity\XML\wsu\AbstractWsuElement; use SimpleSAML\WSSecurity\XML\wsu\Created; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -53,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $created = new Created(new DateTimeImmutable('2001-09-13T08:42:00Z')); + $created = new Created(DateTimeValue::fromString('2001-09-13T08:42:00Z')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsu/ExpiresTest.php b/tests/WSSecurity/XML/wsu/ExpiresTest.php index 2be5e2db..fcf67f49 100644 --- a/tests/WSSecurity/XML/wsu/ExpiresTest.php +++ b/tests/WSSecurity/XML/wsu/ExpiresTest.php @@ -4,13 +4,13 @@ namespace SimpleSAML\Test\WSSecurity\XML\wsu; -use DateTimeImmutable; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use SimpleSAML\WSSecurity\XML\wsu\AbstractAttributedDateTime; use SimpleSAML\WSSecurity\XML\wsu\AbstractWsuElement; use SimpleSAML\WSSecurity\XML\wsu\Expires; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -53,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $expires = new Expires(new DateTimeImmutable('2001-10-13T09:00:00Z')); + $expires = new Expires(DateTimeValue::fromString('2001-10-13T09:00:00Z')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsu/TimestampTest.php b/tests/WSSecurity/XML/wsu/TimestampTest.php index 81224846..b542589a 100644 --- a/tests/WSSecurity/XML/wsu/TimestampTest.php +++ b/tests/WSSecurity/XML/wsu/TimestampTest.php @@ -4,7 +4,6 @@ namespace SimpleSAML\Test\WSSecurity\XML\wsu; -use DateTimeImmutable; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -13,6 +12,8 @@ use SimpleSAML\WSSecurity\XML\wsu\Created; use SimpleSAML\WSSecurity\XML\wsu\Expires; use SimpleSAML\WSSecurity\XML\wsu\Timestamp; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -55,9 +56,9 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $created = new Created(new DateTimeImmutable('2001-09-13T08:42:00Z')); - $expires = new Expires(new DateTimeImmutable('2001-10-13T09:00:00Z')); - $timestamp = new Timestamp($created, $expires, 'abc123', [], []); + $created = new Created(DateTimeValue::fromString('2001-09-13T08:42:00Z')); + $expires = new Expires(DateTimeValue::fromString('2001-10-13T09:00:00Z')); + $timestamp = new Timestamp($created, $expires, IDValue::fromString('abc123'), [], []); $this->assertFalse($timestamp->isEmptyElement()); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsx/DialectTest.php b/tests/WSSecurity/XML/wsx/DialectTest.php index 4b7cd6cc..ed990ffe 100644 --- a/tests/WSSecurity/XML/wsx/DialectTest.php +++ b/tests/WSSecurity/XML/wsx/DialectTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $dialect = new Dialect(C::NAMESPACE); + $dialect = new Dialect(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsx/GetMetadataTest.php b/tests/WSSecurity/XML/wsx/GetMetadataTest.php index 27abde75..5ab39797 100644 --- a/tests/WSSecurity/XML/wsx/GetMetadataTest.php +++ b/tests/WSSecurity/XML/wsx/GetMetadataTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,11 +55,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $getMetadata = new GetMetadata( - new Dialect('urn:x-simplesamlphp:namespace'), - new Identifier('urn:x-simplesamlphp:namespace'), + new Dialect(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')), + new Identifier(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')), [$attr1], ); diff --git a/tests/WSSecurity/XML/wsx/IdentifierTest.php b/tests/WSSecurity/XML/wsx/IdentifierTest.php index 8001562c..2ec227f8 100644 --- a/tests/WSSecurity/XML/wsx/IdentifierTest.php +++ b/tests/WSSecurity/XML/wsx/IdentifierTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $identifier = new Identifier(C::NAMESPACE); + $identifier = new Identifier(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsx/LocationTest.php b/tests/WSSecurity/XML/wsx/LocationTest.php index 72d14aa7..588f6398 100644 --- a/tests/WSSecurity/XML/wsx/LocationTest.php +++ b/tests/WSSecurity/XML/wsx/LocationTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $location = new Location(C::NAMESPACE); + $location = new Location(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php b/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php index c2cc6a21..b4894b21 100644 --- a/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php +++ b/tests/WSSecurity/XML/wsx/MetadataReferenceTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -69,13 +71,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), null, null, [$chunk], diff --git a/tests/WSSecurity/XML/wsx/MetadataSectionTest.php b/tests/WSSecurity/XML/wsx/MetadataSectionTest.php index 8ab37710..8cf6735a 100644 --- a/tests/WSSecurity/XML/wsx/MetadataSectionTest.php +++ b/tests/WSSecurity/XML/wsx/MetadataSectionTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -52,12 +54,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $metadataSection = new MetadataSection( - new Location('urn:x-simplesamlphp:namespace'), - 'urn:x-simplesamlphp:namespace', - 'urn:x-simplesamlphp:namespace', + new Location(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')), + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), [$attr1], ); diff --git a/tests/WSSecurity/XML/wsx/MetadataTest.php b/tests/WSSecurity/XML/wsx/MetadataTest.php index 03def486..292cf612 100644 --- a/tests/WSSecurity/XML/wsx/MetadataTest.php +++ b/tests/WSSecurity/XML/wsx/MetadataTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,17 +56,17 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $child = DOMDocumentFactory::fromString( 'Some', ); $metadataSection = new MetadataSection( - new Location('urn:x-simplesamlphp:namespace'), - 'urn:x-simplesamlphp:namespace', - 'urn:x-simplesamlphp:namespace', + new Location(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')), + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), [$attr2], ); diff --git a/tests/resources/xml/wst/200512/Authenticator.xml b/tests/resources/xml/wst/200512/Authenticator.xml index 0a728e53..c7f474ca 100644 --- a/tests/resources/xml/wst/200512/Authenticator.xml +++ b/tests/resources/xml/wst/200512/Authenticator.xml @@ -1,4 +1,4 @@ - + /CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/CancelTarget.xml b/tests/resources/xml/wst/200512/CancelTarget.xml index dca9cb38..45947213 100644 --- a/tests/resources/xml/wst/200512/CancelTarget.xml +++ b/tests/resources/xml/wst/200512/CancelTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Claims.xml b/tests/resources/xml/wst/200512/Claims.xml index 25c6d237..6df6511d 100644 --- a/tests/resources/xml/wst/200512/Claims.xml +++ b/tests/resources/xml/wst/200512/Claims.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/DelegateTo.xml b/tests/resources/xml/wst/200512/DelegateTo.xml index 24c37bb1..49621099 100644 --- a/tests/resources/xml/wst/200512/DelegateTo.xml +++ b/tests/resources/xml/wst/200512/DelegateTo.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Encryption.xml b/tests/resources/xml/wst/200512/Encryption.xml index 80a6127c..be813e2c 100644 --- a/tests/resources/xml/wst/200512/Encryption.xml +++ b/tests/resources/xml/wst/200512/Encryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Entropy.xml b/tests/resources/xml/wst/200512/Entropy.xml index 502011e7..728bcc7a 100644 --- a/tests/resources/xml/wst/200512/Entropy.xml +++ b/tests/resources/xml/wst/200512/Entropy.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/IssuedTokens.xml b/tests/resources/xml/wst/200512/IssuedTokens.xml index 4910c249..4ae34000 100644 --- a/tests/resources/xml/wst/200512/IssuedTokens.xml +++ b/tests/resources/xml/wst/200512/IssuedTokens.xml @@ -1,5 +1,5 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Issuer.xml b/tests/resources/xml/wst/200512/Issuer.xml index 6d6ad995..9492e37d 100644 --- a/tests/resources/xml/wst/200512/Issuer.xml +++ b/tests/resources/xml/wst/200512/Issuer.xml @@ -1,4 +1,4 @@ - + https://login.microsoftonline.com/login.srf diff --git a/tests/resources/xml/wst/200512/KeyExchangeToken.xml b/tests/resources/xml/wst/200512/KeyExchangeToken.xml index ccbc82c9..dddf5bb5 100644 --- a/tests/resources/xml/wst/200512/KeyExchangeToken.xml +++ b/tests/resources/xml/wst/200512/KeyExchangeToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/OnBehalfOf.xml b/tests/resources/xml/wst/200512/OnBehalfOf.xml index fe4ef45c..31cadf7e 100644 --- a/tests/resources/xml/wst/200512/OnBehalfOf.xml +++ b/tests/resources/xml/wst/200512/OnBehalfOf.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Participant.xml b/tests/resources/xml/wst/200512/Participant.xml index 4bcf265b..47d03ea3 100644 --- a/tests/resources/xml/wst/200512/Participant.xml +++ b/tests/resources/xml/wst/200512/Participant.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Participants.xml b/tests/resources/xml/wst/200512/Participants.xml index abccac3c..70b243c1 100644 --- a/tests/resources/xml/wst/200512/Participants.xml +++ b/tests/resources/xml/wst/200512/Participants.xml @@ -1,9 +1,9 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/Primary.xml b/tests/resources/xml/wst/200512/Primary.xml index 814b4f37..bfaac22e 100644 --- a/tests/resources/xml/wst/200512/Primary.xml +++ b/tests/resources/xml/wst/200512/Primary.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/ProofEncryption.xml b/tests/resources/xml/wst/200512/ProofEncryption.xml index 5e6b75b5..3bd6b5ea 100644 --- a/tests/resources/xml/wst/200512/ProofEncryption.xml +++ b/tests/resources/xml/wst/200512/ProofEncryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RenewTarget.xml b/tests/resources/xml/wst/200512/RenewTarget.xml index 70a5686c..4cc499a6 100644 --- a/tests/resources/xml/wst/200512/RenewTarget.xml +++ b/tests/resources/xml/wst/200512/RenewTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestSecurityToken.xml b/tests/resources/xml/wst/200512/RequestSecurityToken.xml index 73d9d256..c3843732 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityToken.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml b/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml index 7d697b83..dd4c31b0 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityTokenCollection.xml @@ -1,8 +1,8 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7df diff --git a/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml b/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml index 252f551b..5ba013ee 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityTokenResponse.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestSecurityTokenResponseCollection.xml b/tests/resources/xml/wst/200512/RequestSecurityTokenResponseCollection.xml index 67a127f8..39487460 100644 --- a/tests/resources/xml/wst/200512/RequestSecurityTokenResponseCollection.xml +++ b/tests/resources/xml/wst/200512/RequestSecurityTokenResponseCollection.xml @@ -1,5 +1,5 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestedProofToken.xml b/tests/resources/xml/wst/200512/RequestedProofToken.xml index 78c8d54d..e54c12db 100644 --- a/tests/resources/xml/wst/200512/RequestedProofToken.xml +++ b/tests/resources/xml/wst/200512/RequestedProofToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestedSecurityToken.xml b/tests/resources/xml/wst/200512/RequestedSecurityToken.xml index 1cf7b1bc..203acc5a 100644 --- a/tests/resources/xml/wst/200512/RequestedSecurityToken.xml +++ b/tests/resources/xml/wst/200512/RequestedSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml b/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml index 01921083..1da8ce15 100644 --- a/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml +++ b/tests/resources/xml/wst/200512/RequestedUnattachedReference.xml @@ -1,4 +1,4 @@ - + SomeChunk diff --git a/tests/resources/xml/wst/200512/SignChallenge.xml b/tests/resources/xml/wst/200512/SignChallenge.xml index c6e26b84..b8ac1312 100644 --- a/tests/resources/xml/wst/200512/SignChallenge.xml +++ b/tests/resources/xml/wst/200512/SignChallenge.xml @@ -1,4 +1,4 @@ - + accepted - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/SignChallengeResponse.xml b/tests/resources/xml/wst/200512/SignChallengeResponse.xml index 79e35a50..128ebd05 100644 --- a/tests/resources/xml/wst/200512/SignChallengeResponse.xml +++ b/tests/resources/xml/wst/200512/SignChallengeResponse.xml @@ -1,4 +1,4 @@ - + accepted - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/UseKey.xml b/tests/resources/xml/wst/200512/UseKey.xml index f7615a96..322fba8b 100644 --- a/tests/resources/xml/wst/200512/UseKey.xml +++ b/tests/resources/xml/wst/200512/UseKey.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200512/ValidateTarget.xml b/tests/resources/xml/wst/200512/ValidateTarget.xml index ba3ace34..8fdb83b7 100644 --- a/tests/resources/xml/wst/200512/ValidateTarget.xml +++ b/tests/resources/xml/wst/200512/ValidateTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de From 59476b60664853a666632e31e67af825ace6d5bd Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 7 Dec 2025 00:43:33 +0100 Subject: [PATCH 26/34] Migrate to xsd-types --- src/XML/wsse/AbstractUsernameTokenType.php | 5 +- .../AbstractComputedKeyOpenEnum.php | 49 +------------------ .../wst_200502/AbstractKeyTypeOpenEnum.php | 49 +------------------ .../AbstractRequestTypeOpenEnum.php | 49 +------------------ .../wst_200502/AbstractStatusCodeOpenEnum.php | 47 +----------------- .../wst_200512/AbstractStatusCodeOpenEnum.php | 2 - .../WSSecurity/XML/wsse/UsernameTokenTest.php | 5 +- .../XML/wst_200502/AuthenticationTypeTest.php | 3 +- .../XML/wst_200502/AuthenticatorTest.php | 11 ++++- .../XML/wst_200502/BinaryExchangeTest.php | 11 ++++- .../XML/wst_200502/BinarySecretTest.php | 6 ++- .../XML/wst_200502/CancelTargetTest.php | 6 ++- .../CanonicalizationAlgorithmTest.php | 3 +- .../XML/wst_200502/ChallengeTest.php | 3 +- .../WSSecurity/XML/wst_200502/ClaimsTest.php | 11 +++-- tests/WSSecurity/XML/wst_200502/CodeTest.php | 3 +- .../XML/wst_200502/CombinedHashTest.php | 5 +- .../wst_200502/ComputedKeyAlgorithmTest.php | 3 +- .../XML/wst_200502/ComputedKeyTest.php | 3 +- .../XML/wst_200502/DelegatableTest.php | 3 +- .../XML/wst_200502/DelegateToTest.php | 6 ++- .../XML/wst_200502/EncryptWithTest.php | 3 +- .../wst_200502/EncryptionAlgorithmTest.php | 3 +- .../XML/wst_200502/EncryptionTest.php | 6 ++- .../WSSecurity/XML/wst_200502/EntropyTest.php | 9 +++- .../XML/wst_200502/ForwardableTest.php | 3 +- .../XML/wst_200502/IssuedTokensTest.php | 17 +++++-- .../WSSecurity/XML/wst_200502/IssuerTest.php | 8 +-- .../XML/wst_200502/KeyExchangeTokenTest.php | 6 ++- .../WSSecurity/XML/wst_200502/KeySizeTest.php | 3 +- .../WSSecurity/XML/wst_200502/KeyTypeTest.php | 3 +- .../XML/wst_200502/LifetimeTest.php | 6 +-- .../XML/wst_200502/OnBehalfOfTest.php | 6 ++- .../XML/wst_200502/ParticipantTest.php | 6 ++- .../XML/wst_200502/ParticipantsTest.php | 6 ++- .../WSSecurity/XML/wst_200502/PrimaryTest.php | 6 ++- .../XML/wst_200502/ProofEncryptionTest.php | 6 ++- .../WSSecurity/XML/wst_200502/ReasonTest.php | 3 +- .../XML/wst_200502/RenewTargetTest.php | 6 ++- .../XML/wst_200502/RenewingTest.php | 3 +- ...estSecurityTokenResponseCollectionTest.php | 17 +++++-- .../RequestSecurityTokenResponseTest.php | 15 ++++-- .../wst_200502/RequestSecurityTokenTest.php | 15 ++++-- .../XML/wst_200502/RequestTypeTest.php | 3 +- .../RequestedAttachedReferenceTest.php | 9 ++-- .../wst_200502/RequestedProofTokenTest.php | 6 ++- .../wst_200502/RequestedSecurityTokenTest.php | 6 ++- .../RequestedUnattachedReferenceTest.php | 9 ++-- .../wst_200502/SignChallengeResponseTest.php | 11 +++-- .../XML/wst_200502/SignChallengeTest.php | 11 +++-- .../XML/wst_200502/SignWithTest.php | 3 +- .../XML/wst_200502/SignatureAlgorithmTest.php | 3 +- .../WSSecurity/XML/wst_200502/StatusTest.php | 6 ++- .../XML/wst_200502/TokenTypeTest.php | 3 +- .../WSSecurity/XML/wst_200502/UseKeyTest.php | 8 ++- tests/resources/xml/wsse_UsernameToken.xml | 2 +- .../xml/wst/200502/Authenticator.xml | 4 +- .../resources/xml/wst/200502/CancelTarget.xml | 4 +- tests/resources/xml/wst/200502/Claims.xml | 4 +- tests/resources/xml/wst/200502/DelegateTo.xml | 4 +- tests/resources/xml/wst/200502/Encryption.xml | 4 +- tests/resources/xml/wst/200502/Entropy.xml | 4 +- .../resources/xml/wst/200502/IssuedTokens.xml | 4 +- .../xml/wst/200502/KeyExchangeToken.xml | 4 +- tests/resources/xml/wst/200502/OnBehalfOf.xml | 4 +- .../resources/xml/wst/200502/Participant.xml | 4 +- .../resources/xml/wst/200502/Participants.xml | 8 +-- tests/resources/xml/wst/200502/Primary.xml | 4 +- .../xml/wst/200502/ProofEncryption.xml | 4 +- .../resources/xml/wst/200502/RenewTarget.xml | 4 +- .../xml/wst/200502/RequestSecurityToken.xml | 4 +- .../200502/RequestSecurityTokenResponse.xml | 4 +- ...RequestSecurityTokenResponseCollection.xml | 4 +- .../xml/wst/200502/RequestedProofToken.xml | 4 +- .../xml/wst/200502/RequestedSecurityToken.xml | 4 +- .../200502/RequestedUnattachedReference.xml | 2 +- .../xml/wst/200502/SignChallenge.xml | 4 +- .../xml/wst/200502/SignChallengeResponse.xml | 4 +- tests/resources/xml/wst/200502/UseKey.xml | 4 +- 79 files changed, 294 insertions(+), 319 deletions(-) diff --git a/src/XML/wsse/AbstractUsernameTokenType.php b/src/XML/wsse/AbstractUsernameTokenType.php index 22d6cb4b..74f3f905 100644 --- a/src/XML/wsse/AbstractUsernameTokenType.php +++ b/src/XML/wsse/AbstractUsernameTokenType.php @@ -104,7 +104,7 @@ public static function fromXML(DOMElement $xml): static $Id = null; if ($xml->hasAttributeNS(C::NS_SEC_UTIL, 'Id')) { - $ID = $xml->getAttributeNS(C::NS_SEC_UTIL, 'Id'); + $Id = IDValue::fromString($xml->getAttributeNS(C::NS_SEC_UTIL, 'Id')); } return new static( @@ -128,7 +128,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $attributes = $this->getAttributesNS(); if ($this->getId() !== null) { - $idAttr = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', $this->getId()); + $idAttr = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', $this->getId()->getValue()); array_unshift($attributes, $idAttr); } @@ -138,7 +138,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $this->getUsername()->toXML($e); - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php index e042560c..20691bec 100644 --- a/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php @@ -4,23 +4,13 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A ComputedKeyOpenEnum element * * @package simplesamlphp/ws-security - * - * @phpstan-consistent-constructor */ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement { @@ -28,40 +18,5 @@ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200502\ComputedKeyEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (ComputedKeyEnum|string $v): string { - return ($v instanceof ComputedKeyEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(StringValue::fromString(implode(' ', $values))); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php b/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php index 567bd22c..fa809335 100644 --- a/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php +++ b/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php @@ -4,23 +4,13 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A KeyTypeOpenEnum element * * @package simplesamlphp/ws-security - * - * @phpstan-consistent-constructor */ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement { @@ -28,40 +18,5 @@ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200502\KeyTypeEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (KeyTypeEnum|string $v): string { - return ($v instanceof KeyTypeEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(StringValue::fromString(implode(' ', $values))); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php b/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php index 3ff914a7..a2a1e4a5 100644 --- a/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php +++ b/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php @@ -4,23 +4,13 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A RequestTypeOpenEnum element * * @package simplesamlphp/ws-security - * - * @phpstan-consistent-constructor */ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement { @@ -28,40 +18,5 @@ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200502\RequestTypeEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (RequestTypeEnum|string $v): string { - return ($v instanceof RequestTypeEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(StringValue::fromString(implode(' ', $values))); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php index b3eeffd7..153eadb4 100644 --- a/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php @@ -4,16 +4,8 @@ namespace SimpleSAML\WSSecurity\XML\wst_200502; -use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; -use SimpleSAML\XMLSchema\Exception\SchemaViolationException; -use SimpleSAML\XMLSchema\Type\StringValue; - -use function array_map; -use function explode; -use function implode; +use SimpleSAML\XMLSchema\Type\AnyURIValue; /** * A StatusCodeOpenEnum element @@ -28,40 +20,5 @@ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; - - - /** - * @param (\SimpleSAML\WSSecurity\XML\wst_200502\StatusCodeEnum|string)[] $values - */ - public function __construct(array $values) - { - $values = array_map( - function (StatusCodeEnum|string $v): string { - return ($v instanceof StatusCodeEnum) ? $v->value : $v; - }, - $values, - ); - Assert::allValidURI($values, SchemaViolationException::class); - - $this->setContent(StringValue::fromString(implode(' ', $values))); - } - - - /** - * Convert XML into a class instance - * - * @param \DOMElement $xml The XML element we should load - * @return static - * - * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException - * If the qualified name of the supplied element is wrong - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static(explode(' ', $xml->textContent)); - } + public const TEXTCONTENT_TYPE = AnyURIValue::class; } diff --git a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php index c5bcc47a..e0b74e84 100644 --- a/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst_200512/AbstractStatusCodeOpenEnum.php @@ -11,8 +11,6 @@ * A StatusCodeOpenEnum element * * @package simplesamlphp/ws-security - * - * @phpstan-consistent-constructor */ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement { diff --git a/tests/WSSecurity/XML/wsse/UsernameTokenTest.php b/tests/WSSecurity/XML/wsse/UsernameTokenTest.php index ff5417e1..ee0c6ebc 100644 --- a/tests/WSSecurity/XML/wsse/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/wsse/UsernameTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -55,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $username = new Username('johndoe@example.com', 'OtherID', [$attr2]); $child = DOMDocumentFactory::fromString( 'SomeChunk', diff --git a/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php b/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php index cb12750a..39315cd6 100644 --- a/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php +++ b/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $authenticationType = new AuthenticationType(C::NAMESPACE); + $authenticationType = new AuthenticationType(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php b/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php index 50aab6c6..97f55ad0 100644 --- a/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php +++ b/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use function dirname; @@ -57,9 +59,14 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + $combinedHash = new CombinedHash( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + ); $authenticator = new Authenticator($combinedHash, [$msgId]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php b/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php index f60a37ca..6500acdb 100644 --- a/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php +++ b/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -55,8 +57,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $binaryExchange = new BinaryExchange('phpunit', C::NAMESPACE, C::NAMESPACE, [$attr1]); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $binaryExchange = new BinaryExchange( + StringValue::fromString('phpunit'), + AnyURIValue::fromString(C::NAMESPACE), + AnyURIValue::fromString(C::NAMESPACE), + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php b/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php index 4bb4b80c..01d54a02 100644 --- a/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php +++ b/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,10 +58,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $binarySecret = new BinarySecret( - '/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=', + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), [BinarySecretTypeEnum::Nonce], [$attr1], ); diff --git a/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php b/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php index c2a7f075..1b26947f 100644 --- a/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php +++ b/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $cancelTarget = new CancelTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php index 914b28c0..70f1ec77 100644 --- a/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $canonicalizationAlgorithm = new CanonicalizationAlgorithm(C::NAMESPACE); + $canonicalizationAlgorithm = new CanonicalizationAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/ChallengeTest.php b/tests/WSSecurity/XML/wst_200502/ChallengeTest.php index 000bcb8b..b8f5229c 100644 --- a/tests/WSSecurity/XML/wst_200502/ChallengeTest.php +++ b/tests/WSSecurity/XML/wst_200502/ChallengeTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $challenge = new Challenge('accepted'); + $challenge = new Challenge(StringValue::fromString('accepted')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/ClaimsTest.php b/tests/WSSecurity/XML/wst_200502/ClaimsTest.php index 166b0b15..98c9e29e 100644 --- a/tests/WSSecurity/XML/wst_200502/ClaimsTest.php +++ b/tests/WSSecurity/XML/wst_200502/ClaimsTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,10 +60,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $claims = new Claims(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $claims = new Claims(AnyURIValue::fromString(C::NAMESPACE), [$msgId], [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/CodeTest.php b/tests/WSSecurity/XML/wst_200502/CodeTest.php index 31b8d4f3..71440646 100644 --- a/tests/WSSecurity/XML/wst_200502/CodeTest.php +++ b/tests/WSSecurity/XML/wst_200502/CodeTest.php @@ -13,6 +13,7 @@ use SimpleSAML\WSSecurity\XML\wst_200502\StatusCodeEnum; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $code = new Code([StatusCodeEnum::Invalid]); + $code = new Code(AnyURIValue::fromString(StatusCodeEnum::Invalid->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php b/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php index 4a26667b..6880d1d6 100644 --- a/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php +++ b/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\Base64BinaryValue; use function dirname; @@ -51,7 +52,9 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + $combinedHash = new CombinedHash( + Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='), + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php index 17e35bf3..3a71237b 100644 --- a/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $computedKeyAlgorithm = new ComputedKeyAlgorithm(C::NAMESPACE); + $computedKeyAlgorithm = new ComputedKeyAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php b/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php index 2ed60b88..3f7c4180 100644 --- a/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php +++ b/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $computedKey = new ComputedKey([ComputedKeyEnum::PSHA1]); + $computedKey = new ComputedKey(AnyURIValue::fromString(ComputedKeyEnum::PSHA1->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/DelegatableTest.php b/tests/WSSecurity/XML/wst_200502/DelegatableTest.php index 7f35761d..5a256a6e 100644 --- a/tests/WSSecurity/XML/wst_200502/DelegatableTest.php +++ b/tests/WSSecurity/XML/wst_200502/DelegatableTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $delegatable = new Delegatable('true'); + $delegatable = new Delegatable(BooleanValue::fromBoolean(true)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/DelegateToTest.php b/tests/WSSecurity/XML/wst_200502/DelegateToTest.php index c3a1862b..40d56781 100644 --- a/tests/WSSecurity/XML/wst_200502/DelegateToTest.php +++ b/tests/WSSecurity/XML/wst_200502/DelegateToTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $delegateTo = new DelegateTo($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php b/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php index a6f77f3f..f7a435b8 100644 --- a/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php +++ b/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $encryptWith = new EncryptWith(C::NAMESPACE); + $encryptWith = new EncryptWith(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php index a7536aa8..4f600899 100644 --- a/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $encryptionAlgorithm = new EncryptionAlgorithm(C::NAMESPACE); + $encryptionAlgorithm = new EncryptionAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/EncryptionTest.php b/tests/WSSecurity/XML/wst_200502/EncryptionTest.php index ffab0a82..1fb3d331 100644 --- a/tests/WSSecurity/XML/wst_200502/EncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200502/EncryptionTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $encryption = new Encryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/EntropyTest.php b/tests/WSSecurity/XML/wst_200502/EntropyTest.php index d3fdae91..86b75981 100644 --- a/tests/WSSecurity/XML/wst_200502/EntropyTest.php +++ b/tests/WSSecurity/XML/wst_200502/EntropyTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,9 +60,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $entropy = new Entropy([$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/ForwardableTest.php b/tests/WSSecurity/XML/wst_200502/ForwardableTest.php index 065cfa1e..b15c2d12 100644 --- a/tests/WSSecurity/XML/wst_200502/ForwardableTest.php +++ b/tests/WSSecurity/XML/wst_200502/ForwardableTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $forwardable = new Forwardable('true'); + $forwardable = new Forwardable(BooleanValue::fromBoolean(true)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php b/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php index 3a627898..858d542d 100644 --- a/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php +++ b/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -59,11 +61,18 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $issuedTokens = new IssuedTokens( [$requestSecurityTokenResponse], diff --git a/tests/WSSecurity/XML/wst_200502/IssuerTest.php b/tests/WSSecurity/XML/wst_200502/IssuerTest.php index 215c2152..0ca5fd05 100644 --- a/tests/WSSecurity/XML/wst_200502/IssuerTest.php +++ b/tests/WSSecurity/XML/wst_200502/IssuerTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -73,14 +75,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $chunk = new Chunk(self::$customContent); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), null, $referenceParameters, null, diff --git a/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php b/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php index 42da4eaa..5039885d 100644 --- a/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $keyExchangeToken = new KeyExchangeToken([$msgId]); diff --git a/tests/WSSecurity/XML/wst_200502/KeySizeTest.php b/tests/WSSecurity/XML/wst_200502/KeySizeTest.php index 6d590962..ddcb924e 100644 --- a/tests/WSSecurity/XML/wst_200502/KeySizeTest.php +++ b/tests/WSSecurity/XML/wst_200502/KeySizeTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\UnsignedIntValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $keySize = new KeySize('4096'); + $keySize = new KeySize(UnsignedIntValue::fromInteger(4096)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php b/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php index c0d29bcc..705ff092 100644 --- a/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php +++ b/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $keyType = new KeyType([KeyTypeEnum::PublicKey]); + $keyType = new KeyType(AnyURIValue::fromString(KeyTypeEnum::PublicKey->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/LifetimeTest.php b/tests/WSSecurity/XML/wst_200502/LifetimeTest.php index 7b8a1483..5a55a465 100644 --- a/tests/WSSecurity/XML/wst_200502/LifetimeTest.php +++ b/tests/WSSecurity/XML/wst_200502/LifetimeTest.php @@ -4,7 +4,6 @@ namespace SimpleSAML\Test\WSSecurity\XML\wst_200502; -use DateTimeImmutable; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -13,6 +12,7 @@ use SimpleSAML\WSSecurity\XML\wst_200502\Lifetime; use SimpleSAML\WSSecurity\XML\wsu\Created; use SimpleSAML\WSSecurity\XML\wsu\Expires; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; @@ -56,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $created = new Created(new DateTimeImmutable('2001-09-13T08:42:00Z')); - $expires = new Expires(new DateTimeImmutable('2001-10-13T09:00:00Z')); + $created = new Created(DateTimeValue::fromString('2001-09-13T08:42:00Z')); + $expires = new Expires(DateTimeValue::fromString('2001-10-13T09:00:00Z')); $lifetime = new Lifetime($created, $expires); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php b/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php index e8d9bfd4..432b5c4b 100644 --- a/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php +++ b/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $onBehalfOf = new OnBehalfOf($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ParticipantTest.php b/tests/WSSecurity/XML/wst_200502/ParticipantTest.php index 9b0acf8f..317f6cd1 100644 --- a/tests/WSSecurity/XML/wst_200502/ParticipantTest.php +++ b/tests/WSSecurity/XML/wst_200502/ParticipantTest.php @@ -14,6 +14,7 @@ use SimpleSAML\WSSecurity\XML\wst_200502\Participant; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php b/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php index cf95be7b..11f0382a 100644 --- a/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php +++ b/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php @@ -18,6 +18,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -59,7 +60,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $primary = new Primary($msgId); $participant = new Participant($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/PrimaryTest.php b/tests/WSSecurity/XML/wst_200502/PrimaryTest.php index 168766c3..ad247821 100644 --- a/tests/WSSecurity/XML/wst_200502/PrimaryTest.php +++ b/tests/WSSecurity/XML/wst_200502/PrimaryTest.php @@ -14,6 +14,7 @@ use SimpleSAML\WSSecurity\XML\wst_200502\Primary; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $primary = new Primary($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php b/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php index bd4d52ef..e9b4430c 100644 --- a/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php +++ b/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $proofEncryption = new ProofEncryption($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/ReasonTest.php b/tests/WSSecurity/XML/wst_200502/ReasonTest.php index 8ee6987b..c250d9e8 100644 --- a/tests/WSSecurity/XML/wst_200502/ReasonTest.php +++ b/tests/WSSecurity/XML/wst_200502/ReasonTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\wst_200502\Reason; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -47,7 +48,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $reason = new Reason('phpunit'); + $reason = new Reason(StringValue::fromString('phpunit')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php b/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php index dc048ebc..0dbea66d 100644 --- a/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php +++ b/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $renewTarget = new RenewTarget($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/RenewingTest.php b/tests/WSSecurity/XML/wst_200502/RenewingTest.php index 2f61f1f5..650e706a 100644 --- a/tests/WSSecurity/XML/wst_200502/RenewingTest.php +++ b/tests/WSSecurity/XML/wst_200502/RenewingTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -53,7 +54,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $renewing = new Renewing(true, false); + $renewing = new Renewing(BooleanValue::fromBoolean(true), BooleanValue::fromBoolean(false)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php index 2644b14d..9a78f9d6 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -59,11 +61,18 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $requestSecurityTokenResponseCollection = new RequestSecurityTokenResponseCollection( [$requestSecurityTokenResponse], diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php index 843a56c7..03ebdac9 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,10 +60,17 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $requestSecurityTokenResponse = new RequestSecurityTokenResponse( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php index 4e78b5fd..f345fed6 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,10 +60,17 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $requestSecurityToken = new RequestSecurityToken(C::NAMESPACE, [$msgId], [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $requestSecurityToken = new RequestSecurityToken( + AnyURIValue::fromString(C::NAMESPACE), + [$msgId], + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php b/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php index 933cd1b8..6d0604c3 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $requestType = new RequestType([RequestTypeEnum::Issue]); + $requestType = new RequestType(AnyURIValue::fromString(RequestTypeEnum::Issue->value)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php b/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php index bdc2b463..fada2320 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php @@ -11,11 +11,14 @@ use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestedReferenceType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\RequestedAttachedReference; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,14 +59,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $securityTokenReference = new SecurityTokenReference( - 'SomeID', - 'SomeUsage', + IDValue::fromString('SomeID'), + AnyURIValue::fromString('SomeUsage'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php index b6282ec1..be97d25f 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $requestedProofToken = new RequestedProofToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php index 97ba0448..ef5fa80e 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -56,7 +57,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $requestedSecurityToken = new RequestedSecurityToken($msgId); diff --git a/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php b/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php index 24c238bb..f13717bd 100644 --- a/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php +++ b/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php @@ -11,11 +11,14 @@ use SimpleSAML\WSSecurity\XML\wst_200502\AbstractRequestedReferenceType; use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement; use SimpleSAML\WSSecurity\XML\wst_200502\RequestedUnattachedReference; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,14 +59,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $securityTokenReference = new SecurityTokenReference( - 'SomeID', - 'SomeUsage', + IDValue::fromString('SomeID'), + AnyURIValue::fromString('SomeUsage'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php b/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php index e6ca142a..3ed82a55 100644 --- a/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php +++ b/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -59,10 +61,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $challenge = new Challenge('accepted'); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $challenge = new Challenge(StringValue::fromString('accepted')); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $signChallengeResponse = new SignChallengeResponse($challenge, [$msgId], [$attr1]); diff --git a/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php b/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php index 6a01d576..90f4b21e 100644 --- a/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php +++ b/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -59,10 +61,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $challenge = new Challenge('accepted'); - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $challenge = new Challenge(StringValue::fromString('accepted')); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $signChallenge = new SignChallenge($challenge, [$msgId], [$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/SignWithTest.php b/tests/WSSecurity/XML/wst_200502/SignWithTest.php index bcb8f67a..6e1046f5 100644 --- a/tests/WSSecurity/XML/wst_200502/SignWithTest.php +++ b/tests/WSSecurity/XML/wst_200502/SignWithTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $signWith = new SignWith(C::NAMESPACE); + $signWith = new SignWith(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php index 024c7781..1b96391f 100644 --- a/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php +++ b/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $signatureAlgorithm = new SignatureAlgorithm(C::NAMESPACE); + $signatureAlgorithm = new SignatureAlgorithm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/StatusTest.php b/tests/WSSecurity/XML/wst_200502/StatusTest.php index 765889c5..8d27dfdb 100644 --- a/tests/WSSecurity/XML/wst_200502/StatusTest.php +++ b/tests/WSSecurity/XML/wst_200502/StatusTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -56,8 +58,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $code = new Code([StatusCodeEnum::Invalid]); - $reason = new Reason('phpunit'); + $code = new Code(AnyURIValue::fromString(StatusCodeEnum::Invalid->value)); + $reason = new Reason(StringValue::fromString('phpunit')); $status = new Status($code, $reason); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php b/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php index af796ab4..4650d717 100644 --- a/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php +++ b/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $tokenType = new TokenType(C::NAMESPACE); + $tokenType = new TokenType(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wst_200502/UseKeyTest.php b/tests/WSSecurity/XML/wst_200502/UseKeyTest.php index 01722d1e..0b4c5fdd 100644 --- a/tests/WSSecurity/XML/wst_200502/UseKeyTest.php +++ b/tests/WSSecurity/XML/wst_200502/UseKeyTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -57,9 +58,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); - $useKey = new UseKey($msgId, C::NAMESPACE); + $useKey = new UseKey($msgId, AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/resources/xml/wsse_UsernameToken.xml b/tests/resources/xml/wsse_UsernameToken.xml index 4016ffb8..4dff7403 100644 --- a/tests/resources/xml/wsse_UsernameToken.xml +++ b/tests/resources/xml/wsse_UsernameToken.xml @@ -1,4 +1,4 @@ - + johndoe@example.com SomeChunk diff --git a/tests/resources/xml/wst/200502/Authenticator.xml b/tests/resources/xml/wst/200502/Authenticator.xml index cdf09646..51867d56 100644 --- a/tests/resources/xml/wst/200502/Authenticator.xml +++ b/tests/resources/xml/wst/200502/Authenticator.xml @@ -1,4 +1,4 @@ - + /CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/CancelTarget.xml b/tests/resources/xml/wst/200502/CancelTarget.xml index 09a18e2e..d62c92a3 100644 --- a/tests/resources/xml/wst/200502/CancelTarget.xml +++ b/tests/resources/xml/wst/200502/CancelTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Claims.xml b/tests/resources/xml/wst/200502/Claims.xml index 92964edc..a9094222 100644 --- a/tests/resources/xml/wst/200502/Claims.xml +++ b/tests/resources/xml/wst/200502/Claims.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/DelegateTo.xml b/tests/resources/xml/wst/200502/DelegateTo.xml index 694e8033..e946cdc3 100644 --- a/tests/resources/xml/wst/200502/DelegateTo.xml +++ b/tests/resources/xml/wst/200502/DelegateTo.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Encryption.xml b/tests/resources/xml/wst/200502/Encryption.xml index 11f322ca..a9f56b28 100644 --- a/tests/resources/xml/wst/200502/Encryption.xml +++ b/tests/resources/xml/wst/200502/Encryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Entropy.xml b/tests/resources/xml/wst/200502/Entropy.xml index f4bc387b..d7e2baec 100644 --- a/tests/resources/xml/wst/200502/Entropy.xml +++ b/tests/resources/xml/wst/200502/Entropy.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/IssuedTokens.xml b/tests/resources/xml/wst/200502/IssuedTokens.xml index 9ddb5249..a4907a57 100644 --- a/tests/resources/xml/wst/200502/IssuedTokens.xml +++ b/tests/resources/xml/wst/200502/IssuedTokens.xml @@ -1,5 +1,5 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/KeyExchangeToken.xml b/tests/resources/xml/wst/200502/KeyExchangeToken.xml index 21dc9494..e9d1374e 100644 --- a/tests/resources/xml/wst/200502/KeyExchangeToken.xml +++ b/tests/resources/xml/wst/200502/KeyExchangeToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/OnBehalfOf.xml b/tests/resources/xml/wst/200502/OnBehalfOf.xml index f2d41fc4..d63452a5 100644 --- a/tests/resources/xml/wst/200502/OnBehalfOf.xml +++ b/tests/resources/xml/wst/200502/OnBehalfOf.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Participant.xml b/tests/resources/xml/wst/200502/Participant.xml index d30eda61..f1a367d4 100644 --- a/tests/resources/xml/wst/200502/Participant.xml +++ b/tests/resources/xml/wst/200502/Participant.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Participants.xml b/tests/resources/xml/wst/200502/Participants.xml index be07d753..27eecc2a 100644 --- a/tests/resources/xml/wst/200502/Participants.xml +++ b/tests/resources/xml/wst/200502/Participants.xml @@ -1,9 +1,9 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/Primary.xml b/tests/resources/xml/wst/200502/Primary.xml index 6d8ee38b..c2421575 100644 --- a/tests/resources/xml/wst/200502/Primary.xml +++ b/tests/resources/xml/wst/200502/Primary.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/ProofEncryption.xml b/tests/resources/xml/wst/200502/ProofEncryption.xml index 0725100c..314a01bb 100644 --- a/tests/resources/xml/wst/200502/ProofEncryption.xml +++ b/tests/resources/xml/wst/200502/ProofEncryption.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RenewTarget.xml b/tests/resources/xml/wst/200502/RenewTarget.xml index b48728ac..64927670 100644 --- a/tests/resources/xml/wst/200502/RenewTarget.xml +++ b/tests/resources/xml/wst/200502/RenewTarget.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestSecurityToken.xml b/tests/resources/xml/wst/200502/RequestSecurityToken.xml index 369d349b..780b0495 100644 --- a/tests/resources/xml/wst/200502/RequestSecurityToken.xml +++ b/tests/resources/xml/wst/200502/RequestSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml b/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml index 7b9bf1d2..83188885 100644 --- a/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml +++ b/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml b/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml index 2cb47e75..b0fa04ea 100644 --- a/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml +++ b/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml @@ -1,5 +1,5 @@ - + - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestedProofToken.xml b/tests/resources/xml/wst/200502/RequestedProofToken.xml index a1681a58..950d0e23 100644 --- a/tests/resources/xml/wst/200502/RequestedProofToken.xml +++ b/tests/resources/xml/wst/200502/RequestedProofToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestedSecurityToken.xml b/tests/resources/xml/wst/200502/RequestedSecurityToken.xml index 1f18281a..d9356383 100644 --- a/tests/resources/xml/wst/200502/RequestedSecurityToken.xml +++ b/tests/resources/xml/wst/200502/RequestedSecurityToken.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml b/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml index ad70c03e..a49634ee 100644 --- a/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml +++ b/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml @@ -1,4 +1,4 @@ - + SomeChunk diff --git a/tests/resources/xml/wst/200502/SignChallenge.xml b/tests/resources/xml/wst/200502/SignChallenge.xml index 285fd6a1..8404a875 100644 --- a/tests/resources/xml/wst/200502/SignChallenge.xml +++ b/tests/resources/xml/wst/200502/SignChallenge.xml @@ -1,4 +1,4 @@ - + accepted - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/SignChallengeResponse.xml b/tests/resources/xml/wst/200502/SignChallengeResponse.xml index 6116428b..2ef3f2fd 100644 --- a/tests/resources/xml/wst/200502/SignChallengeResponse.xml +++ b/tests/resources/xml/wst/200502/SignChallengeResponse.xml @@ -1,4 +1,4 @@ - + accepted - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de diff --git a/tests/resources/xml/wst/200502/UseKey.xml b/tests/resources/xml/wst/200502/UseKey.xml index 98cf523e..5be13dbf 100644 --- a/tests/resources/xml/wst/200502/UseKey.xml +++ b/tests/resources/xml/wst/200502/UseKey.xml @@ -1,3 +1,3 @@ - - uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de From 0cf7e1362aa57f5ec51b8d4bbc0f4fbcb71fbc4c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 8 Dec 2025 00:08:14 +0100 Subject: [PATCH 27/34] Migrate to xsd-types --- src/XML/wsse/AbstractSecurityTokenReferenceType.php | 2 +- src/XML/wsse/AbstractUsernameTokenType.php | 4 ++-- .../WSSecurity/XML/wsse/BinarySecurityTokenTest.php | 13 ++++++++----- tests/WSSecurity/XML/wsse/EmbeddedTest.php | 6 ++++-- tests/WSSecurity/XML/wsse/KeyIdentifierTest.php | 13 ++++++++----- tests/WSSecurity/XML/wsse/NonceTest.php | 11 +++++++---- tests/WSSecurity/XML/wsse/PasswordTest.php | 12 ++++++++++-- tests/WSSecurity/XML/wsse/ReferenceTest.php | 8 +++++--- tests/WSSecurity/XML/wsse/SecurityTest.php | 3 ++- .../XML/wsse/SecurityTokenReferenceTest.php | 9 ++++++--- .../XML/wsse/TransformationParametersTest.php | 3 ++- tests/WSSecurity/XML/wsse/UsernameTest.php | 10 ++++++++-- tests/WSSecurity/XML/wsse/UsernameTokenTest.php | 9 +++++++-- tests/resources/xml/wsse_UsernameToken.xml | 2 +- 14 files changed, 71 insertions(+), 34 deletions(-) diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index d694c555..37542f18 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -7,12 +7,12 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_unshift; diff --git a/src/XML/wsse/AbstractUsernameTokenType.php b/src/XML/wsse/AbstractUsernameTokenType.php index 74f3f905..e25fc01d 100644 --- a/src/XML/wsse/AbstractUsernameTokenType.php +++ b/src/XML/wsse/AbstractUsernameTokenType.php @@ -7,13 +7,13 @@ use DOMElement; use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Exception\MissingElementException; use SimpleSAML\XMLSchema\Exception\TooManyElementsException; -use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\XML\Constants\NS; use function array_pop; @@ -128,7 +128,7 @@ public function toXML(?DOMElement $parent = null): DOMElement $attributes = $this->getAttributesNS(); if ($this->getId() !== null) { - $idAttr = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', $this->getId()->getValue()); + $idAttr = $this->getId()->toAttribute(); array_unshift($attributes, $idAttr); } diff --git a/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php b/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php index a127443e..671f992d 100644 --- a/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php +++ b/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php @@ -12,10 +12,13 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractEncodedString; use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\BinarySecurityToken; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -58,14 +61,14 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $content = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='; - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $binarySecurityToken = new BinarySecurityToken( - $content, - 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', - 'SomeID', - 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary', + StringValue::fromString($content), + IDValue::fromString('SomeID'), [$attr1], + AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), + AnyURIValue::fromString('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary'), ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsse/EmbeddedTest.php b/tests/WSSecurity/XML/wsse/EmbeddedTest.php index ed82f9c3..f81ed962 100644 --- a/tests/WSSecurity/XML/wsse/EmbeddedTest.php +++ b/tests/WSSecurity/XML/wsse/EmbeddedTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,13 +56,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $embedded = new Embedded( - 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', + AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php b/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php index bdf1f96d..42491d76 100644 --- a/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php +++ b/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php @@ -12,10 +12,13 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractKeyIdentifierType; use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\KeyIdentifier; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -58,14 +61,14 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $content = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='; - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $keyIdentifier = new KeyIdentifier( - $content, - 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', - 'SomeID', - 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary', + StringValue::fromString($content), + IDValue::fromString('SomeID'), [$attr1], + AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), + AnyURIValue::fromString('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary'), ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsse/NonceTest.php b/tests/WSSecurity/XML/wsse/NonceTest.php index 8680e7ed..c877a806 100644 --- a/tests/WSSecurity/XML/wsse/NonceTest.php +++ b/tests/WSSecurity/XML/wsse/NonceTest.php @@ -11,10 +11,13 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractEncodedString; use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\Nonce; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -56,13 +59,13 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $content = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='; - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $nonce = new Nonce( - $content, - 'SomeID', - 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary', + StringValue::fromString($content), + IDValue::fromString('SomeID'), [$attr1], + AnyURIValue::fromString('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary'), ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsse/PasswordTest.php b/tests/WSSecurity/XML/wsse/PasswordTest.php index b6c34658..aadb6706 100644 --- a/tests/WSSecurity/XML/wsse/PasswordTest.php +++ b/tests/WSSecurity/XML/wsse/PasswordTest.php @@ -11,9 +11,12 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractPasswordString; use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\Password; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,8 +56,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $password = new Password('secret', 'SomeID', 'SomeType', [$attr]); + $attr = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $password = new Password( + StringValue::fromString('secret'), + IDValue::fromString('SomeID'), + [$attr], + AnyURIValue::fromString('SomeType'), + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsse/ReferenceTest.php b/tests/WSSecurity/XML/wsse/ReferenceTest.php index 2a8fe211..20729502 100644 --- a/tests/WSSecurity/XML/wsse/ReferenceTest.php +++ b/tests/WSSecurity/XML/wsse/ReferenceTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,11 +55,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $reference = new Reference( - 'urn:some:uri', - 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', + AnyURIValue::fromString('urn:some:uri'), + AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), [$attr1], ); diff --git a/tests/WSSecurity/XML/wsse/SecurityTest.php b/tests/WSSecurity/XML/wsse/SecurityTest.php index 7e06c611..f042c81c 100644 --- a/tests/WSSecurity/XML/wsse/SecurityTest.php +++ b/tests/WSSecurity/XML/wsse/SecurityTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/wsse/SecurityTokenReferenceTest.php b/tests/WSSecurity/XML/wsse/SecurityTokenReferenceTest.php index 63d983b6..da1a84d3 100644 --- a/tests/WSSecurity/XML/wsse/SecurityTokenReferenceTest.php +++ b/tests/WSSecurity/XML/wsse/SecurityTokenReferenceTest.php @@ -10,11 +10,14 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractSecurityTokenReferenceType; use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\SecurityTokenReference; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,14 +57,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $securityTokenReference = new SecurityTokenReference( - 'SomeID', - 'SomeUsage', + IDValue::fromString('SomeID'), + AnyURIValue::fromString('SomeUsage'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wsse/TransformationParametersTest.php b/tests/WSSecurity/XML/wsse/TransformationParametersTest.php index 2955a4da..7db0b390 100644 --- a/tests/WSSecurity/XML/wsse/TransformationParametersTest.php +++ b/tests/WSSecurity/XML/wsse/TransformationParametersTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/wsse/UsernameTest.php b/tests/WSSecurity/XML/wsse/UsernameTest.php index d0f1d668..1f9149d6 100644 --- a/tests/WSSecurity/XML/wsse/UsernameTest.php +++ b/tests/WSSecurity/XML/wsse/UsernameTest.php @@ -10,9 +10,11 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractAttributedString; use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\Username; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -51,8 +53,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $username = new Username('johndoe@example.com', 'SomeID', [$attr]); + $attr = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $username = new Username( + StringValue::fromString('johndoe@example.com'), + IDValue::fromString('SomeID'), + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsse/UsernameTokenTest.php b/tests/WSSecurity/XML/wsse/UsernameTokenTest.php index ee0c6ebc..d9885209 100644 --- a/tests/WSSecurity/XML/wsse/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/wsse/UsernameTokenTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\wsse\AbstractWsseElement; use SimpleSAML\WSSecurity\XML\wsse\Username; use SimpleSAML\WSSecurity\XML\wsse\UsernameToken; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; @@ -58,14 +59,18 @@ public function testMarshalling(): void { $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); - $username = new Username('johndoe@example.com', 'OtherID', [$attr2]); + $username = new Username( + StringValue::fromString('johndoe@example.com'), + IDValue::fromString('OtherID'), + [$attr2], + ); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $usernameToken = new UsernameToken( $username, - 'SomeID', + IDValue::fromString('SomeID'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/resources/xml/wsse_UsernameToken.xml b/tests/resources/xml/wsse_UsernameToken.xml index 4dff7403..bf3c03f4 100644 --- a/tests/resources/xml/wsse_UsernameToken.xml +++ b/tests/resources/xml/wsse_UsernameToken.xml @@ -1,4 +1,4 @@ - + johndoe@example.com SomeChunk From daf37e12fd93306b5ab7f018a7fce06112eddcc4 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 8 Dec 2025 18:21:44 +0100 Subject: [PATCH 28/34] Migrate to xsd-types --- src/XML/wsa_200508/RelatesTo.php | 13 +++++-------- tests/WSSecurity/XML/wsa_200508/ActionTest.php | 6 ++++-- tests/WSSecurity/XML/wsa_200508/AddressTest.php | 6 ++++-- .../XML/wsa_200508/EndpointReferenceTest.php | 12 +++++++----- tests/WSSecurity/XML/wsa_200508/FaultToTest.php | 12 +++++++----- tests/WSSecurity/XML/wsa_200508/FromTest.php | 12 +++++++----- tests/WSSecurity/XML/wsa_200508/MessageIDTest.php | 6 +++++- tests/WSSecurity/XML/wsa_200508/MetadataTest.php | 3 ++- .../XML/wsa_200508/ProblemActionTest.php | 8 +++++--- .../XML/wsa_200508/ProblemHeaderQNameTest.php | 15 +++++++++++++-- .../WSSecurity/XML/wsa_200508/ProblemIRITest.php | 6 ++++-- .../XML/wsa_200508/ReferenceParametersTest.php | 3 ++- tests/WSSecurity/XML/wsa_200508/RelatesToTest.php | 8 +++++--- tests/WSSecurity/XML/wsa_200508/ReplyToTest.php | 12 +++++++----- .../WSSecurity/XML/wsa_200508/RetryAfterTest.php | 6 ++++-- .../WSSecurity/XML/wsa_200508/SoapActionTest.php | 3 ++- tests/WSSecurity/XML/wsa_200508/ToTest.php | 6 ++++-- tests/resources/xml/wsa/200508/MessageID.xml | 2 +- 18 files changed, 88 insertions(+), 51 deletions(-) diff --git a/src/XML/wsa_200508/RelatesTo.php b/src/XML/wsa_200508/RelatesTo.php index 991a05d8..9d3dd273 100644 --- a/src/XML/wsa_200508/RelatesTo.php +++ b/src/XML/wsa_200508/RelatesTo.php @@ -12,7 +12,6 @@ use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\AnyURIValue; -use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSchema\XML\Constants\NS; /** @@ -38,12 +37,12 @@ final class RelatesTo extends AbstractWsaElement implements SchemaValidatableEle * Initialize a wsa:RelatesTo * * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $content - * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $RelationshipType + * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $RelationshipType * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( AnyURIValue $content, - protected ?QNameValue $RelationshipType, + protected ?AnyURIValue $RelationshipType, array $namespacedAttributes = [], ) { $this->setContent($content); @@ -54,9 +53,9 @@ public function __construct( /** * Collect the value of the RelationshipType property. * - * @return \SimpleSAML\XMLSchema\Type\QNameValue|null + * @return \SimpleSAML\XMLSchema\Type\AnyURIValue|null */ - public function getRelationshipType(): ?QNameValue + public function getRelationshipType(): ?AnyURIValue { return $this->RelationshipType; } @@ -78,9 +77,7 @@ public static function fromXML(DOMElement $xml): static return new static( AnyURIValue::fromString($xml->textContent), - $xml->hasAttribute('RelationshipType') - ? QNameValue::fromDocument($xml->getAttribute('RelationshipType'), $xml) - : null, + self::getOptionalAttribute($xml, 'RelationshipType', AnyURIValue::class, null), self::getAttributesNSFromXML($xml), ); } diff --git a/tests/WSSecurity/XML/wsa_200508/ActionTest.php b/tests/WSSecurity/XML/wsa_200508/ActionTest.php index d0d4d280..e5259930 100644 --- a/tests/WSSecurity/XML/wsa_200508/ActionTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ActionTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $action = new Action('https://login.microsoftonline.com/login.srf', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $action = new Action(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/AddressTest.php b/tests/WSSecurity/XML/wsa_200508/AddressTest.php index 8893107e..21ecc834 100644 --- a/tests/WSSecurity/XML/wsa_200508/AddressTest.php +++ b/tests/WSSecurity/XML/wsa_200508/AddressTest.php @@ -13,6 +13,8 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -51,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $address = new Address('https://login.microsoftonline.com/login.srf', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $address = new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php b/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php index 9a5a2141..3556b522 100644 --- a/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php +++ b/tests/WSSecurity/XML/wsa_200508/EndpointReferenceTest.php @@ -19,6 +19,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -80,17 +82,17 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/wsa_200508/FaultToTest.php b/tests/WSSecurity/XML/wsa_200508/FaultToTest.php index 72c7083f..58da1a69 100644 --- a/tests/WSSecurity/XML/wsa_200508/FaultToTest.php +++ b/tests/WSSecurity/XML/wsa_200508/FaultToTest.php @@ -19,6 +19,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -82,17 +84,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $faultTo = new FaultTo( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/wsa_200508/FromTest.php b/tests/WSSecurity/XML/wsa_200508/FromTest.php index d60d82fe..edbf9e27 100644 --- a/tests/WSSecurity/XML/wsa_200508/FromTest.php +++ b/tests/WSSecurity/XML/wsa_200508/FromTest.php @@ -19,6 +19,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -82,17 +84,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $from = new From( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php b/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php index 73d6ad6f..fc708d9b 100644 --- a/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php +++ b/tests/WSSecurity/XML/wsa_200508/MessageIDTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; use function strval; @@ -54,7 +55,10 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $mustUnderstand = MustUnderstandValue::fromBoolean(true); - $msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]); + $msgId = new MessageID( + AnyURIValue::fromString('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de'), + [$mustUnderstand->toAttribute()], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/MetadataTest.php b/tests/WSSecurity/XML/wsa_200508/MetadataTest.php index 2cea2480..20c083c6 100644 --- a/tests/WSSecurity/XML/wsa_200508/MetadataTest.php +++ b/tests/WSSecurity/XML/wsa_200508/MetadataTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -57,7 +58,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $domAttr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'value1'); + $domAttr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('value1')); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$domAttr]); $this->assertFalse($metadata->isEmptyElement()); diff --git a/tests/WSSecurity/XML/wsa_200508/ProblemActionTest.php b/tests/WSSecurity/XML/wsa_200508/ProblemActionTest.php index 652a0fba..e185f947 100644 --- a/tests/WSSecurity/XML/wsa_200508/ProblemActionTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ProblemActionTest.php @@ -17,6 +17,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -56,11 +58,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); $problemAction = new ProblemAction( - new Action('https://login.microsoftonline.com/login.srf', [$attr1]), - new SoapAction('http://www.example.com/'), + new Action(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]), + new SoapAction(AnyURIValue::fromString('http://www.example.com/')), [$attr1], ); diff --git a/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php b/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php index aec5174d..31e8bc54 100644 --- a/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php @@ -14,6 +14,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\Type\QNameValue; use function dirname; use function strval; @@ -53,9 +57,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'value1'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('value1')); - $problemHeaderQName = new ProblemHeaderQName('wsa10:Action', [$attr1]); + $problemHeaderQName = new ProblemHeaderQName( + QNameValue::fromParts( + NCNameValue::fromString('Action'), + AnyURIValue::fromString(AbstractWsaElement::NS), + NCNameValue::fromString('wsa10'), + ), + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/ProblemIRITest.php b/tests/WSSecurity/XML/wsa_200508/ProblemIRITest.php index 69e899e4..4e7a24b5 100644 --- a/tests/WSSecurity/XML/wsa_200508/ProblemIRITest.php +++ b/tests/WSSecurity/XML/wsa_200508/ProblemIRITest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,9 +55,9 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'value1'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('value1')); - $problemIri = new ProblemIRI('https://login.microsoftonline.com/login.srf', [$attr1]); + $problemIri = new ProblemIRI(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php b/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php index 1366044b..42dd891f 100644 --- a/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ReferenceParametersTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -57,7 +58,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $domAttr = new Attribute('urn:test:something', 'test', 'attr1', 'testval1'); + $domAttr = new Attribute('urn:test:something', 'test', 'attr1', StringValue::fromString('testval1')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$domAttr]); $this->assertFalse($referenceParameters->isEmptyElement()); diff --git a/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php b/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php index ae1ef197..e80f397c 100644 --- a/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php +++ b/tests/WSSecurity/XML/wsa_200508/RelatesToTest.php @@ -13,6 +13,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -47,11 +49,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $domAttr = new Attribute('urn:test:something', 'test', 'attr1', 'testval1'); + $domAttr = new Attribute('urn:test:something', 'test', 'attr1', StringValue::fromString('testval1')); $relatesTo = new RelatesTo( - 'urn:x-simplesamlphp:namespace', - 'http://www.w3.org/2005/08/addressing/reply', + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + AnyURIValue::fromString('http://www.w3.org/2005/08/addressing/reply'), [$domAttr], ); diff --git a/tests/WSSecurity/XML/wsa_200508/ReplyToTest.php b/tests/WSSecurity/XML/wsa_200508/ReplyToTest.php index 9a83f66c..8b23f946 100644 --- a/tests/WSSecurity/XML/wsa_200508/ReplyToTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ReplyToTest.php @@ -19,6 +19,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -82,17 +84,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $replyTo = new ReplyTo( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php b/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php index 86d96da4..8b477ac7 100644 --- a/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php +++ b/tests/WSSecurity/XML/wsa_200508/RetryAfterTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\Type\UnsignedLongValue; use function dirname; use function strval; @@ -53,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $retryAfter = new RetryAfter('1234567890', [$attr]); + $attr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $retryAfter = new RetryAfter(UnsignedLongValue::fromString('1234567890'), [$attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/SoapActionTest.php b/tests/WSSecurity/XML/wsa_200508/SoapActionTest.php index e19d184e..d8fcbd32 100644 --- a/tests/WSSecurity/XML/wsa_200508/SoapActionTest.php +++ b/tests/WSSecurity/XML/wsa_200508/SoapActionTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\wsa_200508\SoapAction; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; use function strval; @@ -48,7 +49,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $soapAction = new SoapAction('http://www.example.com/'); + $soapAction = new SoapAction(AnyURIValue::fromString('http://www.example.com/')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200508/ToTest.php b/tests/WSSecurity/XML/wsa_200508/ToTest.php index 89c86839..2e9bfd53 100644 --- a/tests/WSSecurity/XML/wsa_200508/ToTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ToTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,9 +55,9 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr', 'test'); + $attr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr', StringValue::fromString('test')); - $to = new To('https://login.microsoftonline.com/login.srf', [$attr]); + $to = new To(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/resources/xml/wsa/200508/MessageID.xml b/tests/resources/xml/wsa/200508/MessageID.xml index 5dad329b..f8aab786 100644 --- a/tests/resources/xml/wsa/200508/MessageID.xml +++ b/tests/resources/xml/wsa/200508/MessageID.xml @@ -1 +1 @@ -uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de +uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de From 0c12d94e2f854d860fdfeeb3e8e6ab7a116dcd18 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 9 Dec 2025 00:55:02 +0100 Subject: [PATCH 29/34] Migrate to xsd-types --- composer.json | 2 +- src/XML/sp_200702/AbstractHeaderType.php | 4 +- src/XML/sp_200702/Type/IncludeTokenValue.php | 13 ++++ .../wsa_200408/AbstractRelationshipType.php | 6 +- .../XML/sp_200702/AlgorithmSuiteTest.php | 3 +- .../XML/sp_200702/AsymmetricBindingTest.php | 3 +- .../XML/sp_200702/BootstrapPolicyTest.php | 3 +- .../ContentEncryptedElementsTest.php | 14 ++-- .../XML/sp_200702/EncryptedElementsTest.php | 43 +++++++----- .../XML/sp_200702/EncryptedPartsTest.php | 15 ++-- .../EncryptedSupportingTokensTest.php | 3 +- .../XML/sp_200702/EncryptionTokenTest.php | 3 +- ...EndorsingEncryptedSupportingTokensTest.php | 3 +- .../EndorsingSupportingTokensTest.php | 3 +- tests/WSSecurity/XML/sp_200702/HeaderTest.php | 11 ++- .../XML/sp_200702/HttpsTokenTest.php | 8 ++- .../InitiatorEncryptionTokenTest.php | 3 +- .../sp_200702/InitiatorSignatureTokenTest.php | 3 +- .../XML/sp_200702/InitiatorTokenTest.php | 3 +- .../XML/sp_200702/IssuedTokenTest.php | 33 ++++++--- .../XML/sp_200702/IssuerNameTest.php | 3 +- tests/WSSecurity/XML/sp_200702/IssuerTest.php | 12 ++-- .../XML/sp_200702/KerberosTokenTest.php | 8 ++- .../XML/sp_200702/KeyValueTokenTest.php | 8 ++- tests/WSSecurity/XML/sp_200702/LayoutTest.php | 3 +- .../sp_200702/NestedPolicyTypeTestTrait.php | 8 +-- .../XML/sp_200702/ProtectionTokenTest.php | 3 +- .../sp_200702/QNameAssertionTypeTestTrait.php | 3 +- .../RecipientEncryptionTokenTest.php | 3 +- .../sp_200702/RecipientSignatureTokenTest.php | 3 +- .../XML/sp_200702/RecipientTokenTest.php | 3 +- .../WSSecurity/XML/sp_200702/RelTokenTest.php | 8 ++- .../RequestSecurityTokenTemplateTest.php | 6 +- .../XML/sp_200702/RequiredElementsTest.php | 24 +++++-- .../XML/sp_200702/RequiredPartsTest.php | 19 +++-- .../XML/sp_200702/SamlTokenTest.php | 8 ++- .../sp_200702/SecureConversationTokenTest.php | 27 +++++--- .../sp_200702/SecurityContextTokenTest.php | 8 ++- .../XML/sp_200702/SignatureTokenTest.php | 3 +- .../XML/sp_200702/SignedElementsTest.php | 24 +++++-- .../SignedEncryptedSupportingTokensTest.php | 3 +- ...EndorsingEncryptedSupportingTokensTest.php | 3 +- .../SignedEndorsingSupportingTokensTest.php | 3 +- .../XML/sp_200702/SignedPartsTest.php | 19 +++-- .../sp_200702/SignedSupportingTokensTest.php | 3 +- .../XML/sp_200702/SpnegoContextTokenTest.php | 19 ++--- .../XML/sp_200702/SupportingTokensTest.php | 3 +- .../XML/sp_200702/SymmetricBindingTest.php | 3 +- .../XML/sp_200702/TransportBindingTest.php | 3 +- .../XML/sp_200702/TransportTokenTest.php | 3 +- .../WSSecurity/XML/sp_200702/Trust13Test.php | 3 +- .../XML/sp_200702/UsernameTokenTest.php | 8 ++- tests/WSSecurity/XML/sp_200702/Wss10Test.php | 3 +- tests/WSSecurity/XML/sp_200702/Wss11Test.php | 3 +- .../XML/sp_200702/X509TokenTest.php | 8 ++- tests/WSSecurity/XML/sp_200702/XPathTest.php | 3 +- .../WSSecurity/XML/wsa_200408/ActionTest.php | 6 +- .../WSSecurity/XML/wsa_200408/AddressTest.php | 6 +- .../XML/wsa_200408/EndpointReferenceTest.php | 40 +++++++---- .../WSSecurity/XML/wsa_200408/FaultToTest.php | 69 +++++++++++-------- tests/WSSecurity/XML/wsa_200408/FromTest.php | 69 +++++++++++-------- .../XML/wsa_200408/MessageIDTest.php | 6 +- .../XML/wsa_200408/PortTypeTest.php | 6 +- .../XML/wsa_200408/RelatesToTest.php | 13 +++- .../WSSecurity/XML/wsa_200408/ReplyToTest.php | 40 +++++++---- .../XML/wsa_200408/RetryAfterTest.php | 3 +- .../XML/wsa_200408/ServiceNameTest.php | 11 ++- tests/WSSecurity/XML/wsa_200408/ToTest.php | 6 +- .../xml/sp/200702/EncryptedParts.xml | 2 +- tests/resources/xml/sp/200702/Header.xml | 2 +- tests/resources/xml/sp/200702/IssuedToken.xml | 2 +- .../resources/xml/sp/200702/KeyValueToken.xml | 2 +- .../resources/xml/sp/200702/RequiredParts.xml | 2 +- .../xml/sp/200702/SecureConversationToken.xml | 2 +- tests/resources/xml/sp/200702/SignedParts.xml | 2 +- .../xml/sp/200702/SpnegoContextToken.xml | 2 +- 76 files changed, 486 insertions(+), 258 deletions(-) diff --git a/composer.json b/composer.json index 9a4672c5..c2fca837 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "simplesamlphp/assert": "~1.9", "simplesamlphp/saml2": "~6.0", - "simplesamlphp/xml-common": "~2.3", + "simplesamlphp/xml-common": "~2.4", "simplesamlphp/xml-security": "~2.0", "simplesamlphp/xml-soap": "~2.0" }, diff --git a/src/XML/sp_200702/AbstractHeaderType.php b/src/XML/sp_200702/AbstractHeaderType.php index 4375ee97..a5dc195c 100644 --- a/src/XML/sp_200702/AbstractHeaderType.php +++ b/src/XML/sp_200702/AbstractHeaderType.php @@ -98,9 +98,7 @@ public static function fromXML(DOMElement $xml): static return new static( $namespace, - $xml->hasAttribute('Name') - ? QNameValue::fromString('{' . $namespace . '}' . $xml->getAttribute('Name')) - : null, + $xml->hasAttribute('Name') ? QNameValue::fromString($xml->getAttribute('Name')) : null, $namespacedAttributes, ); } diff --git a/src/XML/sp_200702/Type/IncludeTokenValue.php b/src/XML/sp_200702/Type/IncludeTokenValue.php index ce1c025b..0d44acce 100644 --- a/src/XML/sp_200702/Type/IncludeTokenValue.php +++ b/src/XML/sp_200702/Type/IncludeTokenValue.php @@ -4,7 +4,9 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702\Type; +use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; +use SimpleSAML\XML\Attribute; use SimpleSAML\XMLSchema\Type\AnyURIValue as BaseAnyURIValue; /** @@ -12,6 +14,17 @@ */ class IncludeTokenValue extends BaseAnyURIValue { + /** + * Convert this value to an attribute + * + * @return \SimpleSAML\XML\Attribute + */ + public function toAttribute(): Attribute + { + return new Attribute(null, null, 'IncludeToken', $this); + } + + /** * @param \SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken $value * @return static diff --git a/src/XML/wsa_200408/AbstractRelationshipType.php b/src/XML/wsa_200408/AbstractRelationshipType.php index 270d8f1f..1301fa14 100644 --- a/src/XML/wsa_200408/AbstractRelationshipType.php +++ b/src/XML/wsa_200408/AbstractRelationshipType.php @@ -46,8 +46,6 @@ final public function __construct( protected ?QNameValue $relationshipType = null, array $namespacedAttributes = [], ) { - Assert::validQName($relationshipType); - $this->setContent($value); $this->setAttributesNS($namespacedAttributes); } @@ -78,9 +76,7 @@ public static function fromXML(DOMElement $xml): static return new static( AnyURIValue::fromString($xml->textContent), - $xml->hasAttribute('RelationshipType') - ? QNameValue::fromDocument('RelationshipType', $xml) - : null, + self::getOptionalAttribute($xml, 'RelationshipType', QNameValue::class, null), self::getAttributesNSFromXML($xml), ); } diff --git a/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php b/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php index 4b492535..d7174c43 100644 --- a/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php +++ b/tests/WSSecurity/XML/sp_200702/AlgorithmSuiteTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/AlgorithmSuite.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php index d669dae3..b2a24c7d 100644 --- a/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200702/AsymmetricBindingTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/AsymmetricBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php b/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php index 1a542dd1..5e6cf437 100644 --- a/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php +++ b/tests/WSSecurity/XML/sp_200702/BootstrapPolicyTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/BootstrapPolicy.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php b/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php index ece573ed..f23e38fb 100644 --- a/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,15 +54,15 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $contentEncryptedElements = new ContentEncryptedElements( [$xpath], - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); @@ -95,15 +97,15 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $contentEncryptedElements = new ContentEncryptedElements( [$xpath], - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php index 6c52ff06..0471f431 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,30 +54,34 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $EncryptedElements = new EncryptedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); - $EncryptedElementsElement = $EncryptedElements->toXML(); + $encryptedElements = new EncryptedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); + $encryptedElementsElement = $encryptedElements->toXML(); // Test for an XPath - $xpCache = XMLXPath::getXPath($EncryptedElementsElement); - $EncryptedElementsElements = XMLXPath::xpQuery($EncryptedElementsElement, './sp:XPath', $xpCache); - $this->assertCount(1, $EncryptedElementsElements); + $xpCache = XMLXPath::getXPath($encryptedElementsElement); + $encryptedElementsElements = XMLXPath::xpQuery($encryptedElementsElement, './sp:XPath', $xpCache); + $this->assertCount(1, $encryptedElementsElements); // Test ordering of EncryptedElements contents - /** @psalm-var \DOMElement[] $EncryptedElementsElements */ - $EncryptedElementsElements = XMLXPath::xpQuery( - $EncryptedElementsElement, + $encryptedElementsElements = XMLXPath::xpQuery( + $encryptedElementsElement, './sp:XPath/following-sibling::*', $xpCache, ); - $this->assertCount(1, $EncryptedElementsElements); - $this->assertEquals('ssp:Chunk', $EncryptedElementsElements[0]->tagName); + $this->assertCount(1, $encryptedElementsElements); + $this->assertEquals('ssp:Chunk', $encryptedElementsElements[0]->tagName); } @@ -87,16 +93,21 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $EncryptedElements = new EncryptedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $encryptedElements = new EncryptedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($EncryptedElements), + strval($encryptedElements), ); } } diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php index 2f8d0e81..6e07a2b7 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php @@ -20,6 +20,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,9 +61,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $attachments = new Attachments(); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', @@ -94,9 +101,9 @@ public function testMarshallingEmptyElement(): void */ public function testMarshallingElementOrdering(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header(AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), [$attr]); $attachments = new Attachments(); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php index 0f263e9a..42131dd0 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/EncryptedSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php index 20ad0061..bc79d36c 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptionTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/EncryptionToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php index af1e3506..ab2eab98 100644 --- a/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/EndorsingEncryptedSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/EndorsingEncryptedSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php index 1f57c5d1..6188944b 100644 --- a/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/EndorsingSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/EndorsingSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/HeaderTest.php b/tests/WSSecurity/XML/sp_200702/HeaderTest.php index 9be4feaf..12114cfc 100644 --- a/tests/WSSecurity/XML/sp_200702/HeaderTest.php +++ b/tests/WSSecurity/XML/sp_200702/HeaderTest.php @@ -14,6 +14,9 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,8 +54,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php b/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php index 527cf9e2..c9d1d12b 100644 --- a/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\HttpsToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $httpsToken = new HttpsToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $httpsToken = new HttpsToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($httpsToken), diff --git a/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php index 0e0e9e9c..0f05b6b7 100644 --- a/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/InitiatorEncryptionTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/InitiatorEncryptionToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php b/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php index 6e0a04c4..36965943 100644 --- a/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/InitiatorSignatureTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/InitiatorSignatureToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php b/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php index f57c96ba..28ce314d 100644 --- a/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/InitiatorTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/InitiatorToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php index c9868621..ce2f7e04 100644 --- a/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php @@ -15,11 +15,14 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IssuedToken; use SimpleSAML\WSSecurity\XML\sp_200702\IssuerName; use SimpleSAML\WSSecurity\XML\sp_200702\RequestSecurityTokenTemplate; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,19 +57,24 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $issuer = new IssuerName('urn:x-simplesamlphp:issuer'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $issuer = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:issuer')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $requestSecurityTokenTemplate = new RequestSecurityTokenTemplate( - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); - $issuedToken = new IssuedToken($requestSecurityTokenTemplate, $issuer, [$chunk], [$includeToken, $attr]); + $issuedToken = new IssuedToken( + $requestSecurityTokenTemplate, + $issuer, + [$chunk], + [$includeToken->toAttribute(), $attr], + ); $issuedTokenElement = $issuedToken->toXML(); // Test for a Issuer @@ -91,20 +99,25 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $issuer = new IssuerName('urn:x-simplesamlphp:issuer'); + $issuer = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:issuer')); $requestSecurityTokenTemplate = new RequestSecurityTokenTemplate( - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); - $issuedToken = new IssuedToken($requestSecurityTokenTemplate, $issuer, [$chunk], [$includeToken, $attr]); + $issuedToken = new IssuedToken( + $requestSecurityTokenTemplate, + $issuer, + [$chunk], + [$includeToken->toAttribute(), $attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($issuedToken), diff --git a/tests/WSSecurity/XML/sp_200702/IssuerNameTest.php b/tests/WSSecurity/XML/sp_200702/IssuerNameTest.php index efdec383..8f5f1783 100644 --- a/tests/WSSecurity/XML/sp_200702/IssuerNameTest.php +++ b/tests/WSSecurity/XML/sp_200702/IssuerNameTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IssuerName; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; use function strval; @@ -48,7 +49,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $issuerName = new IssuerName('urn:x-simplesamlphp:namespace'); + $issuerName = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/sp_200702/IssuerTest.php b/tests/WSSecurity/XML/sp_200702/IssuerTest.php index ed1d596e..7e142d97 100644 --- a/tests/WSSecurity/XML/sp_200702/IssuerTest.php +++ b/tests/WSSecurity/XML/sp_200702/IssuerTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -78,17 +80,17 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php b/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php index f205fc62..cdffe34c 100644 --- a/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\KerberosToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $kerberosToken = new KerberosToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $kerberosToken = new KerberosToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($kerberosToken), diff --git a/tests/WSSecurity/XML/sp_200702/KeyValueTokenTest.php b/tests/WSSecurity/XML/sp_200702/KeyValueTokenTest.php index ca7d41cd..4d998fc5 100644 --- a/tests/WSSecurity/XML/sp_200702/KeyValueTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/KeyValueTokenTest.php @@ -12,11 +12,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\KeyValueToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,13 +72,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $keyValueToken = new KeyValueToken([$chunk], [$includeToken, $attr]); + $keyValueToken = new KeyValueToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($keyValueToken), diff --git a/tests/WSSecurity/XML/sp_200702/LayoutTest.php b/tests/WSSecurity/XML/sp_200702/LayoutTest.php index 5008006f..1b748bda 100644 --- a/tests/WSSecurity/XML/sp_200702/LayoutTest.php +++ b/tests/WSSecurity/XML/sp_200702/LayoutTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/Layout.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/NestedPolicyTypeTestTrait.php b/tests/WSSecurity/XML/sp_200702/NestedPolicyTypeTestTrait.php index a4b7ea38..16d20644 100644 --- a/tests/WSSecurity/XML/sp_200702/NestedPolicyTypeTestTrait.php +++ b/tests/WSSecurity/XML/sp_200702/NestedPolicyTypeTestTrait.php @@ -40,8 +40,8 @@ public function testMarshalling(): void public function testMarshallingWithoutNSAttr(): void { $xml = << - Some +<%s:%s xmlns:%s="%s" xmlns:ssp="urn:x-simplesamlphp:namespace"> + Some XML; $localName = static::$testedClass::getLocalName(); @@ -108,8 +108,8 @@ public function testMarshallingEmptyElement(): void public function testUnmarshallingWithoutNSAttr(): void { $xml = << - Some +<%s:%s xmlns:%s="%s" xmlns:ssp="urn:x-simplesamlphp:namespace"> + Some XML; $localName = static::$testedClass::getLocalName(); diff --git a/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php b/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php index 8c66ca60..cf3729a9 100644 --- a/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/ProtectionTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/ProtectionToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/QNameAssertionTypeTestTrait.php b/tests/WSSecurity/XML/sp_200702/QNameAssertionTypeTestTrait.php index 1f397bb5..2e245eb2 100644 --- a/tests/WSSecurity/XML/sp_200702/QNameAssertionTypeTestTrait.php +++ b/tests/WSSecurity/XML/sp_200702/QNameAssertionTypeTestTrait.php @@ -6,6 +6,7 @@ use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XMLSchema\Type\StringValue; use function strval; @@ -24,7 +25,7 @@ trait QNameAssertionTypeTestTrait */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $qns = new static::$testedClass([$attr]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php index 6473faca..aee9f7fd 100644 --- a/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RecipientEncryptionTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/RecipientEncryptionToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php b/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php index aa6278ea..a71a69bd 100644 --- a/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RecipientSignatureTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/RecipientSignatureToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php b/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php index 4cd23638..7f5c1a89 100644 --- a/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RecipientTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/RecipientToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/RelTokenTest.php b/tests/WSSecurity/XML/sp_200702/RelTokenTest.php index b4a04ff0..e59bfe3e 100644 --- a/tests/WSSecurity/XML/sp_200702/RelTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RelTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\RelToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $relToken = new RelToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $relToken = new RelToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($relToken), diff --git a/tests/WSSecurity/XML/sp_200702/RequestSecurityTokenTemplateTest.php b/tests/WSSecurity/XML/sp_200702/RequestSecurityTokenTemplateTest.php index d44a1a5f..1a189ea9 100644 --- a/tests/WSSecurity/XML/sp_200702/RequestSecurityTokenTemplateTest.php +++ b/tests/WSSecurity/XML/sp_200702/RequestSecurityTokenTemplateTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,13 +54,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $RequestSecurityTokenTemplateElements = new RequestSecurityTokenTemplate( - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); diff --git a/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php b/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php index f9938855..fa6d77ae 100644 --- a/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,13 +54,18 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $requiredElements = new RequiredElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $requiredElements = new RequiredElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $requiredElementsElement = $requiredElements->toXML(); // Test for an XPath @@ -87,13 +94,18 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $requiredElements = new RequiredElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $requiredElements = new RequiredElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($requiredElements), diff --git a/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php b/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php index 0f66a36a..c2e54680 100644 --- a/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php @@ -18,6 +18,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -67,8 +70,12 @@ public function testMarshallingEmptyElement(): void */ public function testMarshallingElementOrdering(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); @@ -97,8 +104,12 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp}name'), + [$attr], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); diff --git a/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php b/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php index 1527cb32..9a4cad12 100644 --- a/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\SamlToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $samlToken = new SamlToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $samlToken = new SamlToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($samlToken), diff --git a/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php index 5e3befc9..d8986f04 100644 --- a/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php @@ -14,11 +14,14 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IssuerName; use SimpleSAML\WSSecurity\XML\sp_200702\SecureConversationToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,14 +56,18 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $issuer = new IssuerName('urn:x-simplesamlphp:issuer'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $issuer = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:issuer')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $secureConversationToken = new SecureConversationToken($issuer, [$chunk], [$includeToken, $attr]); + $secureConversationToken = new SecureConversationToken( + $issuer, + [$chunk], + [$includeToken->toAttribute(), $attr], + ); $secureConversationTokenElement = $secureConversationToken->toXML(); // Test for a IssuerName @@ -88,15 +95,19 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $issuer = new IssuerName('urn:x-simplesamlphp:issuer'); + $issuer = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:issuer')); - $secureConversationToken = new SecureConversationToken($issuer, [$chunk], [$includeToken, $attr]); + $secureConversationToken = new SecureConversationToken( + $issuer, + [$chunk], + [$includeToken->toAttribute(), $attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($secureConversationToken), diff --git a/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php b/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php index 9493e673..23ea6f2f 100644 --- a/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\SecurityContextToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $securityContextToken = new SecurityContextToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $securityContextToken = new SecurityContextToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($securityContextToken), diff --git a/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php b/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php index 45cc13f7..9832568e 100644 --- a/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignatureTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SignatureToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php b/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php index 4e18349d..3a429369 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,13 +54,18 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $SignedElements = new SignedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $SignedElements = new SignedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $SignedElementsElement = $SignedElements->toXML(); // Test for an XPath @@ -87,13 +94,18 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $SignedElements = new SignedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $SignedElements = new SignedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($SignedElements), diff --git a/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php index 98c594b6..682d5f33 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedEncryptedSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SignedEncryptedSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php index e50a63e0..b2045d09 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedEndorsingEncryptedSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SignedEndorsingEncryptedSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php index 6dd55df8..5e4ed22e 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedEndorsingSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SignedEndorsingSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php b/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php index c8694092..a60d5469 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php @@ -20,6 +20,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -73,9 +76,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $attachments = new Attachments(); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', @@ -93,9 +100,13 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $attachments = new Attachments(); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', diff --git a/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php index e65bd76e..6fc774e5 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedSupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SignedSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php index 0d99cd15..86619d24 100644 --- a/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php @@ -14,11 +14,14 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IssuerName; use SimpleSAML\WSSecurity\XML\sp_200702\SpnegoContextToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,14 +56,14 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $issuer = new IssuerName('urn:x-simplesamlphp:issuer'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $issuer = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:issuer')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $spnegoContextToken = new SpnegoContextToken($issuer, [$chunk], [$includeToken, $attr]); + $spnegoContextToken = new SpnegoContextToken($issuer, [$chunk], [$includeToken->toAttribute(), $attr]); $spnegoContextTokenElement = $spnegoContextToken->toXML(); // Test for a IssuerName @@ -88,15 +91,15 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $issuer = new IssuerName('urn:x-simplesamlphp:issuer'); + $issuer = new IssuerName(AnyURIValue::fromString('urn:x-simplesamlphp:issuer')); - $spnegoContextToken = new SpnegoContextToken($issuer, [$chunk], [$includeToken, $attr]); + $spnegoContextToken = new SpnegoContextToken($issuer, [$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($spnegoContextToken), diff --git a/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php b/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php index b71262fb..0bbed549 100644 --- a/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200702/SupportingTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php index 1cea7e1b..46d7e7d1 100644 --- a/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200702/SymmetricBindingTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/SymmetricBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php b/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php index 5d658fc9..00ffdd7b 100644 --- a/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php +++ b/tests/WSSecurity/XML/sp_200702/TransportBindingTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/TransportBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php b/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php index 4faa0e0c..be00cb9d 100644 --- a/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/TransportTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/TransportToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/Trust13Test.php b/tests/WSSecurity/XML/sp_200702/Trust13Test.php index 648d3b42..d02b19d1 100644 --- a/tests/WSSecurity/XML/sp_200702/Trust13Test.php +++ b/tests/WSSecurity/XML/sp_200702/Trust13Test.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/Trust13.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php b/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php index ef128692..af42d78a 100644 --- a/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\UsernameToken; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $usernameToken = new UsernameToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $usernameToken = new UsernameToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($usernameToken), diff --git a/tests/WSSecurity/XML/sp_200702/Wss10Test.php b/tests/WSSecurity/XML/sp_200702/Wss10Test.php index b19456d8..2f456e87 100644 --- a/tests/WSSecurity/XML/sp_200702/Wss10Test.php +++ b/tests/WSSecurity/XML/sp_200702/Wss10Test.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/Wss10.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/Wss11Test.php b/tests/WSSecurity/XML/sp_200702/Wss11Test.php index 7a890f2e..eaa747e9 100644 --- a/tests/WSSecurity/XML/sp_200702/Wss11Test.php +++ b/tests/WSSecurity/XML/sp_200702/Wss11Test.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200702/Wss11.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200702/X509TokenTest.php b/tests/WSSecurity/XML/sp_200702/X509TokenTest.php index 0d0e298b..5f6e2c6f 100644 --- a/tests/WSSecurity/XML/sp_200702/X509TokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/X509TokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\X509Token; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(null, null, 'IncludeToken', IncludeToken::Always->value); - $x509Token = new X509Token([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $x509Token = new X509Token([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($x509Token), diff --git a/tests/WSSecurity/XML/sp_200702/XPathTest.php b/tests/WSSecurity/XML/sp_200702/XPathTest.php index 83669661..262a68e5 100644 --- a/tests/WSSecurity/XML/sp_200702/XPathTest.php +++ b/tests/WSSecurity/XML/sp_200702/XPathTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\sp_200702\XPath; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -48,7 +49,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/ActionTest.php b/tests/WSSecurity/XML/wsa_200408/ActionTest.php index c8bb7387..18137c37 100644 --- a/tests/WSSecurity/XML/wsa_200408/ActionTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ActionTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $action = new Action('https://login.microsoftonline.com/login.srf', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $action = new Action(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/AddressTest.php b/tests/WSSecurity/XML/wsa_200408/AddressTest.php index e8fcfd37..a1d60f01 100644 --- a/tests/WSSecurity/XML/wsa_200408/AddressTest.php +++ b/tests/WSSecurity/XML/wsa_200408/AddressTest.php @@ -13,6 +13,8 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -51,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $Address = new Address('https://login.microsoftonline.com/login.srf', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $Address = new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php b/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php index 66e5c690..20eb02a4 100644 --- a/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php +++ b/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php @@ -22,6 +22,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -83,20 +87,24 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -117,20 +125,24 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, diff --git a/tests/WSSecurity/XML/wsa_200408/FaultToTest.php b/tests/WSSecurity/XML/wsa_200408/FaultToTest.php index f1c0557c..3587968a 100644 --- a/tests/WSSecurity/XML/wsa_200408/FaultToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/FaultToTest.php @@ -22,6 +22,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -83,20 +87,24 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); - $FaultTo = new FaultTo( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + $faultTo = new FaultTo( + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -107,7 +115,7 @@ public function testMarshalling(): void $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($FaultTo), + strval($faultTo), ); } @@ -117,20 +125,24 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); - $FaultTo = new FaultTo( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + $faultTo = new FaultTo( + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -140,19 +152,18 @@ public function testMarshallingElementOrdering(): void ); // Test for an Address - $FaultToElement = $FaultTo->toXML(); - $xpCache = XPath::getXPath($FaultToElement); - $FaultToElements = XPath::xpQuery($FaultToElement, './wsa:Address', $xpCache); - $this->assertCount(1, $FaultToElements); + $faultToElement = $faultTo->toXML(); + $xpCache = XPath::getXPath($faultToElement); + $faultToElements = XPath::xpQuery($faultToElement, './wsa:Address', $xpCache); + $this->assertCount(1, $faultToElements); // Test ordering of FaultTo contents - /** @psalm-var \DOMElement[] $FaultToElements */ - $FaultToElements = XPath::xpQuery($FaultToElement, './wsa:Address/following-sibling::*', $xpCache); - $this->assertCount(5, $FaultToElements); - $this->assertEquals('wsa:ReferenceProperties', $FaultToElements[0]->tagName); - $this->assertEquals('wsa:ReferenceParameters', $FaultToElements[1]->tagName); - $this->assertEquals('wsa:PortType', $FaultToElements[2]->tagName); - $this->assertEquals('wsa:ServiceName', $FaultToElements[3]->tagName); - $this->assertEquals('ssp:Chunk', $FaultToElements[4]->tagName); + $faultToElements = XPath::xpQuery($faultToElement, './wsa:Address/following-sibling::*', $xpCache); + $this->assertCount(5, $faultToElements); + $this->assertEquals('wsa:ReferenceProperties', $faultToElements[0]->tagName); + $this->assertEquals('wsa:ReferenceParameters', $faultToElements[1]->tagName); + $this->assertEquals('wsa:PortType', $faultToElements[2]->tagName); + $this->assertEquals('wsa:ServiceName', $faultToElements[3]->tagName); + $this->assertEquals('ssp:Chunk', $faultToElements[4]->tagName); } } diff --git a/tests/WSSecurity/XML/wsa_200408/FromTest.php b/tests/WSSecurity/XML/wsa_200408/FromTest.php index 71e6aa1a..ea707dfe 100644 --- a/tests/WSSecurity/XML/wsa_200408/FromTest.php +++ b/tests/WSSecurity/XML/wsa_200408/FromTest.php @@ -22,6 +22,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -83,20 +87,24 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); - $From = new From( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + $from = new From( + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -107,7 +115,7 @@ public function testMarshalling(): void $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($From), + strval($from), ); } @@ -117,20 +125,24 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); - $From = new From( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + $from = new From( + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -140,19 +152,18 @@ public function testMarshallingElementOrdering(): void ); // Test for an Address - $FromElement = $From->toXML(); - $xpCache = XPath::getXPath($FromElement); - $FromElements = XPath::xpQuery($FromElement, './wsa:Address', $xpCache); - $this->assertCount(1, $FromElements); + $fromElement = $from->toXML(); + $xpCache = XPath::getXPath($fromElement); + $fromElements = XPath::xpQuery($fromElement, './wsa:Address', $xpCache); + $this->assertCount(1, $fromElements); // Test ordering of From contents - /** @psalm-var \DOMElement[] $FromElements */ - $FromElements = XPath::xpQuery($FromElement, './wsa:Address/following-sibling::*', $xpCache); - $this->assertCount(5, $FromElements); - $this->assertEquals('wsa:ReferenceProperties', $FromElements[0]->tagName); - $this->assertEquals('wsa:ReferenceParameters', $FromElements[1]->tagName); - $this->assertEquals('wsa:PortType', $FromElements[2]->tagName); - $this->assertEquals('wsa:ServiceName', $FromElements[3]->tagName); - $this->assertEquals('ssp:Chunk', $FromElements[4]->tagName); + $fromElements = XPath::xpQuery($fromElement, './wsa:Address/following-sibling::*', $xpCache); + $this->assertCount(5, $fromElements); + $this->assertEquals('wsa:ReferenceProperties', $fromElements[0]->tagName); + $this->assertEquals('wsa:ReferenceParameters', $fromElements[1]->tagName); + $this->assertEquals('wsa:PortType', $fromElements[2]->tagName); + $this->assertEquals('wsa:ServiceName', $fromElements[3]->tagName); + $this->assertEquals('ssp:Chunk', $fromElements[4]->tagName); } } diff --git a/tests/WSSecurity/XML/wsa_200408/MessageIDTest.php b/tests/WSSecurity/XML/wsa_200408/MessageIDTest.php index 378668bb..9553054e 100644 --- a/tests/WSSecurity/XML/wsa_200408/MessageIDTest.php +++ b/tests/WSSecurity/XML/wsa_200408/MessageIDTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $MessageID = new MessageID('https://login.microsoftonline.com/login.srf', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $MessageID = new MessageID(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/PortTypeTest.php b/tests/WSSecurity/XML/wsa_200408/PortTypeTest.php index 615a8f22..965729d1 100644 --- a/tests/WSSecurity/XML/wsa_200408/PortTypeTest.php +++ b/tests/WSSecurity/XML/wsa_200408/PortTypeTest.php @@ -13,6 +13,8 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -51,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $portType = new PortType('ssp:Chunk', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/RelatesToTest.php b/tests/WSSecurity/XML/wsa_200408/RelatesToTest.php index 0382bfc0..b2097c50 100644 --- a/tests/WSSecurity/XML/wsa_200408/RelatesToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/RelatesToTest.php @@ -14,6 +14,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,12 +56,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $RelatesTo = new RelatesTo('https://login.microsoftonline.com/login.srf', 'ssp:Chunk', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $relatesTo = new RelatesTo( + AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($RelatesTo), + strval($relatesTo), ); } } diff --git a/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php b/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php index a68b5124..e928493d 100644 --- a/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php @@ -22,6 +22,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -83,20 +87,24 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); $ReplyTo = new ReplyTo( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -117,20 +125,24 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(self::$customContent); $ReplyTo = new ReplyTo( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, diff --git a/tests/WSSecurity/XML/wsa_200408/RetryAfterTest.php b/tests/WSSecurity/XML/wsa_200408/RetryAfterTest.php index 5a736b91..939a4cf2 100644 --- a/tests/WSSecurity/XML/wsa_200408/RetryAfterTest.php +++ b/tests/WSSecurity/XML/wsa_200408/RetryAfterTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\NonNegativeIntegerValue; use function dirname; use function strval; @@ -52,7 +53,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $retryAfter = new RetryAfter(30); + $retryAfter = new RetryAfter(NonNegativeIntegerValue::fromInteger(30)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/ServiceNameTest.php b/tests/WSSecurity/XML/wsa_200408/ServiceNameTest.php index c9a679ce..d248a25c 100644 --- a/tests/WSSecurity/XML/wsa_200408/ServiceNameTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ServiceNameTest.php @@ -13,6 +13,9 @@ use SimpleSAML\XML\Attribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -51,8 +54,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr1], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/wsa_200408/ToTest.php b/tests/WSSecurity/XML/wsa_200408/ToTest.php index aac5ab6f..39dfe470 100644 --- a/tests/WSSecurity/XML/wsa_200408/ToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ToTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', 'value'); - $To = new To('https://login.microsoftonline.com/login.srf', [$attr1]); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); + $To = new To(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/resources/xml/sp/200702/EncryptedParts.xml b/tests/resources/xml/sp/200702/EncryptedParts.xml index f2c2697a..c221ada1 100644 --- a/tests/resources/xml/sp/200702/EncryptedParts.xml +++ b/tests/resources/xml/sp/200702/EncryptedParts.xml @@ -1,6 +1,6 @@ - + some diff --git a/tests/resources/xml/sp/200702/Header.xml b/tests/resources/xml/sp/200702/Header.xml index 56ef7fc3..8ebbda0c 100644 --- a/tests/resources/xml/sp/200702/Header.xml +++ b/tests/resources/xml/sp/200702/Header.xml @@ -1 +1 @@ - + diff --git a/tests/resources/xml/sp/200702/IssuedToken.xml b/tests/resources/xml/sp/200702/IssuedToken.xml index ffca8358..05bfd422 100644 --- a/tests/resources/xml/sp/200702/IssuedToken.xml +++ b/tests/resources/xml/sp/200702/IssuedToken.xml @@ -1,4 +1,4 @@ - + urn:x-simplesamlphp:issuer some diff --git a/tests/resources/xml/sp/200702/KeyValueToken.xml b/tests/resources/xml/sp/200702/KeyValueToken.xml index 1d73b0ef..9dfa1952 100644 --- a/tests/resources/xml/sp/200702/KeyValueToken.xml +++ b/tests/resources/xml/sp/200702/KeyValueToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/RequiredParts.xml b/tests/resources/xml/sp/200702/RequiredParts.xml index f8b7354c..29edf0cd 100644 --- a/tests/resources/xml/sp/200702/RequiredParts.xml +++ b/tests/resources/xml/sp/200702/RequiredParts.xml @@ -1,4 +1,4 @@ - + some diff --git a/tests/resources/xml/sp/200702/SecureConversationToken.xml b/tests/resources/xml/sp/200702/SecureConversationToken.xml index 077430da..7e23eef1 100644 --- a/tests/resources/xml/sp/200702/SecureConversationToken.xml +++ b/tests/resources/xml/sp/200702/SecureConversationToken.xml @@ -1,4 +1,4 @@ - + urn:x-simplesamlphp:issuer some diff --git a/tests/resources/xml/sp/200702/SignedParts.xml b/tests/resources/xml/sp/200702/SignedParts.xml index 06fabad7..4e2325e8 100644 --- a/tests/resources/xml/sp/200702/SignedParts.xml +++ b/tests/resources/xml/sp/200702/SignedParts.xml @@ -1,6 +1,6 @@ - + some diff --git a/tests/resources/xml/sp/200702/SpnegoContextToken.xml b/tests/resources/xml/sp/200702/SpnegoContextToken.xml index 3eb22219..0db1d87a 100644 --- a/tests/resources/xml/sp/200702/SpnegoContextToken.xml +++ b/tests/resources/xml/sp/200702/SpnegoContextToken.xml @@ -1,4 +1,4 @@ - + urn:x-simplesamlphp:issuer some From 5720bd55c7bcb511eb00e65cab8430eecc2912d0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 13 Dec 2025 01:08:39 +0100 Subject: [PATCH 30/34] Migrate to xsd-types --- src/XML/sp_200507/AbstractHeaderType.php | 18 ++++---- .../XML/sp_200507/AlgorithmSuiteTest.php | 14 ++++-- .../XML/sp_200507/AsymmetricBindingTest.php | 14 ++++-- .../XML/sp_200507/BootstrapPolicyTest.php | 14 ++++-- .../XML/sp_200507/EncryptedElementsTest.php | 44 ++++++++++++------- .../XML/sp_200507/EncryptedPartsTest.php | 19 ++++++-- .../XML/sp_200507/EncryptionTokenTest.php | 14 ++++-- .../EndorsingSupportingTokensTest.php | 14 ++++-- tests/WSSecurity/XML/sp_200507/HeaderTest.php | 11 ++++- .../XML/sp_200507/HttpsTokenTest.php | 6 ++- .../XML/sp_200507/InitiatorTokenTest.php | 14 ++++-- .../XML/sp_200507/IssuedTokenTest.php | 39 +++++++++------- tests/WSSecurity/XML/sp_200507/IssuerTest.php | 21 ++++++--- .../XML/sp_200507/KerberosTokenTest.php | 3 +- tests/WSSecurity/XML/sp_200507/LayoutTest.php | 12 ++++- .../XML/sp_200507/ProtectionTokenTest.php | 14 ++++-- .../sp_200507/QNameAssertionTypeTestTrait.php | 3 +- .../XML/sp_200507/RecipientTokenTest.php | 14 ++++-- .../WSSecurity/XML/sp_200507/RelTokenTest.php | 6 ++- .../RequestSecurityTokenTemplateTest.php | 6 ++- .../XML/sp_200507/RequiredElementsTest.php | 25 ++++++++--- .../XML/sp_200507/SamlTokenTest.php | 6 ++- .../sp_200507/SecureConversationTokenTest.php | 30 +++++++++---- .../sp_200507/SecurityContextTokenTest.php | 6 ++- .../XML/sp_200507/SignatureTokenTest.php | 12 ++++- .../XML/sp_200507/SignedElementsTest.php | 25 ++++++++--- .../SignedEndorsingSupportingTokensTest.php | 14 ++++-- .../XML/sp_200507/SignedPartsTest.php | 19 ++++++-- .../sp_200507/SignedSupportingTokensTest.php | 14 ++++-- .../XML/sp_200507/SpnegoContextTokenTest.php | 30 +++++++++---- .../XML/sp_200507/SupportingTokensTest.php | 14 ++++-- .../XML/sp_200507/SymmetricBindingTest.php | 14 ++++-- .../XML/sp_200507/TransportBindingTest.php | 14 ++++-- .../XML/sp_200507/TransportTokenTest.php | 14 ++++-- .../xml/sp/200507/AlgorithmSuite.xml | 2 +- .../xml/sp/200507/AsymmetricBinding.xml | 2 +- .../xml/sp/200507/BootstrapPolicy.xml | 2 +- .../xml/sp/200507/EncryptedParts.xml | 4 +- .../xml/sp/200507/EncryptionToken.xml | 2 +- .../sp/200507/EndorsingSupportingTokens.xml | 2 +- tests/resources/xml/sp/200507/Header.xml | 2 +- .../xml/sp/200507/InitiatorToken.xml | 2 +- .../xml/sp/200507/ProtectionToken.xml | 2 +- .../xml/sp/200507/RecipientToken.xml | 2 +- .../SignedEndorsingSupportingTokens.xml | 2 +- tests/resources/xml/sp/200507/SignedParts.xml | 2 +- .../xml/sp/200507/SignedSupportingTokens.xml | 2 +- .../xml/sp/200507/SupportingTokens.xml | 2 +- .../xml/sp/200507/SymmetricBinding.xml | 2 +- .../xml/sp/200507/TransportBinding.xml | 2 +- .../xml/sp/200507/TransportToken.xml | 2 +- 51 files changed, 411 insertions(+), 162 deletions(-) diff --git a/src/XML/sp_200507/AbstractHeaderType.php b/src/XML/sp_200507/AbstractHeaderType.php index 8855d19e..c9bca258 100644 --- a/src/XML/sp_200507/AbstractHeaderType.php +++ b/src/XML/sp_200507/AbstractHeaderType.php @@ -27,6 +27,12 @@ abstract class AbstractHeaderType extends AbstractSpElement /** The namespace-attribute for the xs:anyAttribute element */ public const XS_ANY_ATTR_NAMESPACE = NS::ANY; + /** The exclusions for the xs:anyAttribute element */ + public const XS_ANY_ATTR_EXCLUSIONS = [ + [null, 'Name'], + [null, 'Namespace'], + ]; + /** * AbstractHeaderType constructor. @@ -88,17 +94,11 @@ public static function fromXML(DOMElement $xml): static ); $namespacedAttributes = self::getAttributesNSFromXML($xml); - foreach ($namespacedAttributes as $i => $attr) { - if ($attr->getNamespaceURI() === null) { - if ($attr->getAttrName() === 'Name' || $attr->getAttrName() === 'Namespace') { - unset($namespacedAttributes[$i]); - } - } - } + $namespace = self::getAttribute($xml, 'Namespace', AnyURIValue::class); return new static( - self::getAttribute($xml, 'Namespace', AnyURIValue::class), - self::getOptionalAttribute($xml, 'Name', QNameValue::class, null), + $namespace, + $xml->hasAttribute('Name') ? QNameValue::fromString($xml->getAttribute('Name')) : null, $namespacedAttributes, ); } diff --git a/tests/WSSecurity/XML/sp_200507/AlgorithmSuiteTest.php b/tests/WSSecurity/XML/sp_200507/AlgorithmSuiteTest.php index bc2487f5..48dfea5c 100644 --- a/tests/WSSecurity/XML/sp_200507/AlgorithmSuiteTest.php +++ b/tests/WSSecurity/XML/sp_200507/AlgorithmSuiteTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AlgorithmSuite; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/AlgorithmSuite.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php index 93b7e991..2ee3b045 100644 --- a/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200507/AsymmetricBindingTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AsymmetricBinding; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/AsymmetricBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/BootstrapPolicyTest.php b/tests/WSSecurity/XML/sp_200507/BootstrapPolicyTest.php index 8d2ec91c..579a91f3 100644 --- a/tests/WSSecurity/XML/sp_200507/BootstrapPolicyTest.php +++ b/tests/WSSecurity/XML/sp_200507/BootstrapPolicyTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\BootstrapPolicy; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/BootstrapPolicy.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php b/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php index 96ca15f8..abe69393 100644 --- a/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,30 +54,34 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $EncryptedElements = new EncryptedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); - $EncryptedElementsElement = $EncryptedElements->toXML(); + $encryptedElements = new EncryptedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); + $encryptedElementsElement = $encryptedElements->toXML(); // Test for an XPath - $xpCache = XMLXPath::getXPath($EncryptedElementsElement); - $EncryptedElementsElements = XMLXPath::xpQuery($EncryptedElementsElement, './sp:XPath', $xpCache); - $this->assertCount(1, $EncryptedElementsElements); + $xpCache = XMLXPath::getXPath($encryptedElementsElement); + $encryptedElementsElements = XMLXPath::xpQuery($encryptedElementsElement, './sp:XPath', $xpCache); + $this->assertCount(1, $encryptedElementsElements); // Test ordering of EncryptedElements contents - /** @psalm-var \DOMElement[] $EncryptedElementsElements */ - $EncryptedElementsElements = XMLXPath::xpQuery( - $EncryptedElementsElement, + $encryptedElementsElements = XMLXPath::xpQuery( + $encryptedElementsElement, './sp:XPath/following-sibling::*', $xpCache, ); - $this->assertCount(1, $EncryptedElementsElements); - $this->assertEquals('ssp:Chunk', $EncryptedElementsElements[0]->tagName); + $this->assertCount(1, $encryptedElementsElements); + $this->assertEquals('ssp:Chunk', $encryptedElementsElements[0]->tagName); } @@ -87,16 +93,22 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $EncryptedElements = new EncryptedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $encryptedElements = new EncryptedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($EncryptedElements), + strval($encryptedElements), ); } } diff --git a/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php b/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php index 9b751a3c..1df7171c 100644 --- a/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php @@ -19,6 +19,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -57,9 +60,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('name'), + [$attr], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); @@ -92,9 +99,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshallingElementOrdering(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('name'), + [$attr], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); diff --git a/tests/WSSecurity/XML/sp_200507/EncryptionTokenTest.php b/tests/WSSecurity/XML/sp_200507/EncryptionTokenTest.php index 10d5a66a..826ceb19 100644 --- a/tests/WSSecurity/XML/sp_200507/EncryptionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/EncryptionTokenTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\EncryptionToken; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/EncryptionToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/EndorsingSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200507/EndorsingSupportingTokensTest.php index b8e4cdd8..23b5b24e 100644 --- a/tests/WSSecurity/XML/sp_200507/EndorsingSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200507/EndorsingSupportingTokensTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\EndorsingSupportingTokens; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/EndorsingSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/HeaderTest.php b/tests/WSSecurity/XML/sp_200507/HeaderTest.php index dde6ec03..acae3993 100644 --- a/tests/WSSecurity/XML/sp_200507/HeaderTest.php +++ b/tests/WSSecurity/XML/sp_200507/HeaderTest.php @@ -14,6 +14,9 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,8 +54,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('name'), + [$attr], + ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/sp_200507/HttpsTokenTest.php b/tests/WSSecurity/XML/sp_200507/HttpsTokenTest.php index f5987f06..5027a51c 100644 --- a/tests/WSSecurity/XML/sp_200507/HttpsTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/HttpsTokenTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -54,12 +56,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $httpsToken = new HttpsToken(true, [$chunk], [$attr]); + $httpsToken = new HttpsToken(BooleanValue::fromBoolean(true), [$chunk], [$attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($httpsToken), diff --git a/tests/WSSecurity/XML/sp_200507/InitiatorTokenTest.php b/tests/WSSecurity/XML/sp_200507/InitiatorTokenTest.php index 11a9f1d6..e4ea6119 100644 --- a/tests/WSSecurity/XML/sp_200507/InitiatorTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/InitiatorTokenTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\InitiatorToken; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/InitiatorToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php index 983adcea..36966439 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php @@ -26,6 +26,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -76,23 +79,23 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), 'PHPUnit', [$attr4]); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -102,7 +105,7 @@ public function testMarshallingElementOrdering(): void ); $requestSecurityTokenTemplate = new RequestSecurityTokenTemplate( - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr1], ); @@ -138,23 +141,27 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + 'PHPUnit', + [$attr4], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -164,7 +171,7 @@ public function testMarshalling(): void ); $requestSecurityTokenTemplate = new RequestSecurityTokenTemplate( - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr1], ); diff --git a/tests/WSSecurity/XML/sp_200507/IssuerTest.php b/tests/WSSecurity/XML/sp_200507/IssuerTest.php index 80a1ef34..f19b51d8 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuerTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuerTest.php @@ -20,6 +20,9 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -80,20 +83,24 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + 'PHPUnit', + [$attr4], + ); $chunk = new Chunk(self::$customContent); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, diff --git a/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php b/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php index 1f8800a1..e5a5e84f 100644 --- a/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php @@ -17,6 +17,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,7 +71,7 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', diff --git a/tests/WSSecurity/XML/sp_200507/LayoutTest.php b/tests/WSSecurity/XML/sp_200507/LayoutTest.php index 011f5751..1606c94d 100644 --- a/tests/WSSecurity/XML/sp_200507/LayoutTest.php +++ b/tests/WSSecurity/XML/sp_200507/LayoutTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\Layout; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/ProtectionTokenTest.php b/tests/WSSecurity/XML/sp_200507/ProtectionTokenTest.php index be93ed7a..37ce3a80 100644 --- a/tests/WSSecurity/XML/sp_200507/ProtectionTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/ProtectionTokenTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\ProtectionToken; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/ProtectionToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/QNameAssertionTypeTestTrait.php b/tests/WSSecurity/XML/sp_200507/QNameAssertionTypeTestTrait.php index 13503a6c..24f56ec2 100644 --- a/tests/WSSecurity/XML/sp_200507/QNameAssertionTypeTestTrait.php +++ b/tests/WSSecurity/XML/sp_200507/QNameAssertionTypeTestTrait.php @@ -6,6 +6,7 @@ use SimpleSAML\Test\WSSecurity\Constants as C; use SimpleSAML\XML\Attribute as XMLAttribute; +use SimpleSAML\XMLSchema\Type\StringValue; use function strval; @@ -24,7 +25,7 @@ trait QNameAssertionTypeTestTrait */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $qns = new static::$testedClass([$attr]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php b/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php index 684bb11c..3dd03bd5 100644 --- a/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\RecipientToken; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/RecipientToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/RelTokenTest.php b/tests/WSSecurity/XML/sp_200507/RelTokenTest.php index 16e9dbfc..4d7f81dc 100644 --- a/tests/WSSecurity/XML/sp_200507/RelTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/RelTokenTest.php @@ -12,11 +12,13 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200507\RelToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,8 +72,8 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); diff --git a/tests/WSSecurity/XML/sp_200507/RequestSecurityTokenTemplateTest.php b/tests/WSSecurity/XML/sp_200507/RequestSecurityTokenTemplateTest.php index 6e525b43..ae6d498b 100644 --- a/tests/WSSecurity/XML/sp_200507/RequestSecurityTokenTemplateTest.php +++ b/tests/WSSecurity/XML/sp_200507/RequestSecurityTokenTemplateTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,13 +54,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $RequestSecurityTokenTemplateElements = new RequestSecurityTokenTemplate( - 'urn:x-simplesamlphp:version', + AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); diff --git a/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php b/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php index b9a03dde..baa207d1 100644 --- a/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,13 +54,18 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $requiredElements = new RequiredElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $requiredElements = new RequiredElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $requiredElementsElement = $requiredElements->toXML(); // Test for an XPath @@ -87,13 +94,19 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $requiredElements = new RequiredElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $requiredElements = new RequiredElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($requiredElements), diff --git a/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php b/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php index 9e7f62e0..560259c9 100644 --- a/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php @@ -12,11 +12,13 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200507\SamlToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,8 +72,8 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); diff --git a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php index 2f2d7839..2c35dee2 100644 --- a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\WSSecurity\XML\sp_200507\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200507\Issuer; use SimpleSAML\WSSecurity\XML\sp_200507\SecureConversationToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\wsa_200408\Address; use SimpleSAML\WSSecurity\XML\wsa_200408\PortType; use SimpleSAML\WSSecurity\XML\wsa_200408\ReferenceParameters; @@ -25,6 +26,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\Type\QNameValue; use function dirname; @@ -75,23 +80,27 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -100,7 +109,12 @@ public function testMarshallingElementOrdering(): void [$attr2], ); - $secureConversationToken = new SecureConversationToken($issuer, IncludeToken::Always, [$chunk], [$attr1]); + $secureConversationToken = new SecureConversationToken( + $issuer, + IncludeTokenValue::fromEnum(IncludeToken::Always), + [$chunk], + [$attr1], + ); $secureConversationTokenElement = $secureConversationToken->toXML(); // Test for a Issuer diff --git a/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php index f8d92c87..3580813c 100644 --- a/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php @@ -12,11 +12,13 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200507\SecurityContextToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,8 +72,8 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); diff --git a/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php b/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php index da82c972..c5bc59d6 100644 --- a/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\SignatureToken; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php b/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php index 74e2823f..11413d2b 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php @@ -18,6 +18,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -52,13 +54,18 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $SignedElements = new SignedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $SignedElements = new SignedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); $SignedElementsElement = $SignedElements->toXML(); // Test for an XPath @@ -87,13 +94,19 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $SignedElements = new SignedElements([$xpath], 'urn:x-simplesamlphp:version', [$chunk], [$attr]); + $SignedElements = new SignedElements( + [$xpath], + AnyURIValue::fromString('urn:x-simplesamlphp:version'), + [$chunk], + [$attr], + ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($SignedElements), diff --git a/tests/WSSecurity/XML/sp_200507/SignedEndorsingSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200507/SignedEndorsingSupportingTokensTest.php index 4d0b3fb5..c6c7f34a 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedEndorsingSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedEndorsingSupportingTokensTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\SignedEndorsingSupportingTokens; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php b/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php index 3aa6eb12..c0c32c71 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php @@ -19,6 +19,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,9 +75,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); @@ -91,9 +98,13 @@ public function testMarshalling(): void */ public function testMarshallingElementOrdering(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header('urn:x-simplesamlphp:namespace', 'ssp:name', [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); diff --git a/tests/WSSecurity/XML/sp_200507/SignedSupportingTokensTest.php b/tests/WSSecurity/XML/sp_200507/SignedSupportingTokensTest.php index 9d53bb74..3abcb185 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedSupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedSupportingTokensTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\SignedSupportingTokens; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/SignedSupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php index 42b6cb66..d01d4996 100644 --- a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\WSSecurity\XML\sp_200507\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200507\Issuer; use SimpleSAML\WSSecurity\XML\sp_200507\SpnegoContextToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\wsa_200408\Address; use SimpleSAML\WSSecurity\XML\wsa_200408\PortType; use SimpleSAML\WSSecurity\XML\wsa_200408\ReferenceParameters; @@ -25,6 +26,10 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; +use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -75,23 +80,27 @@ public static function setUpBeforeClass(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -100,7 +109,12 @@ public function testMarshallingElementOrdering(): void [$attr2], ); - $spnegoContextToken = new SpnegoContextToken($issuer, IncludeToken::Always, [$chunk], [$attr1]); + $spnegoContextToken = new SpnegoContextToken( + $issuer, + IncludeTokenValue::fromEnum(IncludeToken::Always), + [$chunk], + [$attr1], + ); $spnegoContextTokenElement = $spnegoContextToken->toXML(); // Test for a Issuer diff --git a/tests/WSSecurity/XML/sp_200507/SupportingTokensTest.php b/tests/WSSecurity/XML/sp_200507/SupportingTokensTest.php index 48771a7b..68fe218a 100644 --- a/tests/WSSecurity/XML/sp_200507/SupportingTokensTest.php +++ b/tests/WSSecurity/XML/sp_200507/SupportingTokensTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\SupportingTokens; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/SupportingTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SymmetricBindingTest.php b/tests/WSSecurity/XML/sp_200507/SymmetricBindingTest.php index 687e68b8..05b63607 100644 --- a/tests/WSSecurity/XML/sp_200507/SymmetricBindingTest.php +++ b/tests/WSSecurity/XML/sp_200507/SymmetricBindingTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\SymmetricBinding; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/SymmetricBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/TransportBindingTest.php b/tests/WSSecurity/XML/sp_200507/TransportBindingTest.php index 25608fde..86ff4b11 100644 --- a/tests/WSSecurity/XML/sp_200507/TransportBindingTest.php +++ b/tests/WSSecurity/XML/sp_200507/TransportBindingTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\TransportBinding; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/TransportBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/TransportTokenTest.php b/tests/WSSecurity/XML/sp_200507/TransportTokenTest.php index 7e9a3279..5ab6bce4 100644 --- a/tests/WSSecurity/XML/sp_200507/TransportTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/TransportTokenTest.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\TransportToken; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/TransportToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/resources/xml/sp/200507/AlgorithmSuite.xml b/tests/resources/xml/sp/200507/AlgorithmSuite.xml index cf05d766..a5c59799 100644 --- a/tests/resources/xml/sp/200507/AlgorithmSuite.xml +++ b/tests/resources/xml/sp/200507/AlgorithmSuite.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/AsymmetricBinding.xml b/tests/resources/xml/sp/200507/AsymmetricBinding.xml index d017715f..78819612 100644 --- a/tests/resources/xml/sp/200507/AsymmetricBinding.xml +++ b/tests/resources/xml/sp/200507/AsymmetricBinding.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/BootstrapPolicy.xml b/tests/resources/xml/sp/200507/BootstrapPolicy.xml index 93f6432d..e1947052 100644 --- a/tests/resources/xml/sp/200507/BootstrapPolicy.xml +++ b/tests/resources/xml/sp/200507/BootstrapPolicy.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/EncryptedParts.xml b/tests/resources/xml/sp/200507/EncryptedParts.xml index 53f6d371..4df83ac9 100644 --- a/tests/resources/xml/sp/200507/EncryptedParts.xml +++ b/tests/resources/xml/sp/200507/EncryptedParts.xml @@ -1,5 +1,5 @@ - + - + some diff --git a/tests/resources/xml/sp/200507/EncryptionToken.xml b/tests/resources/xml/sp/200507/EncryptionToken.xml index 107206a5..792f9999 100644 --- a/tests/resources/xml/sp/200507/EncryptionToken.xml +++ b/tests/resources/xml/sp/200507/EncryptionToken.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml b/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml index f05316f0..5f8c1b0a 100644 --- a/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml +++ b/tests/resources/xml/sp/200507/EndorsingSupportingTokens.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/Header.xml b/tests/resources/xml/sp/200507/Header.xml index 34f59e85..f7616715 100644 --- a/tests/resources/xml/sp/200507/Header.xml +++ b/tests/resources/xml/sp/200507/Header.xml @@ -1 +1 @@ - + diff --git a/tests/resources/xml/sp/200507/InitiatorToken.xml b/tests/resources/xml/sp/200507/InitiatorToken.xml index 50ff69e4..dc8e21ab 100644 --- a/tests/resources/xml/sp/200507/InitiatorToken.xml +++ b/tests/resources/xml/sp/200507/InitiatorToken.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/ProtectionToken.xml b/tests/resources/xml/sp/200507/ProtectionToken.xml index 9555c76d..5517fa04 100644 --- a/tests/resources/xml/sp/200507/ProtectionToken.xml +++ b/tests/resources/xml/sp/200507/ProtectionToken.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/RecipientToken.xml b/tests/resources/xml/sp/200507/RecipientToken.xml index 793bc8e9..323199ca 100644 --- a/tests/resources/xml/sp/200507/RecipientToken.xml +++ b/tests/resources/xml/sp/200507/RecipientToken.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml b/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml index 79661704..6e541f7a 100644 --- a/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml +++ b/tests/resources/xml/sp/200507/SignedEndorsingSupportingTokens.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/SignedParts.xml b/tests/resources/xml/sp/200507/SignedParts.xml index 110dfc7f..0b2634f0 100644 --- a/tests/resources/xml/sp/200507/SignedParts.xml +++ b/tests/resources/xml/sp/200507/SignedParts.xml @@ -1,5 +1,5 @@ - + some diff --git a/tests/resources/xml/sp/200507/SignedSupportingTokens.xml b/tests/resources/xml/sp/200507/SignedSupportingTokens.xml index 06dd7ad1..891fdd00 100644 --- a/tests/resources/xml/sp/200507/SignedSupportingTokens.xml +++ b/tests/resources/xml/sp/200507/SignedSupportingTokens.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/SupportingTokens.xml b/tests/resources/xml/sp/200507/SupportingTokens.xml index cf7a9973..ab338aef 100644 --- a/tests/resources/xml/sp/200507/SupportingTokens.xml +++ b/tests/resources/xml/sp/200507/SupportingTokens.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/SymmetricBinding.xml b/tests/resources/xml/sp/200507/SymmetricBinding.xml index d8ee37eb..0bf6ef29 100644 --- a/tests/resources/xml/sp/200507/SymmetricBinding.xml +++ b/tests/resources/xml/sp/200507/SymmetricBinding.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/TransportBinding.xml b/tests/resources/xml/sp/200507/TransportBinding.xml index 3d5fa69e..61589e92 100644 --- a/tests/resources/xml/sp/200507/TransportBinding.xml +++ b/tests/resources/xml/sp/200507/TransportBinding.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/TransportToken.xml b/tests/resources/xml/sp/200507/TransportToken.xml index 4d5504f1..062acc0a 100644 --- a/tests/resources/xml/sp/200507/TransportToken.xml +++ b/tests/resources/xml/sp/200507/TransportToken.xml @@ -1,4 +1,4 @@ - + Other From 31785d829e941c3a0de420d59b28fd27869bfbea Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 13 Dec 2025 16:13:29 +0100 Subject: [PATCH 31/34] Migrate to xsd-types --- ...stractRequestSecurityTokenTemplateType.php | 2 -- src/XML/sp_200507/Type/IncludeTokenValue.php | 12 +++++++++ .../XML/sp_200507/IssuedTokenTest.php | 14 +++++++--- tests/WSSecurity/XML/sp_200507/IssuerTest.php | 3 ++- .../XML/sp_200507/KerberosTokenTest.php | 5 ++-- tests/WSSecurity/XML/sp_200507/LayoutTest.php | 2 +- .../WSSecurity/XML/sp_200507/RelTokenTest.php | 2 +- .../XML/sp_200507/SamlTokenTest.php | 2 +- .../sp_200507/SecureConversationTokenTest.php | 26 +++++++++++++------ .../sp_200507/SecurityContextTokenTest.php | 10 +++---- .../XML/sp_200507/SignatureTokenTest.php | 2 +- .../XML/sp_200507/SignedElementsTest.php | 11 ++++---- .../XML/sp_200507/SpnegoContextTokenTest.php | 26 +++++++++++++------ .../WSSecurity/XML/sp_200507/Trust10Test.php | 14 +++++++--- .../XML/sp_200507/UsernameTokenTest.php | 8 +++--- tests/WSSecurity/XML/sp_200507/Wss10Test.php | 14 +++++++--- tests/WSSecurity/XML/sp_200507/Wss11Test.php | 14 +++++++--- .../XML/sp_200507/X509TokenTest.php | 8 +++--- tests/WSSecurity/XML/sp_200507/XPathTest.php | 3 ++- .../resources/xml/sp/200507/KerberosToken.xml | 2 +- tests/resources/xml/sp/200507/Layout.xml | 2 +- tests/resources/xml/sp/200507/RelToken.xml | 2 +- tests/resources/xml/sp/200507/SamlToken.xml | 2 +- .../xml/sp/200507/SecurityContextToken.xml | 2 +- .../xml/sp/200507/SignatureToken.xml | 2 +- tests/resources/xml/sp/200507/Trust10.xml | 2 +- .../resources/xml/sp/200507/UsernameToken.xml | 2 +- tests/resources/xml/sp/200507/Wss10.xml | 2 +- tests/resources/xml/sp/200507/Wss11.xml | 2 +- tests/resources/xml/sp/200507/X509Token.xml | 2 +- 30 files changed, 133 insertions(+), 67 deletions(-) diff --git a/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php index a33f7248..d544411e 100644 --- a/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200507/AbstractRequestSecurityTokenTemplateType.php @@ -49,8 +49,6 @@ final public function __construct( array $elts = [], array $namespacedAttributes = [], ) { - Assert::nullOrValidURI($trustVersion); - $this->setElements($elts); $this->setAttributesNS($namespacedAttributes); } diff --git a/src/XML/sp_200507/Type/IncludeTokenValue.php b/src/XML/sp_200507/Type/IncludeTokenValue.php index 2edad7e9..93f9ba4a 100644 --- a/src/XML/sp_200507/Type/IncludeTokenValue.php +++ b/src/XML/sp_200507/Type/IncludeTokenValue.php @@ -5,6 +5,7 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507\Type; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; +use SimpleSAML\XML\Attribute; use SimpleSAML\XMLSchema\Type\AnyURIValue as BaseAnyURIValue; /** @@ -12,6 +13,17 @@ */ class IncludeTokenValue extends BaseAnyURIValue { + /** + * Convert this value to an attribute + * + * @return \SimpleSAML\XML\Attribute + */ + public function toAttribute(): Attribute + { + return new Attribute(null, null, 'IncludeToken', $this); + } + + /** * @param \SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken $value * @return static diff --git a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php index 36966439..277344af 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\WSSecurity\XML\sp_200507\IssuedToken; use SimpleSAML\WSSecurity\XML\sp_200507\Issuer; use SimpleSAML\WSSecurity\XML\sp_200507\RequestSecurityTokenTemplate; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\wsa_200408\Address; use SimpleSAML\WSSecurity\XML\wsa_200408\PortType; use SimpleSAML\WSSecurity\XML\wsa_200408\ReferenceParameters; @@ -27,6 +28,7 @@ use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSchema\Type\StringValue; @@ -88,7 +90,11 @@ public function testMarshallingElementOrdering(): void $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); - $serviceName = new ServiceName(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), 'PHPUnit', [$attr4]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', @@ -113,7 +119,7 @@ public function testMarshallingElementOrdering(): void $issuedToken = new IssuedToken( $requestSecurityTokenTemplate, $issuer, - IncludeToken::Always, + IncludeTokenValue::fromEnum(IncludeToken::Always), [$chunk], [$attr1], ); @@ -152,7 +158,7 @@ public function testMarshalling(): void $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); $serviceName = new ServiceName( QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), - 'PHPUnit', + NCNameValue::fromString('PHPUnit'), [$attr4], ); @@ -179,7 +185,7 @@ public function testMarshalling(): void $issuedToken = new IssuedToken( $requestSecurityTokenTemplate, $issuer, - IncludeToken::Always, + IncludeTokenValue::fromEnum(IncludeToken::Always), [$chunk], [$attr1], ); diff --git a/tests/WSSecurity/XML/sp_200507/IssuerTest.php b/tests/WSSecurity/XML/sp_200507/IssuerTest.php index f19b51d8..0b030b42 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuerTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuerTest.php @@ -21,6 +21,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSchema\Type\StringValue; @@ -94,7 +95,7 @@ public function testMarshalling(): void $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); $serviceName = new ServiceName( QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), - 'PHPUnit', + NCNameValue::fromString('PHPUnit'), [$attr4], ); $chunk = new Chunk(self::$customContent); diff --git a/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php b/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php index e5a5e84f..7ce9b0a2 100644 --- a/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/KerberosTokenTest.php @@ -12,6 +12,7 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200507\KerberosToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; @@ -72,12 +73,12 @@ public function testMarshallingEmptyElement(): void public function testMarshalling(): void { $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $KerberosToken = new KerberosToken([$chunk], [$includeToken, $attr]); + $KerberosToken = new KerberosToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($KerberosToken), diff --git a/tests/WSSecurity/XML/sp_200507/LayoutTest.php b/tests/WSSecurity/XML/sp_200507/LayoutTest.php index 1606c94d..43357927 100644 --- a/tests/WSSecurity/XML/sp_200507/LayoutTest.php +++ b/tests/WSSecurity/XML/sp_200507/LayoutTest.php @@ -63,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/Layout.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200507/RelTokenTest.php b/tests/WSSecurity/XML/sp_200507/RelTokenTest.php index 4d7f81dc..9902cc11 100644 --- a/tests/WSSecurity/XML/sp_200507/RelTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/RelTokenTest.php @@ -78,7 +78,7 @@ public function testMarshalling(): void 'some', )->documentElement); - $relToken = new RelToken([$chunk], [$includeToken, $attr]); + $relToken = new RelToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($relToken), diff --git a/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php b/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php index 560259c9..1c352dc9 100644 --- a/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SamlTokenTest.php @@ -78,7 +78,7 @@ public function testMarshalling(): void 'some', )->documentElement); - $SamlToken = new SamlToken([$chunk], [$includeToken, $attr]); + $SamlToken = new SamlToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($SamlToken), diff --git a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php index 2c35dee2..2ca4d82e 100644 --- a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php @@ -142,23 +142,27 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -167,7 +171,13 @@ public function testMarshalling(): void [$attr2], ); - $secureConversationToken = new SecureConversationToken($issuer, IncludeToken::Always, [$chunk], [$attr1]); + $secureConversationToken = new SecureConversationToken( + $issuer, + IncludeTokenValue::fromEnum(IncludeToken::Always), + [$chunk], + [$attr1], + ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($secureConversationToken), diff --git a/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php index 3580813c..3e02fb2a 100644 --- a/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecurityContextTokenTest.php @@ -58,12 +58,12 @@ public static function setUpBeforeClass(): void public function testMarshallingEmptyElement(): void { $spns = C::NS_SEC_POLICY_11; - $SecurityContextToken = new SecurityContextToken(); + $securityContextToken = new SecurityContextToken(); $this->assertEquals( "", - strval($SecurityContextToken), + strval($securityContextToken), ); - $this->assertTrue($SecurityContextToken->isEmptyElement()); + $this->assertTrue($securityContextToken->isEmptyElement()); } @@ -78,10 +78,10 @@ public function testMarshalling(): void 'some', )->documentElement); - $SecurityContextToken = new SecurityContextToken([$chunk], [$includeToken, $attr]); + $securityContextToken = new SecurityContextToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($SecurityContextToken), + strval($securityContextToken), ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php b/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php index c5bc59d6..40f215db 100644 --- a/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignatureTokenTest.php @@ -63,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/SignatureToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php b/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php index 11413d2b..90db1949 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php @@ -74,15 +74,14 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $SignedElementsElements); // Test ordering of SignedElements contents - /** @psalm-var \DOMElement[] $SignedElementsElements */ - $SignedElementsElements = XMLXPath::xpQuery( + $signedElementsElements = XMLXPath::xpQuery( $SignedElementsElement, './sp:XPath/following-sibling::*', $xpCache, ); - $this->assertCount(1, $SignedElementsElements); - $this->assertEquals('ssp:Chunk', $SignedElementsElements[0]->tagName); + $this->assertCount(1, $signedElementsElements); + $this->assertEquals('ssp:Chunk', $signedElementsElements[0]->tagName); } @@ -100,7 +99,7 @@ public function testMarshalling(): void 'some', )->documentElement); - $SignedElements = new SignedElements( + $signedElements = new SignedElements( [$xpath], AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], @@ -109,7 +108,7 @@ public function testMarshalling(): void $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($SignedElements), + strval($signedElements), ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php index d01d4996..f3f77af4 100644 --- a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php @@ -142,23 +142,27 @@ public function testMarshallingElementOrdering(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $referenceProperties = new ReferenceProperties([new Chunk(self::$referencePropertiesContent)]); - $portType = new PortType('ssp:Chunk', [$attr3]); - $serviceName = new ServiceName('ssp:Chunk', 'PHPUnit', [$attr4]); + $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr3]); + $serviceName = new ServiceName( + QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), + NCNameValue::fromString('PHPUnit'), + [$attr4], + ); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); $issuer = new Issuer( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, $portType, @@ -167,7 +171,13 @@ public function testMarshalling(): void [$attr2], ); - $spnegoContextToken = new SpnegoContextToken($issuer, IncludeToken::Always, [$chunk], [$attr1]); + $spnegoContextToken = new SpnegoContextToken( + $issuer, + IncludeTokenValue::fromEnum(IncludeToken::Always), + [$chunk], + [$attr1], + ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($spnegoContextToken), diff --git a/tests/WSSecurity/XML/sp_200507/Trust10Test.php b/tests/WSSecurity/XML/sp_200507/Trust10Test.php index eaecd4d1..f33810ef 100644 --- a/tests/WSSecurity/XML/sp_200507/Trust10Test.php +++ b/tests/WSSecurity/XML/sp_200507/Trust10Test.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\Trust10; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/Trust10.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/UsernameTokenTest.php b/tests/WSSecurity/XML/sp_200507/UsernameTokenTest.php index 531649d7..38824407 100644 --- a/tests/WSSecurity/XML/sp_200507/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/UsernameTokenTest.php @@ -11,12 +11,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\sp_200507\UsernameToken; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,13 +72,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $UsernameToken = new UsernameToken([$chunk], [$includeToken, $attr]); + $UsernameToken = new UsernameToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($UsernameToken), diff --git a/tests/WSSecurity/XML/sp_200507/Wss10Test.php b/tests/WSSecurity/XML/sp_200507/Wss10Test.php index 3108c3dd..d18a9400 100644 --- a/tests/WSSecurity/XML/sp_200507/Wss10Test.php +++ b/tests/WSSecurity/XML/sp_200507/Wss10Test.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\Wss10; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/Wss10.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/Wss11Test.php b/tests/WSSecurity/XML/sp_200507/Wss11Test.php index 5f94630c..4942c0ee 100644 --- a/tests/WSSecurity/XML/sp_200507/Wss11Test.php +++ b/tests/WSSecurity/XML/sp_200507/Wss11Test.php @@ -13,11 +13,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\Wss11; use SimpleSAML\WSSecurity\XML\wsp\ExactlyOne; use SimpleSAML\WSSecurity\XML\wsp\Policy; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -60,7 +63,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/sp/200507/Wss11.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$some = new Chunk(DOMDocumentFactory::fromString( 'Some', @@ -70,7 +73,12 @@ public static function setUpBeforeClass(): void 'Other', )->documentElement); - $Id = new XMLAttribute(C::NS_SEC_UTIL, 'wsu', 'Id', 'MyId'); - self::$policy = new Policy('phpunit', $Id, [new ExactlyOne()], [self::$other], [self::$attr]); + self::$policy = new Policy( + [new ExactlyOne()], + [self::$other], + AnyURIValue::fromString('phpunit'), + IDValue::fromString('MyId'), + [self::$attr], + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/X509TokenTest.php b/tests/WSSecurity/XML/sp_200507/X509TokenTest.php index aac4c77d..7ec0aa84 100644 --- a/tests/WSSecurity/XML/sp_200507/X509TokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/X509TokenTest.php @@ -11,12 +11,14 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\sp_200507\X509Token; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,13 +72,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_11, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $X509Token = new X509Token([$chunk], [$includeToken, $attr]); + $X509Token = new X509Token([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($X509Token), diff --git a/tests/WSSecurity/XML/sp_200507/XPathTest.php b/tests/WSSecurity/XML/sp_200507/XPathTest.php index 21d4ff5d..92b1e30f 100644 --- a/tests/WSSecurity/XML/sp_200507/XPathTest.php +++ b/tests/WSSecurity/XML/sp_200507/XPathTest.php @@ -11,6 +11,7 @@ use SimpleSAML\WSSecurity\XML\sp_200507\XPath; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -48,7 +49,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $xpath = new XPath('/bookstore/book[price>35.00]/title'); + $xpath = new XPath(StringValue::fromString('/bookstore/book[price>35.00]/title')); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/resources/xml/sp/200507/KerberosToken.xml b/tests/resources/xml/sp/200507/KerberosToken.xml index d4e473f2..17e92965 100644 --- a/tests/resources/xml/sp/200507/KerberosToken.xml +++ b/tests/resources/xml/sp/200507/KerberosToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/Layout.xml b/tests/resources/xml/sp/200507/Layout.xml index 3a0b2cbf..5e848034 100644 --- a/tests/resources/xml/sp/200507/Layout.xml +++ b/tests/resources/xml/sp/200507/Layout.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/RelToken.xml b/tests/resources/xml/sp/200507/RelToken.xml index 3b99db00..ebef6e34 100644 --- a/tests/resources/xml/sp/200507/RelToken.xml +++ b/tests/resources/xml/sp/200507/RelToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/SamlToken.xml b/tests/resources/xml/sp/200507/SamlToken.xml index a395d852..e07737d9 100644 --- a/tests/resources/xml/sp/200507/SamlToken.xml +++ b/tests/resources/xml/sp/200507/SamlToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/SecurityContextToken.xml b/tests/resources/xml/sp/200507/SecurityContextToken.xml index 73bbbc6d..00022182 100644 --- a/tests/resources/xml/sp/200507/SecurityContextToken.xml +++ b/tests/resources/xml/sp/200507/SecurityContextToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/SignatureToken.xml b/tests/resources/xml/sp/200507/SignatureToken.xml index e59e897e..279f6e5b 100644 --- a/tests/resources/xml/sp/200507/SignatureToken.xml +++ b/tests/resources/xml/sp/200507/SignatureToken.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/Trust10.xml b/tests/resources/xml/sp/200507/Trust10.xml index fb7a9bb7..f809154a 100644 --- a/tests/resources/xml/sp/200507/Trust10.xml +++ b/tests/resources/xml/sp/200507/Trust10.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/UsernameToken.xml b/tests/resources/xml/sp/200507/UsernameToken.xml index af3d704c..19cb0874 100644 --- a/tests/resources/xml/sp/200507/UsernameToken.xml +++ b/tests/resources/xml/sp/200507/UsernameToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/Wss10.xml b/tests/resources/xml/sp/200507/Wss10.xml index c5d631a3..b89a5905 100644 --- a/tests/resources/xml/sp/200507/Wss10.xml +++ b/tests/resources/xml/sp/200507/Wss10.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/Wss11.xml b/tests/resources/xml/sp/200507/Wss11.xml index 86f67daf..8a2a66b3 100644 --- a/tests/resources/xml/sp/200507/Wss11.xml +++ b/tests/resources/xml/sp/200507/Wss11.xml @@ -1,4 +1,4 @@ - + Other diff --git a/tests/resources/xml/sp/200507/X509Token.xml b/tests/resources/xml/sp/200507/X509Token.xml index 2b50016d..fcefd333 100644 --- a/tests/resources/xml/sp/200507/X509Token.xml +++ b/tests/resources/xml/sp/200507/X509Token.xml @@ -1,3 +1,3 @@ - + some From f3680ecfa45ba92a553561f5e7ba73873a9e74dc Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 13 Dec 2025 18:59:32 +0100 Subject: [PATCH 32/34] Migrate to xsd-types --- .../fed/AbstractAttributeExtensibleString.php | 22 +--------- src/XML/fed/DisplayName.php | 21 +++++++++ src/XML/fed/EMail.php | 31 +++++++++++++ src/XML/fed/PPID.php | 21 +++++++++ src/XML/fed/Type/EmailAddressValue.php | 44 +++++++++++++++++++ src/XML/sp_200507/AbstractIssuedTokenType.php | 2 +- .../AbstractSecureConversationTokenType.php | 2 +- .../AbstractSpnegoContextTokenType.php | 2 +- src/XML/sp_200507/Type/IncludeTokenValue.php | 7 +-- src/XML/sp_200702/Type/IncludeTokenValue.php | 8 ++-- .../AbstractSecurityTokenReferenceType.php | 4 +- src/XML/wsse/AbstractUsernameTokenType.php | 5 +-- .../fed/AdditionalContextProcessedTest.php | 3 +- .../fed/ApplicationServiceEndpointTest.php | 12 ++--- .../XML/fed/AttributeServiceEndpointTest.php | 12 ++--- .../XML/fed/AttributeServiceEndpointsTest.php | 12 ++--- .../XML/fed/AuthenticationTokenTest.php | 3 +- .../XML/fed/AutomaticPseudonymsTest.php | 3 +- tests/WSSecurity/XML/fed/ClaimDialectTest.php | 6 ++- .../XML/fed/ClaimDialectsOfferedTest.php | 8 ++-- .../XML/fed/ClaimTypesOfferedTest.php | 19 ++++---- .../XML/fed/ClaimTypesRequestedTest.php | 19 ++++---- .../XML/fed/ClientPseudonymTest.php | 30 +++++++------ tests/WSSecurity/XML/fed/DisplayNameTest.php | 7 +-- tests/WSSecurity/XML/fed/EMailTest.php | 6 ++- tests/WSSecurity/XML/fed/FederationIDTest.php | 6 ++- .../XML/fed/FederationMetadataHandlerTest.php | 3 +- .../XML/fed/FederationMetadataTest.php | 8 ++-- tests/WSSecurity/XML/fed/FederationTest.php | 5 ++- .../XML/fed/FilterPseudonymsTest.php | 9 ++-- tests/WSSecurity/XML/fed/FreshnessTest.php | 7 ++- tests/WSSecurity/XML/fed/IssuerNameTest.php | 6 ++- .../XML/fed/IssuesSpecificPolicyFaultTest.php | 3 +- .../fed/LogicalServiceNamesOfferedTest.php | 8 ++-- tests/WSSecurity/XML/fed/PPIDTest.php | 5 ++- .../XML/fed/PassiveRequestorEndpointTest.php | 12 ++--- .../XML/fed/PassiveRequestorEndpointsTest.php | 12 ++--- tests/WSSecurity/XML/fed/ProofTokenTest.php | 3 +- .../WSSecurity/XML/fed/PseudonymBasisTest.php | 3 +- .../XML/fed/PseudonymServiceEndpointTest.php | 12 ++--- .../XML/fed/PseudonymServiceEndpointsTest.php | 16 ++++--- tests/WSSecurity/XML/fed/PseudonymTest.php | 27 ++++++------ tests/WSSecurity/XML/fed/RealmTest.php | 3 +- tests/WSSecurity/XML/fed/RelativeToTest.php | 3 +- .../XML/fed/RequestProofTokenTest.php | 3 +- .../XML/fed/RequireBearerTokensTest.php | 3 +- .../XML/fed/RequireReferenceTokenTest.php | 8 ++-- .../XML/fed/RequireSharedCookiesTest.php | 3 +- .../XML/fed/RequireSignedTokensTest.php | 3 +- .../fed/RequiresGenericClaimDialectTest.php | 3 +- .../fed/SecurityTokenServiceEndpointTest.php | 12 ++--- .../WSSecurity/XML/fed/SecurityTokenTest.php | 3 +- tests/WSSecurity/XML/fed/SerialNoTest.php | 6 ++- tests/WSSecurity/XML/fed/SignOutBasisTest.php | 3 +- tests/WSSecurity/XML/fed/SignOutTest.php | 19 ++++---- .../SingleSignOutNotificationEndpointTest.php | 12 ++--- ...SingleSignOutNotificationEndpointsTest.php | 12 ++--- .../SingleSignOutSubscriptionEndpointTest.php | 12 ++--- ...SingleSignOutSubscriptionEndpointsTest.php | 12 ++--- tests/WSSecurity/XML/fed/TargetScopesTest.php | 12 ++--- tests/WSSecurity/XML/fed/TokenTypeTest.php | 6 ++- .../XML/fed/TokenTypesOfferedTest.php | 8 ++-- tests/WSSecurity/XML/fed/WebBindingTest.php | 3 +- tests/WSSecurity/XML/mssp/RsaTokenTest.php | 8 ++-- .../XML/mssp/SslContextTokenTest.php | 8 ++-- .../XML/sp_200507/EncryptedElementsTest.php | 1 + .../XML/sp_200507/RecipientTokenTest.php | 2 +- .../sp_200507/SecureConversationTokenTest.php | 2 +- .../XML/sp_200507/SignedElementsTest.php | 1 + .../XML/sp_200702/EncryptedElementsTest.php | 1 + .../XML/sp_200702/EncryptedPartsTest.php | 6 ++- .../XML/sp_200702/UsernameTokenTest.php | 2 +- .../XML/sp_200702/X509TokenTest.php | 2 +- .../WSSecurity/XML/wsa_200408/FaultToTest.php | 2 + tests/WSSecurity/XML/wsa_200408/FromTest.php | 2 + .../XML/wsa_200508/ProblemHeaderQNameTest.php | 2 +- .../XML/wsse/BinarySecurityTokenTest.php | 8 +++- tests/WSSecurity/XML/wsse/EmbeddedTest.php | 4 +- .../WSSecurity/XML/wsse/KeyIdentifierTest.php | 8 +++- tests/WSSecurity/XML/wsse/NonceTest.php | 4 +- tests/WSSecurity/XML/wsse/ReferenceTest.php | 4 +- tests/resources/xml/fed_ClientPseudonym.xml | 2 +- tests/resources/xml/fed_EMail.xml | 2 +- tests/resources/xml/mssp/RsaToken.xml | 2 +- tests/resources/xml/mssp/SslContextToken.xml | 2 +- .../resources/xml/sp/200507/KerberosToken.xml | 2 +- tests/resources/xml/sp/200507/RelToken.xml | 2 +- tests/resources/xml/sp/200507/SamlToken.xml | 2 +- .../xml/sp/200507/SecurityContextToken.xml | 2 +- .../resources/xml/sp/200507/UsernameToken.xml | 2 +- tests/resources/xml/sp/200507/X509Token.xml | 2 +- tests/resources/xml/sp/200702/HttpsToken.xml | 2 +- tests/resources/xml/sp/200702/IssuedToken.xml | 2 +- .../resources/xml/sp/200702/KerberosToken.xml | 2 +- .../resources/xml/sp/200702/KeyValueToken.xml | 2 +- tests/resources/xml/sp/200702/RelToken.xml | 2 +- tests/resources/xml/sp/200702/SamlToken.xml | 2 +- .../xml/sp/200702/SecureConversationToken.xml | 2 +- .../xml/sp/200702/SecurityContextToken.xml | 2 +- .../xml/sp/200702/SpnegoContextToken.xml | 2 +- .../resources/xml/sp/200702/UsernameToken.xml | 2 +- tests/resources/xml/sp/200702/X509Token.xml | 2 +- 102 files changed, 461 insertions(+), 251 deletions(-) create mode 100644 src/XML/fed/Type/EmailAddressValue.php diff --git a/src/XML/fed/AbstractAttributeExtensibleString.php b/src/XML/fed/AbstractAttributeExtensibleString.php index fd7f65aa..f84018b8 100644 --- a/src/XML/fed/AbstractAttributeExtensibleString.php +++ b/src/XML/fed/AbstractAttributeExtensibleString.php @@ -5,10 +5,8 @@ namespace SimpleSAML\WSSecurity\XML\fed; use DOMElement; -use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; -use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -34,31 +32,13 @@ abstract class AbstractAttributeExtensibleString extends AbstractFedElement * @param \SimpleSAML\XMLSchema\Type\StringValue $content * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ - final public function __construct(StringValue $content, array $namespacedAttributes = []) + public function __construct(StringValue $content, array $namespacedAttributes = []) { $this->setContent($content); $this->setAttributesNS($namespacedAttributes); } - /** - * Create a class from XML - * - * @param \DOMElement $xml - * @return static - */ - public static function fromXML(DOMElement $xml): static - { - Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); - Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - - return new static( - StringValue::fromString($xml->textContent), - self::getAttributesNSFromXML($xml), - ); - } - - /** * Create XML from this class * diff --git a/src/XML/fed/DisplayName.php b/src/XML/fed/DisplayName.php index 9f0fec6a..b749b847 100644 --- a/src/XML/fed/DisplayName.php +++ b/src/XML/fed/DisplayName.php @@ -4,6 +4,11 @@ namespace SimpleSAML\WSSecurity\XML\fed; +use DOMElement; +use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; + /** * A DisplayName element * @@ -11,4 +16,20 @@ */ final class DisplayName extends AbstractAttributeExtensibleString { + /** + * Create a class from XML + * + * @param \DOMElement $xml + * @return static + */ + public static function fromXML(DOMElement $xml): static + { + Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); + Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + + return new static( + StringValue::fromString($xml->textContent), + self::getAttributesNSFromXML($xml), + ); + } } diff --git a/src/XML/fed/EMail.php b/src/XML/fed/EMail.php index 74c7d9c3..53e32802 100644 --- a/src/XML/fed/EMail.php +++ b/src/XML/fed/EMail.php @@ -4,6 +4,11 @@ namespace SimpleSAML\WSSecurity\XML\fed; +use DOMElement; +use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\WSSecurity\XML\fed\Type\EmailAddressValue; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; + /** * An EMail element * @@ -11,4 +16,30 @@ */ final class EMail extends AbstractAttributeExtensibleString { + /** + * @param \SimpleSAML\WSSecurity\XML\fed\Type\EmailAddressValue $content + * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + */ + public function __construct(EmailAddressValue $content, array $namespacedAttributes = []) + { + parent::__construct($content, $namespacedAttributes); + } + + + /** + * Create a class from XML + * + * @param \DOMElement $xml + * @return static + */ + public static function fromXML(DOMElement $xml): static + { + Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); + Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + + return new static( + EmailAddressValue::fromString($xml->textContent), + self::getAttributesNSFromXML($xml), + ); + } } diff --git a/src/XML/fed/PPID.php b/src/XML/fed/PPID.php index 8634321f..5bbe9f74 100644 --- a/src/XML/fed/PPID.php +++ b/src/XML/fed/PPID.php @@ -4,6 +4,11 @@ namespace SimpleSAML\WSSecurity\XML\fed; +use DOMElement; +use SimpleSAML\WSSecurity\Assert\Assert; +use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; +use SimpleSAML\XMLSchema\Type\StringValue; + /** * A PPID element * @@ -11,4 +16,20 @@ */ final class PPID extends AbstractAttributeExtensibleString { + /** + * Create a class from XML + * + * @param \DOMElement $xml + * @return static + */ + public static function fromXML(DOMElement $xml): static + { + Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); + Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + + return new static( + StringValue::fromString($xml->textContent), + self::getAttributesNSFromXML($xml), + ); + } } diff --git a/src/XML/fed/Type/EmailAddressValue.php b/src/XML/fed/Type/EmailAddressValue.php new file mode 100644 index 00000000..ba493fda --- /dev/null +++ b/src/XML/fed/Type/EmailAddressValue.php @@ -0,0 +1,44 @@ +sanitizeValue($value)); + } +} diff --git a/src/XML/sp_200507/AbstractIssuedTokenType.php b/src/XML/sp_200507/AbstractIssuedTokenType.php index 98b70827..a1c2a547 100644 --- a/src/XML/sp_200507/AbstractIssuedTokenType.php +++ b/src/XML/sp_200507/AbstractIssuedTokenType.php @@ -37,7 +37,7 @@ abstract class AbstractIssuedTokenType extends AbstractSpElement /** The exclusions for the xs:anyAttribute element */ public const XS_ANY_ATTR_EXCLUSIONS = [ - [null, 'IncludeToken'], + ['http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702', 'IncludeToken'], ]; diff --git a/src/XML/sp_200507/AbstractSecureConversationTokenType.php b/src/XML/sp_200507/AbstractSecureConversationTokenType.php index 092a3a7e..619b8cc3 100644 --- a/src/XML/sp_200507/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200507/AbstractSecureConversationTokenType.php @@ -35,7 +35,7 @@ abstract class AbstractSecureConversationTokenType extends AbstractSpElement /** The exclusions for the xs:anyAttribute element */ public const XS_ANY_ATTR_EXCLUSIONS = [ - [null, 'IncludeToken'], + ['http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702', 'IncludeToken'], ]; diff --git a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php index edb0face..c0767f5e 100644 --- a/src/XML/sp_200507/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200507/AbstractSpnegoContextTokenType.php @@ -35,7 +35,7 @@ abstract class AbstractSpnegoContextTokenType extends AbstractSpElement /** The exclusions for the xs:anyAttribute element */ public const XS_ANY_ATTR_EXCLUSIONS = [ - [null, 'IncludeToken'], + ['http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702', 'IncludeToken'], ]; diff --git a/src/XML/sp_200507/Type/IncludeTokenValue.php b/src/XML/sp_200507/Type/IncludeTokenValue.php index 93f9ba4a..c3e63a19 100644 --- a/src/XML/sp_200507/Type/IncludeTokenValue.php +++ b/src/XML/sp_200507/Type/IncludeTokenValue.php @@ -4,8 +4,9 @@ namespace SimpleSAML\WSSecurity\XML\sp_200507\Type; +use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; -use SimpleSAML\XML\Attribute; +use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XMLSchema\Type\AnyURIValue as BaseAnyURIValue; /** @@ -18,9 +19,9 @@ class IncludeTokenValue extends BaseAnyURIValue * * @return \SimpleSAML\XML\Attribute */ - public function toAttribute(): Attribute + public function toAttribute(): XMLAttribute { - return new Attribute(null, null, 'IncludeToken', $this); + return new XMLAttribute(AbstractSpElement::NS, AbstractSpElement::NS_PREFIX, 'IncludeToken', $this); } diff --git a/src/XML/sp_200702/Type/IncludeTokenValue.php b/src/XML/sp_200702/Type/IncludeTokenValue.php index 0d44acce..417f50d1 100644 --- a/src/XML/sp_200702/Type/IncludeTokenValue.php +++ b/src/XML/sp_200702/Type/IncludeTokenValue.php @@ -4,9 +4,9 @@ namespace SimpleSAML\WSSecurity\XML\sp_200702\Type; -use SimpleSAML\WSSecurity\Constants as C; +use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\XML\Attribute; +use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XMLSchema\Type\AnyURIValue as BaseAnyURIValue; /** @@ -19,9 +19,9 @@ class IncludeTokenValue extends BaseAnyURIValue * * @return \SimpleSAML\XML\Attribute */ - public function toAttribute(): Attribute + public function toAttribute(): XMLAttribute { - return new Attribute(null, null, 'IncludeToken', $this); + return new XMLAttribute(AbstractSpElement::NS, AbstractSpElement::NS_PREFIX, 'IncludeToken', $this); } diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index 37542f18..241cf112 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -44,7 +44,7 @@ abstract class AbstractSecurityTokenReferenceType extends AbstractWsseElement /** * AbstractSecurityReferenceType constructor * - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param \SimpleSAML\XMLSchema\Type\AnyURIValue|null $Usage * @param array<\SimpleSAML\XML\SerializableElementInterface> $children * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes @@ -62,7 +62,7 @@ final public function __construct( /** - * @return \SimpleSAML\XMLSchema\Type\IDValue|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ public function getId(): ?IDValue { diff --git a/src/XML/wsse/AbstractUsernameTokenType.php b/src/XML/wsse/AbstractUsernameTokenType.php index e25fc01d..a8ae9cbc 100644 --- a/src/XML/wsse/AbstractUsernameTokenType.php +++ b/src/XML/wsse/AbstractUsernameTokenType.php @@ -8,7 +8,6 @@ use SimpleSAML\WSSecurity\Assert\Assert; use SimpleSAML\WSSecurity\Constants as C; use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; -use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -51,7 +50,7 @@ abstract class AbstractUsernameTokenType extends AbstractWsseElement * AbstractUsernameTokenType constructor * * @param \SimpleSAML\WSSecurity\XML\wsse\Username $username - * @param \SimpleSAML\XMLSchema\Type\IDValue|null $Id + * @param \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null $Id * @param \SimpleSAML\XML\SerializableElementInterface[] $children * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes */ @@ -67,7 +66,7 @@ final public function __construct( /** - * @return \SimpleSAML\XMLSchema\Type\IDValue|null + * @return \SimpleSAML\WSSecurity\XML\wsu\Type\IDValue|null */ public function getId(): ?IDValue { diff --git a/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php b/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php index f9e3a19f..0085744f 100644 --- a/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php +++ b/tests/WSSecurity/XML/fed/AdditionalContextProcessedTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_AdditionalContextProcessed.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php b/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php index 156f5fd0..bd63bcbb 100644 --- a/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php b/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php index 20c1a907..3933b1dc 100644 --- a/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/AttributeServiceEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -93,17 +95,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php b/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php index cbca7f5b..2dbf0b48 100644 --- a/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/AttributeServiceEndpointsTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php b/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php index 67a64fd1..76f3d7cd 100644 --- a/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php +++ b/tests/WSSecurity/XML/fed/AuthenticationTokenTest.php @@ -17,6 +17,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,7 +54,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_AuthenticationToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/AutomaticPseudonymsTest.php b/tests/WSSecurity/XML/fed/AutomaticPseudonymsTest.php index 2b76a945..aca8333e 100644 --- a/tests/WSSecurity/XML/fed/AutomaticPseudonymsTest.php +++ b/tests/WSSecurity/XML/fed/AutomaticPseudonymsTest.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; use function dirname; @@ -49,7 +50,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $automaticPseudonyms = new AutomaticPseudonyms(true); + $automaticPseudonyms = new AutomaticPseudonyms(BooleanValue::fromBoolean(true)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/ClaimDialectTest.php b/tests/WSSecurity/XML/fed/ClaimDialectTest.php index 02afc654..c64e3407 100644 --- a/tests/WSSecurity/XML/fed/ClaimDialectTest.php +++ b/tests/WSSecurity/XML/fed/ClaimDialectTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -53,13 +55,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $claimDialect = new ClaimDialect( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/ClaimDialectsOfferedTest.php b/tests/WSSecurity/XML/fed/ClaimDialectsOfferedTest.php index 908bee89..d7bed630 100644 --- a/tests/WSSecurity/XML/fed/ClaimDialectsOfferedTest.php +++ b/tests/WSSecurity/XML/fed/ClaimDialectsOfferedTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -55,14 +57,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $child1 = DOMDocumentFactory::fromString( 'SomeChunk', ); $claimDialect = new ClaimDialect( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [new Chunk($child1->documentElement)], [$attr2], ); diff --git a/tests/WSSecurity/XML/fed/ClaimTypesOfferedTest.php b/tests/WSSecurity/XML/fed/ClaimTypesOfferedTest.php index 2319b58e..f8d79c65 100644 --- a/tests/WSSecurity/XML/fed/ClaimTypesOfferedTest.php +++ b/tests/WSSecurity/XML/fed/ClaimTypesOfferedTest.php @@ -20,6 +20,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,16 +61,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); $claimType = new ClaimType( - C::NAMESPACE, - true, - new DisplayName('someDisplayName'), - new Description('someDescription'), - new DisplayValue('someDisplayValue'), - new Value('someValue'), + AnyURIValue::fromString(C::NAMESPACE), + BooleanValue::fromBoolean(true), + new DisplayName(StringValue::fromString('someDisplayName')), + new Description(StringValue::fromString('someDescription')), + new DisplayValue(StringValue::fromString('someDisplayValue')), + new Value(StringValue::fromString('someValue')), [$attr2], ); diff --git a/tests/WSSecurity/XML/fed/ClaimTypesRequestedTest.php b/tests/WSSecurity/XML/fed/ClaimTypesRequestedTest.php index b557e776..8bac4f30 100644 --- a/tests/WSSecurity/XML/fed/ClaimTypesRequestedTest.php +++ b/tests/WSSecurity/XML/fed/ClaimTypesRequestedTest.php @@ -20,6 +20,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -58,16 +61,16 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', StringValue::fromString('testval2')); $claimType = new ClaimType( - C::NAMESPACE, - true, - new DisplayName('someDisplayName'), - new Description('someDescription'), - new DisplayValue('someDisplayValue'), - new Value('someValue'), + AnyURIValue::fromString(C::NAMESPACE), + BooleanValue::fromBoolean(true), + new DisplayName(StringValue::fromString('someDisplayName')), + new Description(StringValue::fromString('someDescription')), + new DisplayValue(StringValue::fromString('someDisplayValue')), + new Value(StringValue::fromString('someValue')), [$attr2], ); diff --git a/tests/WSSecurity/XML/fed/ClientPseudonymTest.php b/tests/WSSecurity/XML/fed/ClientPseudonymTest.php index fe93ec5e..6f4e42d4 100644 --- a/tests/WSSecurity/XML/fed/ClientPseudonymTest.php +++ b/tests/WSSecurity/XML/fed/ClientPseudonymTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\fed\DisplayName; use SimpleSAML\WSSecurity\XML\fed\EMail; use SimpleSAML\WSSecurity\XML\fed\PPID; +use SimpleSAML\WSSecurity\XML\fed\Type\EmailAddressValue; use SimpleSAML\XML\Attribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XPath\XPath; use function dirname; @@ -58,19 +60,19 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', 'testval3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', 'testval4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', StringValue::fromString('testval4')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', )->documentElement); $clientPseudonym = new ClientPseudonym( - new PPID('MyPPID', [$attr2]), - new DisplayName('MyDisplayName', [$attr3]), - new EMail('MyEMail', [$attr4]), + new PPID(StringValue::fromString('MyPPID'), [$attr2]), + new DisplayName(StringValue::fromString('MyDisplayName'), [$attr3]), + new EMail(EmailAddressValue::fromString('example@simplesamlphp.org'), [$attr4]), [$chunk], [$attr1], ); @@ -96,19 +98,19 @@ public function testMarshallingEmptyElement(): void */ public function testMarshallingElementOrdering(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', 'testval3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', 'testval4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', StringValue::fromString('testval4')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', )->documentElement); $clientPseudonym = new ClientPseudonym( - new PPID('MyPPID', [$attr2]), - new DisplayName('MyDisplayName', [$attr3]), - new EMail('MyEMail', [$attr4]), + new PPID(StringValue::fromString('MyPPID'), [$attr2]), + new DisplayName(StringValue::fromString('MyDisplayName'), [$attr3]), + new EMail(EmailAddressValue::fromString('example@simplesamlphp.org'), [$attr4]), [$chunk], [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/DisplayNameTest.php b/tests/WSSecurity/XML/fed/DisplayNameTest.php index 45ca48db..01ce2de4 100644 --- a/tests/WSSecurity/XML/fed/DisplayNameTest.php +++ b/tests/WSSecurity/XML/fed/DisplayNameTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,12 +52,12 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $DisplayName = new DisplayName('phpunit', [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $displayName = new DisplayName(StringValue::fromString('phpunit'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($DisplayName), + strval($displayName), ); } } diff --git a/tests/WSSecurity/XML/fed/EMailTest.php b/tests/WSSecurity/XML/fed/EMailTest.php index 9a14df8c..523fd2d6 100644 --- a/tests/WSSecurity/XML/fed/EMailTest.php +++ b/tests/WSSecurity/XML/fed/EMailTest.php @@ -11,9 +11,11 @@ use SimpleSAML\WSSecurity\XML\fed\AbstractAttributeExtensibleString; use SimpleSAML\WSSecurity\XML\fed\AbstractFedElement; use SimpleSAML\WSSecurity\XML\fed\EMail; +use SimpleSAML\WSSecurity\XML\fed\Type\EmailAddressValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,8 +53,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $EMail = new EMail('phpunit', [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $EMail = new EMail(EmailAddressValue::fromString('example@simplesamlphp.org'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/FederationIDTest.php b/tests/WSSecurity/XML/fed/FederationIDTest.php index 29a23cac..43b1a745 100644 --- a/tests/WSSecurity/XML/fed/FederationIDTest.php +++ b/tests/WSSecurity/XML/fed/FederationIDTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -55,8 +57,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $federationID = new FederationID(C::NAMESPACE, [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $federationID = new FederationID(AnyURIValue::fromString(C::NAMESPACE), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/FederationMetadataHandlerTest.php b/tests/WSSecurity/XML/fed/FederationMetadataHandlerTest.php index bdda20bc..bccc04de 100644 --- a/tests/WSSecurity/XML/fed/FederationMetadataHandlerTest.php +++ b/tests/WSSecurity/XML/fed/FederationMetadataHandlerTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,7 +54,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); $federationMetadataHandler = new FederationMetadataHandler([$attr1]); $this->assertEquals( diff --git a/tests/WSSecurity/XML/fed/FederationMetadataTest.php b/tests/WSSecurity/XML/fed/FederationMetadataTest.php index 66051966..3fdf71a1 100644 --- a/tests/WSSecurity/XML/fed/FederationMetadataTest.php +++ b/tests/WSSecurity/XML/fed/FederationMetadataTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -55,8 +57,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $some = DOMDocumentFactory::fromString( 'Some', ); @@ -65,7 +67,7 @@ public function testMarshalling(): void ); $federation = new Federation( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [new Chunk($some->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/FederationTest.php b/tests/WSSecurity/XML/fed/FederationTest.php index 7c5be19e..7c6aa4e5 100644 --- a/tests/WSSecurity/XML/fed/FederationTest.php +++ b/tests/WSSecurity/XML/fed/FederationTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; use function strval; @@ -52,13 +53,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', AnyURIValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $federation = new Federation( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php b/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php index c6439a50..576b9f78 100644 --- a/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php +++ b/tests/WSSecurity/XML/fed/FilterPseudonymsTest.php @@ -19,6 +19,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -95,10 +96,10 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', 'testval3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', 'testval4'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', StringValue::fromString('testval4')); $pseudonymBasis = new PseudonymBasis( self::$basis, diff --git a/tests/WSSecurity/XML/fed/FreshnessTest.php b/tests/WSSecurity/XML/fed/FreshnessTest.php index 77526062..ff9453d5 100644 --- a/tests/WSSecurity/XML/fed/FreshnessTest.php +++ b/tests/WSSecurity/XML/fed/FreshnessTest.php @@ -15,6 +15,9 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\BooleanValue; +use SimpleSAML\XMLSchema\Type\StringValue; +use SimpleSAML\XMLSchema\Type\UnsignedIntValue; use function dirname; @@ -57,8 +60,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $freshness = new Freshness(123, true, [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $freshness = new Freshness(UnsignedIntValue::fromInteger(123), BooleanValue::fromBoolean(true), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/IssuerNameTest.php b/tests/WSSecurity/XML/fed/IssuerNameTest.php index 330f7a28..c6d83c27 100644 --- a/tests/WSSecurity/XML/fed/IssuerNameTest.php +++ b/tests/WSSecurity/XML/fed/IssuerNameTest.php @@ -13,6 +13,8 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -51,10 +53,10 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $issuerName = new IssuerName( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php b/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php index a287858e..4f87ccad 100644 --- a/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php +++ b/tests/WSSecurity/XML/fed/IssuesSpecificPolicyFaultTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_IssuesSpecificPolicyFault.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/LogicalServiceNamesOfferedTest.php b/tests/WSSecurity/XML/fed/LogicalServiceNamesOfferedTest.php index 792e522d..562ad38a 100644 --- a/tests/WSSecurity/XML/fed/LogicalServiceNamesOfferedTest.php +++ b/tests/WSSecurity/XML/fed/LogicalServiceNamesOfferedTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,11 +56,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $issuerName = new IssuerName( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [$attr2], ); diff --git a/tests/WSSecurity/XML/fed/PPIDTest.php b/tests/WSSecurity/XML/fed/PPIDTest.php index 31682085..3ee1fbb6 100644 --- a/tests/WSSecurity/XML/fed/PPIDTest.php +++ b/tests/WSSecurity/XML/fed/PPIDTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -55,8 +56,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $PPID = new PPID('phpunit', [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $PPID = new PPID(StringValue::fromString('phpunit'), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php index af8e2a12..b1ea766f 100644 --- a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php +++ b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php index d049e028..d7e93a98 100644 --- a/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/PassiveRequestorEndpointsTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/ProofTokenTest.php b/tests/WSSecurity/XML/fed/ProofTokenTest.php index 074efc39..8b640266 100644 --- a/tests/WSSecurity/XML/fed/ProofTokenTest.php +++ b/tests/WSSecurity/XML/fed/ProofTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/fed/PseudonymBasisTest.php b/tests/WSSecurity/XML/fed/PseudonymBasisTest.php index 2b15c094..8b1a6756 100644 --- a/tests/WSSecurity/XML/fed/PseudonymBasisTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymBasisTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php index e873e884..c1f8397c 100644 --- a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php index 0de87f1a..be25c59b 100644 --- a/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymServiceEndpointsTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,28 +92,28 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], [$attr1], ); - $PseudonymServiceEndpoints = new PseudonymServiceEndpoints([$endpointReference]); + $pseudonymServiceEndpoints = new PseudonymServiceEndpoints([$endpointReference]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($PseudonymServiceEndpoints), + strval($pseudonymServiceEndpoints), ); } } diff --git a/tests/WSSecurity/XML/fed/PseudonymTest.php b/tests/WSSecurity/XML/fed/PseudonymTest.php index 752fc979..4f682346 100644 --- a/tests/WSSecurity/XML/fed/PseudonymTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymTest.php @@ -4,7 +4,6 @@ namespace SimpleSAML\Test\WSSecurity\XML\fed; -use DateTimeImmutable; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -16,11 +15,13 @@ use SimpleSAML\WSSecurity\XML\fed\RelativeTo; use SimpleSAML\WSSecurity\XML\fed\SecurityToken; use SimpleSAML\WSSecurity\XML\wsu\Expires; +use SimpleSAML\WSSecurity\XML\wsu\Type\DateTimeValue; use SimpleSAML\XML\Attribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XPath\XPath; use function dirname; @@ -97,11 +98,11 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', 'testval3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', 'testval4'); - $attr5 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr5', 'testval5'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', StringValue::fromString('testval4')); + $attr5 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr5', StringValue::fromString('testval5')); $pseudonymBasis = new PseudonymBasis( self::$basis, @@ -113,7 +114,7 @@ public function testMarshalling(): void [$attr3], ); - $expires = new Expires(new DateTimeImmutable('2001-10-13T09:00:00Z')); + $expires = new Expires(DateTimeValue::fromString('2001-10-13T09:00:00Z')); $securityToken = new SecurityToken( self::$security, @@ -143,11 +144,11 @@ public function testMarshalling(): void */ public function testMarshallingElementOrder(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); - $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', 'testval3'); - $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', 'testval4'); - $attr5 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr5', 'testval5'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); + $attr3 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr3', StringValue::fromString('testval3')); + $attr4 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr4', StringValue::fromString('testval4')); + $attr5 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr5', StringValue::fromString('testval5')); $pseudonymBasis = new PseudonymBasis( self::$basis, @@ -159,7 +160,7 @@ public function testMarshallingElementOrder(): void [$attr3], ); - $expires = new Expires(new DateTimeImmutable('2001-10-13T09:00:00Z')); + $expires = new Expires(DateTimeValue::fromString('2001-10-13T09:00:00Z')); $securityToken = new SecurityToken( self::$security, diff --git a/tests/WSSecurity/XML/fed/RealmTest.php b/tests/WSSecurity/XML/fed/RealmTest.php index 1e350444..dceacc41 100644 --- a/tests/WSSecurity/XML/fed/RealmTest.php +++ b/tests/WSSecurity/XML/fed/RealmTest.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; use function dirname; @@ -50,7 +51,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $realm = new Realm(C::NAMESPACE); + $realm = new Realm(AnyURIValue::fromString(C::NAMESPACE)); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/RelativeToTest.php b/tests/WSSecurity/XML/fed/RelativeToTest.php index fefc5468..b53b5961 100644 --- a/tests/WSSecurity/XML/fed/RelativeToTest.php +++ b/tests/WSSecurity/XML/fed/RelativeToTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -55,7 +56,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/fed/RequestProofTokenTest.php b/tests/WSSecurity/XML/fed/RequestProofTokenTest.php index ee0cc3b5..f07a36ef 100644 --- a/tests/WSSecurity/XML/fed/RequestProofTokenTest.php +++ b/tests/WSSecurity/XML/fed/RequestProofTokenTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_RequestProofToken.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php b/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php index 80913dc8..98fb1dad 100644 --- a/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php +++ b/tests/WSSecurity/XML/fed/RequireBearerTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_RequireBearerTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php b/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php index 189796e8..7c1dec0c 100644 --- a/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php +++ b/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php @@ -13,11 +13,13 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; +use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -72,13 +74,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); - $requireReferenceToken = new RequireReferenceToken([$chunk], [$includeToken, $attr]); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); + $requireReferenceToken = new RequireReferenceToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($requireReferenceToken), diff --git a/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php b/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php index 9ca2cefd..65d1ad8b 100644 --- a/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php +++ b/tests/WSSecurity/XML/fed/RequireSharedCookiesTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_RequireSharedCookies.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php b/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php index 6e1a7e40..490c4e64 100644 --- a/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php +++ b/tests/WSSecurity/XML/fed/RequireSignedTokensTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_RequireSignedTokens.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php b/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php index f11b7703..d397a321 100644 --- a/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php +++ b/tests/WSSecurity/XML/fed/RequiresGenericClaimDialectTest.php @@ -16,6 +16,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -51,7 +52,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_RequiresGenericClaimDialect.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php b/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php index cfcb943e..55d0471e 100644 --- a/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/SecurityTokenServiceEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/SecurityTokenTest.php b/tests/WSSecurity/XML/fed/SecurityTokenTest.php index c8a0fd3e..2327fd15 100644 --- a/tests/WSSecurity/XML/fed/SecurityTokenTest.php +++ b/tests/WSSecurity/XML/fed/SecurityTokenTest.php @@ -15,6 +15,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -54,7 +55,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); diff --git a/tests/WSSecurity/XML/fed/SerialNoTest.php b/tests/WSSecurity/XML/fed/SerialNoTest.php index 26bce561..788482ae 100644 --- a/tests/WSSecurity/XML/fed/SerialNoTest.php +++ b/tests/WSSecurity/XML/fed/SerialNoTest.php @@ -15,6 +15,8 @@ use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,8 +55,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1'); - $serialNo = new SerialNo(C::NAMESPACE, [$attr1]); + $attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('testval1')); + $serialNo = new SerialNo(AnyURIValue::fromString(C::NAMESPACE), [$attr1]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), diff --git a/tests/WSSecurity/XML/fed/SignOutBasisTest.php b/tests/WSSecurity/XML/fed/SignOutBasisTest.php index 7c6fa121..cac769c5 100644 --- a/tests/WSSecurity/XML/fed/SignOutBasisTest.php +++ b/tests/WSSecurity/XML/fed/SignOutBasisTest.php @@ -14,6 +14,7 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -60,7 +61,7 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $signOutBasis = new SignOutBasis( [self::$chunk], diff --git a/tests/WSSecurity/XML/fed/SignOutTest.php b/tests/WSSecurity/XML/fed/SignOutTest.php index 1c0af69c..91a48667 100644 --- a/tests/WSSecurity/XML/fed/SignOutTest.php +++ b/tests/WSSecurity/XML/fed/SignOutTest.php @@ -12,11 +12,14 @@ use SimpleSAML\WSSecurity\XML\fed\Realm; use SimpleSAML\WSSecurity\XML\fed\SignOut; use SimpleSAML\WSSecurity\XML\fed\SignOutBasis; +use SimpleSAML\WSSecurity\XML\wsu\Type\IDValue; use SimpleSAML\XML\Attribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XPath\XPath; use function dirname; @@ -72,20 +75,20 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $signOutBasis = new SignOutBasis( [self::$basis], [$attr2], ); - $realm = new Realm('urn:x-simplesamlphp:namespace'); + $realm = new Realm(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')); $signOut = new SignOut( $signOutBasis, $realm, - 'phpunit', + IDValue::fromString('phpunit'), [self::$chunk], [$attr1], ); @@ -101,20 +104,20 @@ public function testMarshalling(): void */ public function testMarshallingElementOrder(): void { - $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $signOutBasis = new SignOutBasis( [self::$basis], [$attr2], ); - $realm = new Realm('urn:x-simplesamlphp:namespace'); + $realm = new Realm(AnyURIValue::fromString('urn:x-simplesamlphp:namespace')); $signOut = new SignOut( $signOutBasis, $realm, - 'phpunit', + IDValue::fromString('phpunit'), [self::$chunk], [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php index 0f717665..fa51337f 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php index 214b5718..93a4bd91 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutNotificationEndpointsTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php index 6659801a..54cdd7c3 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php index beb4975b..9e7abf12 100644 --- a/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php +++ b/tests/WSSecurity/XML/fed/SingleSignOutSubscriptionEndpointsTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/TargetScopesTest.php b/tests/WSSecurity/XML/fed/TargetScopesTest.php index d0d537bb..40320b9e 100644 --- a/tests/WSSecurity/XML/fed/TargetScopesTest.php +++ b/tests/WSSecurity/XML/fed/TargetScopesTest.php @@ -20,6 +20,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -90,17 +92,17 @@ public function testMarshalling(): void { $doc = DOMDocumentFactory::fromString(''); - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', 'value1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', 'value2'); - $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', 'value3'); - $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', 'value4'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test1', StringValue::fromString('value1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test2', StringValue::fromString('value2')); + $attr3 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test3', StringValue::fromString('value3')); + $attr4 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'test4', StringValue::fromString('value4')); $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParameters)], [$attr4]); $metadata = new Metadata([new Chunk(self::$metadataContent)], [$attr3]); $chunk = new Chunk(self::$customContent); $endpointReference = new EndpointReference( - new Address('https://login.microsoftonline.com/login.srf', [$attr2]), + new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceParameters, $metadata, [$chunk], diff --git a/tests/WSSecurity/XML/fed/TokenTypeTest.php b/tests/WSSecurity/XML/fed/TokenTypeTest.php index f707e397..d32e39c3 100644 --- a/tests/WSSecurity/XML/fed/TokenTypeTest.php +++ b/tests/WSSecurity/XML/fed/TokenTypeTest.php @@ -14,6 +14,8 @@ use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -52,13 +54,13 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); $child = DOMDocumentFactory::fromString( 'SomeChunk', ); $tokenType = new TokenType( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/fed/TokenTypesOfferedTest.php b/tests/WSSecurity/XML/fed/TokenTypesOfferedTest.php index 11e4dfbe..f99ff079 100644 --- a/tests/WSSecurity/XML/fed/TokenTypesOfferedTest.php +++ b/tests/WSSecurity/XML/fed/TokenTypesOfferedTest.php @@ -16,6 +16,8 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\AnyURIValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; @@ -55,8 +57,8 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1'); - $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', 'testval2'); + $attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', StringValue::fromString('testval1')); + $attr2 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr2', StringValue::fromString('testval2')); $child1 = DOMDocumentFactory::fromString( 'SomeChunk', ); @@ -65,7 +67,7 @@ public function testMarshalling(): void ); $tokenType = new TokenType( - 'urn:some:uri', + AnyURIValue::fromString('urn:some:uri'), [new Chunk($child1->documentElement)], [$attr2], ); diff --git a/tests/WSSecurity/XML/fed/WebBindingTest.php b/tests/WSSecurity/XML/fed/WebBindingTest.php index 359b2e48..2701b804 100644 --- a/tests/WSSecurity/XML/fed/WebBindingTest.php +++ b/tests/WSSecurity/XML/fed/WebBindingTest.php @@ -17,6 +17,7 @@ use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -53,7 +54,7 @@ public static function setUpBeforeClass(): void dirname(__FILE__, 4) . '/resources/xml/fed_WebBinding.xml', ); - self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); + self::$attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); self::$chunk = new Chunk(DOMDocumentFactory::fromString( 'Some', diff --git a/tests/WSSecurity/XML/mssp/RsaTokenTest.php b/tests/WSSecurity/XML/mssp/RsaTokenTest.php index 4c0ded89..ea3b8b09 100644 --- a/tests/WSSecurity/XML/mssp/RsaTokenTest.php +++ b/tests/WSSecurity/XML/mssp/RsaTokenTest.php @@ -12,11 +12,13 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,13 +72,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $rsaToken = new RsaToken([$chunk], [$includeToken, $attr]); + $rsaToken = new RsaToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($rsaToken), diff --git a/tests/WSSecurity/XML/mssp/SslContextTokenTest.php b/tests/WSSecurity/XML/mssp/SslContextTokenTest.php index 6e5d713b..7c52d477 100644 --- a/tests/WSSecurity/XML/mssp/SslContextTokenTest.php +++ b/tests/WSSecurity/XML/mssp/SslContextTokenTest.php @@ -12,11 +12,13 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; +use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; @@ -70,13 +72,13 @@ public function testMarshallingEmptyElement(): void */ public function testMarshalling(): void { - $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'value1'); - $includeToken = new XMLAttribute(C::NS_SEC_POLICY_12, 'sp', 'IncludeToken', IncludeToken::Always->value); + $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); + $includeToken = IncludeTokenValue::fromEnum(IncludeToken::Always); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', )->documentElement); - $sslContextToken = new SslContextToken([$chunk], [$includeToken, $attr]); + $sslContextToken = new SslContextToken([$chunk], [$includeToken->toAttribute(), $attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($sslContextToken), diff --git a/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php b/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php index abe69393..edd5c547 100644 --- a/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/EncryptedElementsTest.php @@ -74,6 +74,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $encryptedElementsElements); // Test ordering of EncryptedElements contents + /** @var \DOMElement[] $encryptedElementsElements */ $encryptedElementsElements = XMLXPath::xpQuery( $encryptedElementsElement, './sp:XPath/following-sibling::*', diff --git a/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php b/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php index 3dd03bd5..72ede9a7 100644 --- a/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/RecipientTokenTest.php @@ -79,6 +79,6 @@ public static function setUpBeforeClass(): void AnyURIValue::fromString('phpunit'), IDValue::fromString('MyId'), [self::$attr], - ); + ); } } diff --git a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php index 2ca4d82e..1d4cf453 100644 --- a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php @@ -28,8 +28,8 @@ use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\NCNameValue; -use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; diff --git a/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php b/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php index 90db1949..45b27304 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedElementsTest.php @@ -74,6 +74,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $SignedElementsElements); // Test ordering of SignedElements contents + /** @var \DOMElement[] $signedElementsElements */ $signedElementsElements = XMLXPath::xpQuery( $SignedElementsElement, './sp:XPath/following-sibling::*', diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php index 0471f431..0c9ae08a 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedElementsTest.php @@ -74,6 +74,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $encryptedElementsElements); // Test ordering of EncryptedElements contents + /** @var \DOMElement[] $encryptedElementsElements */ $encryptedElementsElements = XMLXPath::xpQuery( $encryptedElementsElement, './sp:XPath/following-sibling::*', diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php index 6e07a2b7..5ce7ad75 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php @@ -103,7 +103,11 @@ public function testMarshallingElementOrdering(): void { $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $body = new Body(); - $header = new Header(AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), [$attr]); + $header = new Header( + AnyURIValue::fromString('urn:x-simplesamlphp:namespace'), + QNameValue::fromString('{urn:x-simplesamlphp:namespace}name'), + [$attr], + ); $attachments = new Attachments(); $chunk = new Chunk(DOMDocumentFactory::fromString( 'some', diff --git a/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php b/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php index af42d78a..02462958 100644 --- a/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php @@ -12,8 +12,8 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; -use SimpleSAML\WSSecurity\XML\sp_200702\UsernameToken; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; +use SimpleSAML\WSSecurity\XML\sp_200702\UsernameToken; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; diff --git a/tests/WSSecurity/XML/sp_200702/X509TokenTest.php b/tests/WSSecurity/XML/sp_200702/X509TokenTest.php index 5f6e2c6f..d05991d3 100644 --- a/tests/WSSecurity/XML/sp_200702/X509TokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/X509TokenTest.php @@ -12,8 +12,8 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; -use SimpleSAML\WSSecurity\XML\sp_200702\X509Token; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; +use SimpleSAML\WSSecurity\XML\sp_200702\X509Token; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\DOMDocumentFactory; diff --git a/tests/WSSecurity/XML/wsa_200408/FaultToTest.php b/tests/WSSecurity/XML/wsa_200408/FaultToTest.php index 3587968a..d8220ee0 100644 --- a/tests/WSSecurity/XML/wsa_200408/FaultToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/FaultToTest.php @@ -158,7 +158,9 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $faultToElements); // Test ordering of FaultTo contents + /** @var \DOMElement[] $faultToElements */ $faultToElements = XPath::xpQuery($faultToElement, './wsa:Address/following-sibling::*', $xpCache); + $this->assertCount(5, $faultToElements); $this->assertEquals('wsa:ReferenceProperties', $faultToElements[0]->tagName); $this->assertEquals('wsa:ReferenceParameters', $faultToElements[1]->tagName); diff --git a/tests/WSSecurity/XML/wsa_200408/FromTest.php b/tests/WSSecurity/XML/wsa_200408/FromTest.php index ea707dfe..8c2d2ba7 100644 --- a/tests/WSSecurity/XML/wsa_200408/FromTest.php +++ b/tests/WSSecurity/XML/wsa_200408/FromTest.php @@ -158,7 +158,9 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $fromElements); // Test ordering of From contents + /** @var \DOMElement[] $fromElements */ $fromElements = XPath::xpQuery($fromElement, './wsa:Address/following-sibling::*', $xpCache); + $this->assertCount(5, $fromElements); $this->assertEquals('wsa:ReferenceProperties', $fromElements[0]->tagName); $this->assertEquals('wsa:ReferenceParameters', $fromElements[1]->tagName); diff --git a/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php b/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php index 31e8bc54..81867f94 100644 --- a/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php +++ b/tests/WSSecurity/XML/wsa_200508/ProblemHeaderQNameTest.php @@ -16,8 +16,8 @@ use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\NCNameValue; -use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use SimpleSAML\XMLSchema\Type\StringValue; use function dirname; use function strval; diff --git a/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php b/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php index 671f992d..9d3eba78 100644 --- a/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php +++ b/tests/WSSecurity/XML/wsse/BinarySecurityTokenTest.php @@ -67,8 +67,12 @@ public function testMarshalling(): void StringValue::fromString($content), IDValue::fromString('SomeID'), [$attr1], - AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), - AnyURIValue::fromString('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary'), + AnyURIValue::fromString( + 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', + ), + AnyURIValue::fromString( + 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary', + ), ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsse/EmbeddedTest.php b/tests/WSSecurity/XML/wsse/EmbeddedTest.php index f81ed962..d22ea122 100644 --- a/tests/WSSecurity/XML/wsse/EmbeddedTest.php +++ b/tests/WSSecurity/XML/wsse/EmbeddedTest.php @@ -62,7 +62,9 @@ public function testMarshalling(): void ); $embedded = new Embedded( - AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), + AnyURIValue::fromString( + 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', + ), [new Chunk($child->documentElement)], [$attr1], ); diff --git a/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php b/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php index 42491d76..78d7153a 100644 --- a/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php +++ b/tests/WSSecurity/XML/wsse/KeyIdentifierTest.php @@ -67,8 +67,12 @@ public function testMarshalling(): void StringValue::fromString($content), IDValue::fromString('SomeID'), [$attr1], - AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), - AnyURIValue::fromString('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary'), + AnyURIValue::fromString( + 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', + ), + AnyURIValue::fromString( + 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary', + ), ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsse/NonceTest.php b/tests/WSSecurity/XML/wsse/NonceTest.php index c877a806..e8d59eee 100644 --- a/tests/WSSecurity/XML/wsse/NonceTest.php +++ b/tests/WSSecurity/XML/wsse/NonceTest.php @@ -65,7 +65,9 @@ public function testMarshalling(): void StringValue::fromString($content), IDValue::fromString('SomeID'), [$attr1], - AnyURIValue::fromString('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary'), + AnyURIValue::fromString( + 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary', + ), ); $this->assertEquals( diff --git a/tests/WSSecurity/XML/wsse/ReferenceTest.php b/tests/WSSecurity/XML/wsse/ReferenceTest.php index 20729502..c2f7ca96 100644 --- a/tests/WSSecurity/XML/wsse/ReferenceTest.php +++ b/tests/WSSecurity/XML/wsse/ReferenceTest.php @@ -59,7 +59,9 @@ public function testMarshalling(): void $reference = new Reference( AnyURIValue::fromString('urn:some:uri'), - AnyURIValue::fromString('http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken'), + AnyURIValue::fromString( + 'http://schemas.microsoft.com/5.0.0.0/ConfigurationManager/Enrollment/DeviceEnrollmentUserToken', + ), [$attr1], ); diff --git a/tests/resources/xml/fed_ClientPseudonym.xml b/tests/resources/xml/fed_ClientPseudonym.xml index 2e6f72a6..4667c010 100644 --- a/tests/resources/xml/fed_ClientPseudonym.xml +++ b/tests/resources/xml/fed_ClientPseudonym.xml @@ -1,6 +1,6 @@ MyPPID MyDisplayName - MyEMail + example@simplesamlphp.org Some diff --git a/tests/resources/xml/fed_EMail.xml b/tests/resources/xml/fed_EMail.xml index 97931a02..7e22c53e 100644 --- a/tests/resources/xml/fed_EMail.xml +++ b/tests/resources/xml/fed_EMail.xml @@ -1 +1 @@ -phpunit +example@simplesamlphp.org diff --git a/tests/resources/xml/mssp/RsaToken.xml b/tests/resources/xml/mssp/RsaToken.xml index f74c8e23..7808eacb 100644 --- a/tests/resources/xml/mssp/RsaToken.xml +++ b/tests/resources/xml/mssp/RsaToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/mssp/SslContextToken.xml b/tests/resources/xml/mssp/SslContextToken.xml index 34b75b0d..465b92c4 100644 --- a/tests/resources/xml/mssp/SslContextToken.xml +++ b/tests/resources/xml/mssp/SslContextToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/KerberosToken.xml b/tests/resources/xml/sp/200507/KerberosToken.xml index 17e92965..d4e473f2 100644 --- a/tests/resources/xml/sp/200507/KerberosToken.xml +++ b/tests/resources/xml/sp/200507/KerberosToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/RelToken.xml b/tests/resources/xml/sp/200507/RelToken.xml index ebef6e34..3b99db00 100644 --- a/tests/resources/xml/sp/200507/RelToken.xml +++ b/tests/resources/xml/sp/200507/RelToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/SamlToken.xml b/tests/resources/xml/sp/200507/SamlToken.xml index e07737d9..a395d852 100644 --- a/tests/resources/xml/sp/200507/SamlToken.xml +++ b/tests/resources/xml/sp/200507/SamlToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/SecurityContextToken.xml b/tests/resources/xml/sp/200507/SecurityContextToken.xml index 00022182..73bbbc6d 100644 --- a/tests/resources/xml/sp/200507/SecurityContextToken.xml +++ b/tests/resources/xml/sp/200507/SecurityContextToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/UsernameToken.xml b/tests/resources/xml/sp/200507/UsernameToken.xml index 19cb0874..af3d704c 100644 --- a/tests/resources/xml/sp/200507/UsernameToken.xml +++ b/tests/resources/xml/sp/200507/UsernameToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200507/X509Token.xml b/tests/resources/xml/sp/200507/X509Token.xml index fcefd333..2b50016d 100644 --- a/tests/resources/xml/sp/200507/X509Token.xml +++ b/tests/resources/xml/sp/200507/X509Token.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/HttpsToken.xml b/tests/resources/xml/sp/200702/HttpsToken.xml index e8a2406e..66a90768 100644 --- a/tests/resources/xml/sp/200702/HttpsToken.xml +++ b/tests/resources/xml/sp/200702/HttpsToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/IssuedToken.xml b/tests/resources/xml/sp/200702/IssuedToken.xml index 05bfd422..ffca8358 100644 --- a/tests/resources/xml/sp/200702/IssuedToken.xml +++ b/tests/resources/xml/sp/200702/IssuedToken.xml @@ -1,4 +1,4 @@ - + urn:x-simplesamlphp:issuer some diff --git a/tests/resources/xml/sp/200702/KerberosToken.xml b/tests/resources/xml/sp/200702/KerberosToken.xml index 2cc83de2..bbfb9651 100644 --- a/tests/resources/xml/sp/200702/KerberosToken.xml +++ b/tests/resources/xml/sp/200702/KerberosToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/KeyValueToken.xml b/tests/resources/xml/sp/200702/KeyValueToken.xml index 9dfa1952..1d73b0ef 100644 --- a/tests/resources/xml/sp/200702/KeyValueToken.xml +++ b/tests/resources/xml/sp/200702/KeyValueToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/RelToken.xml b/tests/resources/xml/sp/200702/RelToken.xml index f52e9302..bb61bda7 100644 --- a/tests/resources/xml/sp/200702/RelToken.xml +++ b/tests/resources/xml/sp/200702/RelToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/SamlToken.xml b/tests/resources/xml/sp/200702/SamlToken.xml index 5b858c6c..cfc9f205 100644 --- a/tests/resources/xml/sp/200702/SamlToken.xml +++ b/tests/resources/xml/sp/200702/SamlToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/SecureConversationToken.xml b/tests/resources/xml/sp/200702/SecureConversationToken.xml index 7e23eef1..077430da 100644 --- a/tests/resources/xml/sp/200702/SecureConversationToken.xml +++ b/tests/resources/xml/sp/200702/SecureConversationToken.xml @@ -1,4 +1,4 @@ - + urn:x-simplesamlphp:issuer some diff --git a/tests/resources/xml/sp/200702/SecurityContextToken.xml b/tests/resources/xml/sp/200702/SecurityContextToken.xml index cefa9b0a..d6f1545c 100644 --- a/tests/resources/xml/sp/200702/SecurityContextToken.xml +++ b/tests/resources/xml/sp/200702/SecurityContextToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/SpnegoContextToken.xml b/tests/resources/xml/sp/200702/SpnegoContextToken.xml index 0db1d87a..3eb22219 100644 --- a/tests/resources/xml/sp/200702/SpnegoContextToken.xml +++ b/tests/resources/xml/sp/200702/SpnegoContextToken.xml @@ -1,4 +1,4 @@ - + urn:x-simplesamlphp:issuer some diff --git a/tests/resources/xml/sp/200702/UsernameToken.xml b/tests/resources/xml/sp/200702/UsernameToken.xml index 11f5291a..07a44a02 100644 --- a/tests/resources/xml/sp/200702/UsernameToken.xml +++ b/tests/resources/xml/sp/200702/UsernameToken.xml @@ -1,3 +1,3 @@ - + some diff --git a/tests/resources/xml/sp/200702/X509Token.xml b/tests/resources/xml/sp/200702/X509Token.xml index 7cd7f958..d4a54563 100644 --- a/tests/resources/xml/sp/200702/X509Token.xml +++ b/tests/resources/xml/sp/200702/X509Token.xml @@ -1,3 +1,3 @@ - + some From 5052c45c4674315341e3c17605c648a941866045 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 13 Dec 2025 19:20:50 +0100 Subject: [PATCH 33/34] Migrate to xsd-types --- src/XML/auth/AbstractConstrainedValueType.php | 1 - src/XML/auth/AbstractStructuredValueType.php | 1 - src/XML/fed/AbstractClaimDialectType.php | 1 - src/XML/fed/AbstractClientPseudonymType.php | 1 - .../fed/AbstractFederationMetadataType.php | 1 - src/XML/fed/AbstractFederationType.php | 1 - src/XML/fed/AbstractProofTokenType.php | 1 - src/XML/fed/AbstractPseudonymBasisType.php | 1 - src/XML/fed/AbstractReferenceTokenType.php | 1 - src/XML/fed/AbstractRelativeToType.php | 1 - src/XML/fed/AbstractRequestProofTokenType.php | 1 - src/XML/fed/AbstractRequestPseudonymType.php | 1 - src/XML/fed/AbstractSecurityTokenType.php | 1 - src/XML/fed/AbstractTokenType.php | 1 - src/XML/fed/AbstractTokenTypesOfferedType.php | 1 - src/XML/sp_200507/AbstractSePartsType.php | 1 - .../sp_200507/AbstractTokenAssertionType.php | 1 - src/XML/sp_200702/AbstractIssuedTokenType.php | 5 +-- .../sp_200702/AbstractKeyValueTokenType.php | 5 +-- .../sp_200702/AbstractNestedPolicyType.php | 5 +-- src/XML/sp_200702/AbstractReqPartsType.php | 5 +-- ...stractRequestSecurityTokenTemplateType.php | 4 ++- src/XML/sp_200702/AbstractSePartsType.php | 5 +-- .../AbstractSecureConversationTokenType.php | 4 ++- src/XML/sp_200702/AbstractSerElementsType.php | 4 ++- .../AbstractSpnegoContextTokenType.php | 4 ++- .../sp_200702/AbstractTokenAssertionType.php | 4 ++- src/XML/wsa_200408/ReferenceParameters.php | 1 - src/XML/wsa_200408/ReferenceProperties.php | 1 - .../AbstractEndpointReferenceType.php | 1 - src/XML/wsa_200508/Metadata.php | 1 - src/XML/wsa_200508/ReferenceParameters.php | 1 - src/XML/wsp/AbstractOperatorContentType.php | 5 +-- src/XML/wsp/AppliesTo.php | 1 - src/XML/wsp/PolicyAttachment.php | 1 - src/XML/wsse/AbstractEmbeddedType.php | 1 - src/XML/wsse/AbstractSecurityHeaderType.php | 1 - .../AbstractSecurityTokenReferenceType.php | 1 - .../AbstractTransformationParametersType.php | 1 - tests/WSSecurity/XML/auth/ClaimTypeTest.php | 2 +- .../XML/fed/ClientPseudonymTest.php | 3 +- tests/WSSecurity/XML/fed/PseudonymTest.php | 3 +- tests/WSSecurity/XML/fed/SignOutTest.php | 3 +- .../XML/sp_200507/EncryptedPartsTest.php | 21 +++++++------ .../XML/sp_200507/IssuedTokenTest.php | 3 +- .../XML/sp_200507/RequiredElementsTest.php | 2 +- .../sp_200507/SecureConversationTokenTest.php | 3 +- .../XML/sp_200507/SignedPartsTest.php | 21 +++++++------ .../XML/sp_200507/SpnegoContextTokenTest.php | 3 +- .../ContentEncryptedElementsTest.php | 3 +- .../XML/sp_200702/EncryptedPartsTest.php | 22 ++++++------- .../XML/sp_200702/IssuedTokenTest.php | 3 +- .../XML/sp_200702/RequiredElementsTest.php | 2 +- .../XML/sp_200702/RequiredPartsTest.php | 23 +++++++------- .../sp_200702/SecureConversationTokenTest.php | 4 ++- .../XML/sp_200702/SignedElementsTest.php | 24 +++++++------- .../XML/sp_200702/SignedPartsTest.php | 23 +++++++------- .../XML/sp_200702/SpnegoContextTokenTest.php | 3 +- .../XML/wsa_200408/EndpointReferenceTest.php | 2 +- .../WSSecurity/XML/wsa_200408/ReplyToTest.php | 31 ++++++++++--------- 60 files changed, 143 insertions(+), 139 deletions(-) diff --git a/src/XML/auth/AbstractConstrainedValueType.php b/src/XML/auth/AbstractConstrainedValueType.php index 270e8c02..69d94846 100644 --- a/src/XML/auth/AbstractConstrainedValueType.php +++ b/src/XML/auth/AbstractConstrainedValueType.php @@ -139,7 +139,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $this->getValue()->toXML($e); - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/auth/AbstractStructuredValueType.php b/src/XML/auth/AbstractStructuredValueType.php index 11950aa2..e11c7b98 100644 --- a/src/XML/auth/AbstractStructuredValueType.php +++ b/src/XML/auth/AbstractStructuredValueType.php @@ -82,7 +82,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractClaimDialectType.php b/src/XML/fed/AbstractClaimDialectType.php index 36c10c37..fd9f4134 100644 --- a/src/XML/fed/AbstractClaimDialectType.php +++ b/src/XML/fed/AbstractClaimDialectType.php @@ -99,7 +99,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractClientPseudonymType.php b/src/XML/fed/AbstractClientPseudonymType.php index ce3d4555..e04face0 100644 --- a/src/XML/fed/AbstractClientPseudonymType.php +++ b/src/XML/fed/AbstractClientPseudonymType.php @@ -146,7 +146,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractFederationMetadataType.php b/src/XML/fed/AbstractFederationMetadataType.php index b66d43c2..fb3f2e7b 100644 --- a/src/XML/fed/AbstractFederationMetadataType.php +++ b/src/XML/fed/AbstractFederationMetadataType.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractFederationType.php b/src/XML/fed/AbstractFederationType.php index bb301830..5da7f2d7 100644 --- a/src/XML/fed/AbstractFederationType.php +++ b/src/XML/fed/AbstractFederationType.php @@ -109,7 +109,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractProofTokenType.php b/src/XML/fed/AbstractProofTokenType.php index e14c1edd..7ac99638 100644 --- a/src/XML/fed/AbstractProofTokenType.php +++ b/src/XML/fed/AbstractProofTokenType.php @@ -85,7 +85,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractPseudonymBasisType.php b/src/XML/fed/AbstractPseudonymBasisType.php index 89812cfb..2544ce4c 100644 --- a/src/XML/fed/AbstractPseudonymBasisType.php +++ b/src/XML/fed/AbstractPseudonymBasisType.php @@ -88,7 +88,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractReferenceTokenType.php b/src/XML/fed/AbstractReferenceTokenType.php index 33b8e586..7c318baf 100644 --- a/src/XML/fed/AbstractReferenceTokenType.php +++ b/src/XML/fed/AbstractReferenceTokenType.php @@ -157,7 +157,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractRelativeToType.php b/src/XML/fed/AbstractRelativeToType.php index 96957d74..02f02412 100644 --- a/src/XML/fed/AbstractRelativeToType.php +++ b/src/XML/fed/AbstractRelativeToType.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractRequestProofTokenType.php b/src/XML/fed/AbstractRequestProofTokenType.php index f9a12bcf..51615a8d 100644 --- a/src/XML/fed/AbstractRequestProofTokenType.php +++ b/src/XML/fed/AbstractRequestProofTokenType.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractRequestPseudonymType.php b/src/XML/fed/AbstractRequestPseudonymType.php index 989c3278..442d0a24 100644 --- a/src/XML/fed/AbstractRequestPseudonymType.php +++ b/src/XML/fed/AbstractRequestPseudonymType.php @@ -130,7 +130,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractSecurityTokenType.php b/src/XML/fed/AbstractSecurityTokenType.php index 36488fbc..08fa4750 100644 --- a/src/XML/fed/AbstractSecurityTokenType.php +++ b/src/XML/fed/AbstractSecurityTokenType.php @@ -85,7 +85,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractTokenType.php b/src/XML/fed/AbstractTokenType.php index 60508b9c..acac67b8 100644 --- a/src/XML/fed/AbstractTokenType.php +++ b/src/XML/fed/AbstractTokenType.php @@ -109,7 +109,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/fed/AbstractTokenTypesOfferedType.php b/src/XML/fed/AbstractTokenTypesOfferedType.php index 0fbfad68..db9e0df1 100644 --- a/src/XML/fed/AbstractTokenTypesOfferedType.php +++ b/src/XML/fed/AbstractTokenTypesOfferedType.php @@ -109,7 +109,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $tokenType->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/sp_200507/AbstractSePartsType.php b/src/XML/sp_200507/AbstractSePartsType.php index 7fe51c62..7258e051 100644 --- a/src/XML/sp_200507/AbstractSePartsType.php +++ b/src/XML/sp_200507/AbstractSePartsType.php @@ -142,7 +142,6 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200507/AbstractTokenAssertionType.php b/src/XML/sp_200507/AbstractTokenAssertionType.php index 7c8159f5..7130db10 100644 --- a/src/XML/sp_200507/AbstractTokenAssertionType.php +++ b/src/XML/sp_200507/AbstractTokenAssertionType.php @@ -97,7 +97,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ $elt->toXML($e); } diff --git a/src/XML/sp_200702/AbstractIssuedTokenType.php b/src/XML/sp_200702/AbstractIssuedTokenType.php index 3c01096d..a9456ddd 100644 --- a/src/XML/sp_200702/AbstractIssuedTokenType.php +++ b/src/XML/sp_200702/AbstractIssuedTokenType.php @@ -130,8 +130,9 @@ public function toXML(?DOMElement $parent = null): DOMElement $this->getRequestSecurityTokenTemplate()->toXML($e); foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractKeyValueTokenType.php b/src/XML/sp_200702/AbstractKeyValueTokenType.php index 6620712c..b95b3dbf 100644 --- a/src/XML/sp_200702/AbstractKeyValueTokenType.php +++ b/src/XML/sp_200702/AbstractKeyValueTokenType.php @@ -97,8 +97,9 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractNestedPolicyType.php b/src/XML/sp_200702/AbstractNestedPolicyType.php index 831ebfad..811af280 100644 --- a/src/XML/sp_200702/AbstractNestedPolicyType.php +++ b/src/XML/sp_200702/AbstractNestedPolicyType.php @@ -90,8 +90,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $element) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $element */ - $element->toXML($e); + if (!$element->isEmptyElement()) { + $element->toXML($e); + } } return $e; diff --git a/src/XML/sp_200702/AbstractReqPartsType.php b/src/XML/sp_200702/AbstractReqPartsType.php index c0bbe0e0..e3c246fa 100644 --- a/src/XML/sp_200702/AbstractReqPartsType.php +++ b/src/XML/sp_200702/AbstractReqPartsType.php @@ -121,8 +121,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php index fa841e8e..54ada26c 100644 --- a/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp_200702/AbstractRequestSecurityTokenTemplateType.php @@ -126,7 +126,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractSePartsType.php b/src/XML/sp_200702/AbstractSePartsType.php index 4078fb96..4089415a 100644 --- a/src/XML/sp_200702/AbstractSePartsType.php +++ b/src/XML/sp_200702/AbstractSePartsType.php @@ -163,8 +163,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $elt */ - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractSecureConversationTokenType.php b/src/XML/sp_200702/AbstractSecureConversationTokenType.php index ffad5124..9b67d0a4 100644 --- a/src/XML/sp_200702/AbstractSecureConversationTokenType.php +++ b/src/XML/sp_200702/AbstractSecureConversationTokenType.php @@ -121,7 +121,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractSerElementsType.php b/src/XML/sp_200702/AbstractSerElementsType.php index a656c486..faa4e0df 100644 --- a/src/XML/sp_200702/AbstractSerElementsType.php +++ b/src/XML/sp_200702/AbstractSerElementsType.php @@ -132,7 +132,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php index 3e5558d1..4a107386 100644 --- a/src/XML/sp_200702/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp_200702/AbstractSpnegoContextTokenType.php @@ -121,7 +121,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $elt) { - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/sp_200702/AbstractTokenAssertionType.php b/src/XML/sp_200702/AbstractTokenAssertionType.php index a8258724..6a6c94b4 100644 --- a/src/XML/sp_200702/AbstractTokenAssertionType.php +++ b/src/XML/sp_200702/AbstractTokenAssertionType.php @@ -97,7 +97,9 @@ public function toXML(?DOMElement $parent = null): DOMElement $e = $this->instantiateParentElement($parent); foreach ($this->getElements() as $elt) { - $elt->toXML($e); + if (!$elt->isEmptyElement()) { + $elt->toXML($e); + } } foreach ($this->getAttributesNS() as $attr) { diff --git a/src/XML/wsa_200408/ReferenceParameters.php b/src/XML/wsa_200408/ReferenceParameters.php index 60e1c07e..5d004ae6 100644 --- a/src/XML/wsa_200408/ReferenceParameters.php +++ b/src/XML/wsa_200408/ReferenceParameters.php @@ -76,7 +76,6 @@ public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsa_200408/ReferenceProperties.php b/src/XML/wsa_200408/ReferenceProperties.php index d72275b5..adb0deff 100644 --- a/src/XML/wsa_200408/ReferenceProperties.php +++ b/src/XML/wsa_200408/ReferenceProperties.php @@ -76,7 +76,6 @@ public function toXML(?DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsa_200508/AbstractEndpointReferenceType.php b/src/XML/wsa_200508/AbstractEndpointReferenceType.php index 0b497104..008d0c2d 100644 --- a/src/XML/wsa_200508/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200508/AbstractEndpointReferenceType.php @@ -155,7 +155,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $this->getReferenceParameters()?->toXML($e); $this->getMetadata()?->toXML($e); - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsa_200508/Metadata.php b/src/XML/wsa_200508/Metadata.php index 2381df71..faa50351 100644 --- a/src/XML/wsa_200508/Metadata.php +++ b/src/XML/wsa_200508/Metadata.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsa_200508/ReferenceParameters.php b/src/XML/wsa_200508/ReferenceParameters.php index 7e51ee70..ec7395b8 100644 --- a/src/XML/wsa_200508/ReferenceParameters.php +++ b/src/XML/wsa_200508/ReferenceParameters.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsp/AbstractOperatorContentType.php b/src/XML/wsp/AbstractOperatorContentType.php index d17aaa93..14519242 100644 --- a/src/XML/wsp/AbstractOperatorContentType.php +++ b/src/XML/wsp/AbstractOperatorContentType.php @@ -136,8 +136,9 @@ public function toXML(?DOMElement $parent = null): DOMElement } foreach ($this->getElements() as $c) { - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $c */ - $c->toXML($e); + if (!$c->isEmptyElement()) { + $c->toXML($e); + } } return $e; diff --git a/src/XML/wsp/AppliesTo.php b/src/XML/wsp/AppliesTo.php index 71404da6..0a900434 100644 --- a/src/XML/wsp/AppliesTo.php +++ b/src/XML/wsp/AppliesTo.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsp/PolicyAttachment.php b/src/XML/wsp/PolicyAttachment.php index 73f2fe61..fd851042 100644 --- a/src/XML/wsp/PolicyAttachment.php +++ b/src/XML/wsp/PolicyAttachment.php @@ -133,7 +133,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsse/AbstractEmbeddedType.php b/src/XML/wsse/AbstractEmbeddedType.php index d011404a..bfe79ef6 100644 --- a/src/XML/wsse/AbstractEmbeddedType.php +++ b/src/XML/wsse/AbstractEmbeddedType.php @@ -109,7 +109,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsse/AbstractSecurityHeaderType.php b/src/XML/wsse/AbstractSecurityHeaderType.php index 6de02d20..15c45d45 100644 --- a/src/XML/wsse/AbstractSecurityHeaderType.php +++ b/src/XML/wsse/AbstractSecurityHeaderType.php @@ -91,7 +91,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index 241cf112..779e375e 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -142,7 +142,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/src/XML/wsse/AbstractTransformationParametersType.php b/src/XML/wsse/AbstractTransformationParametersType.php index a8fcfb55..dd15075c 100644 --- a/src/XML/wsse/AbstractTransformationParametersType.php +++ b/src/XML/wsse/AbstractTransformationParametersType.php @@ -90,7 +90,6 @@ public function toXML(?DOMElement $parent = null): DOMElement $attr->toXML($e); } - /** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ foreach ($this->getElements() as $child) { if (!$child->isEmptyElement()) { $child->toXML($e); diff --git a/tests/WSSecurity/XML/auth/ClaimTypeTest.php b/tests/WSSecurity/XML/auth/ClaimTypeTest.php index 186fcb91..8e95c53d 100644 --- a/tests/WSSecurity/XML/auth/ClaimTypeTest.php +++ b/tests/WSSecurity/XML/auth/ClaimTypeTest.php @@ -102,7 +102,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $claimTypeElements); // Test ordering of ClaimType contents - /** @psalm-var \DOMElement[] $claimTypeElements */ + /** @var \DOMElement[] $claimTypeElements */ $claimTypeElements = XPath::xpQuery($claimTypeElement, './auth:DisplayName/following-sibling::*', $xpCache); $this->assertCount(3, $claimTypeElements); $this->assertEquals('auth:Description', $claimTypeElements[0]->tagName); diff --git a/tests/WSSecurity/XML/fed/ClientPseudonymTest.php b/tests/WSSecurity/XML/fed/ClientPseudonymTest.php index 6f4e42d4..13eb0e24 100644 --- a/tests/WSSecurity/XML/fed/ClientPseudonymTest.php +++ b/tests/WSSecurity/XML/fed/ClientPseudonymTest.php @@ -122,8 +122,9 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $clientPseudonymElements); // Test ordering of ClientPseudonym contents - /** @psalm-var \DOMElement[] $clientPseudonymElements */ + /** @var \DOMElement[] $clientPseudonymElements */ $clientPseudonymElements = XPath::xpQuery($clientPseudonymElement, './fed:PPID/following-sibling::*', $xpCache); + $this->assertCount(3, $clientPseudonymElements); $this->assertEquals('fed:DisplayName', $clientPseudonymElements[0]->tagName); $this->assertEquals('fed:EMail', $clientPseudonymElements[1]->tagName); diff --git a/tests/WSSecurity/XML/fed/PseudonymTest.php b/tests/WSSecurity/XML/fed/PseudonymTest.php index 4f682346..3e2148fa 100644 --- a/tests/WSSecurity/XML/fed/PseudonymTest.php +++ b/tests/WSSecurity/XML/fed/PseudonymTest.php @@ -186,8 +186,9 @@ public function testMarshallingElementOrder(): void $this->assertCount(1, $pseudonymBasisElements); // Test ordering of Pseudonym contents - /** @psalm-var \DOMElement[] $pseudonymElements */ + /** @var \DOMElement[] $pseudonymElements */ $pseudonymElements = XPath::xpQuery($pseudonymElement, './fed:PseudonymBasis/following-sibling::*', $xpCache); + $this->assertCount(5, $pseudonymElements); $this->assertEquals('fed:RelativeTo', $pseudonymElements[0]->tagName); $this->assertEquals('wsu:Expires', $pseudonymElements[1]->tagName); diff --git a/tests/WSSecurity/XML/fed/SignOutTest.php b/tests/WSSecurity/XML/fed/SignOutTest.php index 91a48667..f57f0b42 100644 --- a/tests/WSSecurity/XML/fed/SignOutTest.php +++ b/tests/WSSecurity/XML/fed/SignOutTest.php @@ -129,8 +129,9 @@ public function testMarshallingElementOrder(): void $this->assertCount(1, $signOutElements); // Test ordering of SignOUt contents - /** @psalm-var \DOMElement[] $signOutElements */ + /** @var \DOMElement[] $signOutElements */ $signOutElements = XPath::xpQuery($signOutElement, './fed:Realm/following-sibling::*', $xpCache); + $this->assertCount(2, $signOutElements); $this->assertEquals('fed:SignOutBasis', $signOutElements[0]->tagName); $this->assertEquals('ssp:Chunk', $signOutElements[1]->tagName); diff --git a/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php b/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php index 1df7171c..8667f493 100644 --- a/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200507/EncryptedPartsTest.php @@ -110,19 +110,20 @@ public function testMarshallingElementOrdering(): void 'some', )->documentElement); - $EncryptedParts = new EncryptedParts($body, [$header], [$chunk], [$attr]); - $EncryptedPartsElement = $EncryptedParts->toXML(); + $encryptedParts = new EncryptedParts($body, [$header], [$chunk], [$attr]); + $encryptedPartsElement = $encryptedParts->toXML(); // Test for a Body - $xpCache = XPath::getXPath($EncryptedPartsElement); - $EncryptedPartsElements = XPath::xpQuery($EncryptedPartsElement, './sp:Body', $xpCache); - $this->assertCount(1, $EncryptedPartsElements); + $xpCache = XPath::getXPath($encryptedPartsElement); + $encryptedPartsElements = XPath::xpQuery($encryptedPartsElement, './sp:Body', $xpCache); + $this->assertCount(1, $encryptedPartsElements); // Test ordering of EncryptedParts contents - /** @psalm-var \DOMElement[] $EncryptedPartsElements */ - $EncryptedPartsElements = XPath::xpQuery($EncryptedPartsElement, './sp:Body/following-sibling::*', $xpCache); - $this->assertCount(2, $EncryptedPartsElements); - $this->assertEquals('sp:Header', $EncryptedPartsElements[0]->tagName); - $this->assertEquals('ssp:Chunk', $EncryptedPartsElements[1]->tagName); + /** @var \DOMElement[] $encryptedPartsElements */ + $encryptedPartsElements = XPath::xpQuery($encryptedPartsElement, './sp:Body/following-sibling::*', $xpCache); + + $this->assertCount(2, $encryptedPartsElements); + $this->assertEquals('sp:Header', $encryptedPartsElements[0]->tagName); + $this->assertEquals('ssp:Chunk', $encryptedPartsElements[1]->tagName); } } diff --git a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php index 277344af..70741baf 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php @@ -131,8 +131,9 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $issuedTokenElements); // Test ordering of IssuedToken contents - /** @psalm-var \DOMElement[] $issuedTokenElements */ + /** @var \DOMElement[] $issuedTokenElements */ $issuedTokenElements = XPath::xpQuery($issuedTokenElement, './sp:Issuer/following-sibling::*', $xpCache); + $this->assertCount(2, $issuedTokenElements); $this->assertEquals('sp:RequestSecurityTokenTemplate', $issuedTokenElements[0]->tagName); $this->assertEquals('ssp:Chunk', $issuedTokenElements[1]->tagName); diff --git a/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php b/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php index baa207d1..2fb15356 100644 --- a/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php +++ b/tests/WSSecurity/XML/sp_200507/RequiredElementsTest.php @@ -74,7 +74,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $requiredElementsElements); // Test ordering of RequiredElements contents - /** @psalm-var \DOMElement[] $requiredElementsElements */ + /** @var \DOMElement[] $requiredElementsElements */ $requiredElementsElements = XMLXPath::xpQuery( $requiredElementsElement, './sp:XPath/following-sibling::*', diff --git a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php index 1d4cf453..e4a9bbf6 100644 --- a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php @@ -123,12 +123,13 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $secureConversationTokenElements); // Test ordering of SecureConversationToken contents - /** @psalm-var \DOMElement[] $secureConversationTokenElements */ + /** @var \DOMElement[] $secureConversationTokenElements */ $secureConversationTokenElements = XPath::xpQuery( $secureConversationTokenElement, './sp:Issuer/following-sibling::*', $xpCache, ); + $this->assertCount(1, $secureConversationTokenElements); $this->assertEquals('ssp:Chunk', $secureConversationTokenElements[0]->tagName); } diff --git a/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php b/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php index c0c32c71..9cfd5017 100644 --- a/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200507/SignedPartsTest.php @@ -109,19 +109,20 @@ public function testMarshallingElementOrdering(): void 'some', )->documentElement); - $SignedParts = new SignedParts($body, [$header], [$chunk], [$attr]); - $SignedPartsElement = $SignedParts->toXML(); + $signedParts = new SignedParts($body, [$header], [$chunk], [$attr]); + $signedPartsElement = $signedParts->toXML(); // Test for a Body - $xpCache = XPath::getXPath($SignedPartsElement); - $SignedPartsElements = XPath::xpQuery($SignedPartsElement, './sp:Body', $xpCache); - $this->assertCount(1, $SignedPartsElements); + $xpCache = XPath::getXPath($signedPartsElement); + $signedPartsElements = XPath::xpQuery($signedPartsElement, './sp:Body', $xpCache); + $this->assertCount(1, $signedPartsElements); // Test ordering of SignedParts contents - /** @psalm-var \DOMElement[] $SignedPartsElements */ - $SignedPartsElements = XPath::xpQuery($SignedPartsElement, './sp:Body/following-sibling::*', $xpCache); - $this->assertCount(2, $SignedPartsElements); - $this->assertEquals('sp:Header', $SignedPartsElements[0]->tagName); - $this->assertEquals('ssp:Chunk', $SignedPartsElements[1]->tagName); + /** @var \DOMElement[] $signedPartsElements */ + $signedPartsElements = XPath::xpQuery($signedPartsElement, './sp:Body/following-sibling::*', $xpCache); + + $this->assertCount(2, $signedPartsElements); + $this->assertEquals('sp:Header', $signedPartsElements[0]->tagName); + $this->assertEquals('ssp:Chunk', $signedPartsElements[1]->tagName); } } diff --git a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php index f3f77af4..678e2a28 100644 --- a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php @@ -123,12 +123,13 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $spnegoContextTokenElements); // Test ordering of SpnegoContextToken contents - /** @psalm-var \DOMElement[] $spnegoContextTokenElements */ + /** @var \DOMElement[] $spnegoContextTokenElements */ $spnegoContextTokenElements = XPath::xpQuery( $spnegoContextTokenElement, './sp:Issuer/following-sibling::*', $xpCache, ); + $this->assertCount(1, $spnegoContextTokenElements); $this->assertEquals('ssp:Chunk', $spnegoContextTokenElements[0]->tagName); } diff --git a/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php b/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php index f23e38fb..b67a7950 100644 --- a/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/ContentEncryptedElementsTest.php @@ -78,12 +78,13 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $contentEncryptedElementsElements); // Test ordering of ContentEncryptedElements contents - /** @psalm-var \DOMElement[] $contentEncryptedElementsElements */ + /** @var \DOMElement[] $contentEncryptedElementsElements */ $contentEncryptedElementsElements = XMLXPath::xpQuery( $contentEncryptedElementsElement, './sp:XPath/following-sibling::*', $xpCache, ); + $this->assertCount(1, $contentEncryptedElementsElements); $this->assertEquals('ssp:Chunk', $contentEncryptedElementsElements[0]->tagName); } diff --git a/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php b/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php index 5ce7ad75..a8509cc3 100644 --- a/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/EncryptedPartsTest.php @@ -113,20 +113,20 @@ public function testMarshallingElementOrdering(): void 'some', )->documentElement); - $EncryptedParts = new EncryptedParts($body, [$header], $attachments, [$chunk], [$attr]); - $EncryptedPartsElement = $EncryptedParts->toXML(); + $encryptedParts = new EncryptedParts($body, [$header], $attachments, [$chunk], [$attr]); + $encryptedPartsElement = $encryptedParts->toXML(); // Test for a Body - $xpCache = XPath::getXPath($EncryptedPartsElement); - $EncryptedPartsElements = XPath::xpQuery($EncryptedPartsElement, './sp:Body', $xpCache); - $this->assertCount(1, $EncryptedPartsElements); + $xpCache = XPath::getXPath($encryptedPartsElement); + $encryptedPartsElements = XPath::xpQuery($encryptedPartsElement, './sp:Body', $xpCache); + $this->assertCount(1, $encryptedPartsElements); // Test ordering of EncryptedParts contents - /** @psalm-var \DOMElement[] $EncryptedPartsElements */ - $EncryptedPartsElements = XPath::xpQuery($EncryptedPartsElement, './sp:Body/following-sibling::*', $xpCache); - $this->assertCount(3, $EncryptedPartsElements); - $this->assertEquals('sp:Header', $EncryptedPartsElements[0]->tagName); - $this->assertEquals('sp:Attachments', $EncryptedPartsElements[1]->tagName); - $this->assertEquals('ssp:Chunk', $EncryptedPartsElements[2]->tagName); + /** @var \DOMElement[] $encryptedPartsElements */ + $encryptedPartsElements = XPath::xpQuery($encryptedPartsElement, './sp:Body/following-sibling::*', $xpCache); + $this->assertCount(3, $encryptedPartsElements); + $this->assertEquals('sp:Header', $encryptedPartsElements[0]->tagName); + $this->assertEquals('sp:Attachments', $encryptedPartsElements[1]->tagName); + $this->assertEquals('ssp:Chunk', $encryptedPartsElements[2]->tagName); } } diff --git a/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php index ce2f7e04..e21788d7 100644 --- a/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/IssuedTokenTest.php @@ -83,8 +83,9 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $issuedTokenElements); // Test ordering of IssuedToken contents - /** @psalm-var \DOMElement[] $issuedTokenElements */ + /** @var \DOMElement[] $issuedTokenElements */ $issuedTokenElements = XPath::xpQuery($issuedTokenElement, './sp:IssuerName/following-sibling::*', $xpCache); + $this->assertCount(2, $issuedTokenElements); $this->assertEquals('sp:RequestSecurityTokenTemplate', $issuedTokenElements[0]->tagName); $this->assertEquals('ssp:Chunk', $issuedTokenElements[1]->tagName); diff --git a/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php b/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php index fa6d77ae..9a765e00 100644 --- a/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/RequiredElementsTest.php @@ -74,7 +74,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $requiredElementsElements); // Test ordering of RequiredElements contents - /** @psalm-var \DOMElement[] $requiredElementsElements */ + /** @var \DOMElement[] $requiredElementsElements */ $requiredElementsElements = XMLXPath::xpQuery( $requiredElementsElement, './sp:XPath/following-sibling::*', diff --git a/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php b/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php index c2e54680..42a5db1a 100644 --- a/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/RequiredPartsTest.php @@ -80,19 +80,20 @@ public function testMarshallingElementOrdering(): void 'some', )->documentElement); - $RequiredParts = new RequiredParts([$header], [$chunk], [$attr]); - $RequiredPartsElement = $RequiredParts->toXML(); + $requiredParts = new RequiredParts([$header], [$chunk], [$attr]); + $requiredPartsElement = $requiredParts->toXML(); // Test for a Header - $xpCache = XPath::getXPath($RequiredPartsElement); - $RequiredPartsElements = XPath::xpQuery($RequiredPartsElement, './sp:Header', $xpCache); - $this->assertCount(1, $RequiredPartsElements); + $xpCache = XPath::getXPath($requiredPartsElement); + $requiredPartsElements = XPath::xpQuery($requiredPartsElement, './sp:Header', $xpCache); + $this->assertCount(1, $requiredPartsElements); // Test ordering of RequiredParts contents - /** @psalm-var \DOMElement[] $RequiredPartsElements */ - $RequiredPartsElements = XPath::xpQuery($RequiredPartsElement, './sp:Header/following-sibling::*', $xpCache); - $this->assertCount(1, $RequiredPartsElements); - $this->assertEquals('ssp:Chunk', $RequiredPartsElements[0]->tagName); + /** @var \DOMElement[] $requiredPartsElements */ + $requiredPartsElements = XPath::xpQuery($requiredPartsElement, './sp:Header/following-sibling::*', $xpCache); + + $this->assertCount(1, $requiredPartsElements); + $this->assertEquals('ssp:Chunk', $requiredPartsElements[0]->tagName); } @@ -114,10 +115,10 @@ public function testMarshalling(): void 'some', )->documentElement); - $RequiredParts = new RequiredParts([$header], [$chunk], [$attr]); + $requiredParts = new RequiredParts([$header], [$chunk], [$attr]); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($RequiredParts), + strval($requiredParts), ); } } diff --git a/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php index d8986f04..8f2e4dfd 100644 --- a/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SecureConversationTokenTest.php @@ -76,12 +76,13 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $secureConversationTokenElements); // Test ordering of SecureConversationToken contents - /** @psalm-var \DOMElement[] $secureConversationTokenElements */ + /** @var \DOMElement[] $secureConversationTokenElements */ $secureConversationTokenElements = XPath::xpQuery( $secureConversationTokenElement, './sp:IssuerName/following-sibling::*', $xpCache, ); + $this->assertCount(1, $secureConversationTokenElements); $this->assertEquals('ssp:Chunk', $secureConversationTokenElements[0]->tagName); } @@ -108,6 +109,7 @@ public function testMarshalling(): void [$chunk], [$includeToken->toAttribute(), $attr], ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($secureConversationToken), diff --git a/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php b/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php index 3a429369..1b7d7218 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedElementsTest.php @@ -60,29 +60,29 @@ public function testMarshallingElementOrdering(): void 'some', )->documentElement); - $SignedElements = new SignedElements( + $signedElements = new SignedElements( [$xpath], AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], [$attr], ); - $SignedElementsElement = $SignedElements->toXML(); + $signedElementsElement = $signedElements->toXML(); // Test for an XPath - $xpCache = XMLXPath::getXPath($SignedElementsElement); - $SignedElementsElements = XMLXPath::xpQuery($SignedElementsElement, './sp:XPath', $xpCache); - $this->assertCount(1, $SignedElementsElements); + $xpCache = XMLXPath::getXPath($signedElementsElement); + $signedElementsElements = XMLXPath::xpQuery($signedElementsElement, './sp:XPath', $xpCache); + $this->assertCount(1, $signedElementsElements); // Test ordering of SignedElements contents - /** @psalm-var \DOMElement[] $SignedElementsElements */ - $SignedElementsElements = XMLXPath::xpQuery( - $SignedElementsElement, + /** @var \DOMElement[] $signedElementsElements */ + $signedElementsElements = XMLXPath::xpQuery( + $signedElementsElement, './sp:XPath/following-sibling::*', $xpCache, ); - $this->assertCount(1, $SignedElementsElements); - $this->assertEquals('ssp:Chunk', $SignedElementsElements[0]->tagName); + $this->assertCount(1, $signedElementsElements); + $this->assertEquals('ssp:Chunk', $signedElementsElements[0]->tagName); } @@ -100,7 +100,7 @@ public function testMarshalling(): void 'some', )->documentElement); - $SignedElements = new SignedElements( + $signedElements = new SignedElements( [$xpath], AnyURIValue::fromString('urn:x-simplesamlphp:version'), [$chunk], @@ -108,7 +108,7 @@ public function testMarshalling(): void ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($SignedElements), + strval($signedElements), ); } } diff --git a/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php b/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php index a60d5469..74d566e5 100644 --- a/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php +++ b/tests/WSSecurity/XML/sp_200702/SignedPartsTest.php @@ -112,20 +112,21 @@ public function testMarshallingElementOrdering(): void 'some', )->documentElement); - $SignedParts = new SignedParts($body, [$header], $attachments, [$chunk], [$attr]); - $SignedPartsElement = $SignedParts->toXML(); + $signedParts = new SignedParts($body, [$header], $attachments, [$chunk], [$attr]); + $signedPartsElement = $signedParts->toXML(); // Test for a Body - $xpCache = XPath::getXPath($SignedPartsElement); - $SignedPartsElements = XPath::xpQuery($SignedPartsElement, './sp:Body', $xpCache); - $this->assertCount(1, $SignedPartsElements); + $xpCache = XPath::getXPath($signedPartsElement); + $signedPartsElements = XPath::xpQuery($signedPartsElement, './sp:Body', $xpCache); + $this->assertCount(1, $signedPartsElements); // Test ordering of SignedParts contents - /** @psalm-var \DOMElement[] $SignedPartsElements */ - $SignedPartsElements = XPath::xpQuery($SignedPartsElement, './sp:Body/following-sibling::*', $xpCache); - $this->assertCount(3, $SignedPartsElements); - $this->assertEquals('sp:Header', $SignedPartsElements[0]->tagName); - $this->assertEquals('sp:Attachments', $SignedPartsElements[1]->tagName); - $this->assertEquals('ssp:Chunk', $SignedPartsElements[2]->tagName); + /** @var \DOMElement[] $signedPartsElements */ + $signedPartsElements = XPath::xpQuery($signedPartsElement, './sp:Body/following-sibling::*', $xpCache); + + $this->assertCount(3, $signedPartsElements); + $this->assertEquals('sp:Header', $signedPartsElements[0]->tagName); + $this->assertEquals('sp:Attachments', $signedPartsElements[1]->tagName); + $this->assertEquals('ssp:Chunk', $signedPartsElements[2]->tagName); } } diff --git a/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php index 86619d24..10285878 100644 --- a/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SpnegoContextTokenTest.php @@ -72,12 +72,13 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $spnegoContextTokenElements); // Test ordering of SpnegoContextToken contents - /** @psalm-var \DOMElement[] $spnegoContextTokenElements */ + /** @var \DOMElement[] $spnegoContextTokenElements */ $spnegoContextTokenElements = XPath::xpQuery( $spnegoContextTokenElement, './sp:IssuerName/following-sibling::*', $xpCache, ); + $this->assertCount(1, $spnegoContextTokenElements); $this->assertEquals('ssp:Chunk', $spnegoContextTokenElements[0]->tagName); } diff --git a/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php b/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php index 20eb02a4..ccce8b9f 100644 --- a/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php +++ b/tests/WSSecurity/XML/wsa_200408/EndpointReferenceTest.php @@ -158,7 +158,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $endpointReferenceElements); // Test ordering of EndpointReference contents - /** @psalm-var \DOMElement[] $endpointReferenceElements */ + /** @var \DOMElement[] $endpointReferenceElements */ $endpointReferenceElements = XPath::xpQuery( $endpointReferenceElement, './wsa:Address/following-sibling::*', diff --git a/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php b/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php index e928493d..eea70f50 100644 --- a/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php +++ b/tests/WSSecurity/XML/wsa_200408/ReplyToTest.php @@ -103,7 +103,7 @@ public function testMarshalling(): void ); $chunk = new Chunk(self::$customContent); - $ReplyTo = new ReplyTo( + $replyTo = new ReplyTo( new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, @@ -115,7 +115,7 @@ public function testMarshalling(): void $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($ReplyTo), + strval($replyTo), ); } @@ -141,7 +141,7 @@ public function testMarshallingElementOrdering(): void ); $chunk = new Chunk(self::$customContent); - $ReplyTo = new ReplyTo( + $replyTo = new ReplyTo( new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr2]), $referenceProperties, $referenceParameters, @@ -152,19 +152,20 @@ public function testMarshallingElementOrdering(): void ); // Test for an Address - $ReplyToElement = $ReplyTo->toXML(); - $xpCache = XPath::getXPath($ReplyToElement); - $ReplyToElements = XPath::xpQuery($ReplyToElement, './wsa:Address', $xpCache); - $this->assertCount(1, $ReplyToElements); + $replyToElement = $replyTo->toXML(); + $xpCache = XPath::getXPath($replyToElement); + $replyToElements = XPath::xpQuery($replyToElement, './wsa:Address', $xpCache); + $this->assertCount(1, $replyToElements); // Test ordering of ReplyTo contents - /** @psalm-var \DOMElement[] $ReplyToElements */ - $ReplyToElements = XPath::xpQuery($ReplyToElement, './wsa:Address/following-sibling::*', $xpCache); - $this->assertCount(5, $ReplyToElements); - $this->assertEquals('wsa:ReferenceProperties', $ReplyToElements[0]->tagName); - $this->assertEquals('wsa:ReferenceParameters', $ReplyToElements[1]->tagName); - $this->assertEquals('wsa:PortType', $ReplyToElements[2]->tagName); - $this->assertEquals('wsa:ServiceName', $ReplyToElements[3]->tagName); - $this->assertEquals('ssp:Chunk', $ReplyToElements[4]->tagName); + /** @var \DOMElement[] $replyToElements */ + $replyToElements = XPath::xpQuery($replyToElement, './wsa:Address/following-sibling::*', $xpCache); + + $this->assertCount(5, $replyToElements); + $this->assertEquals('wsa:ReferenceProperties', $replyToElements[0]->tagName); + $this->assertEquals('wsa:ReferenceParameters', $replyToElements[1]->tagName); + $this->assertEquals('wsa:PortType', $replyToElements[2]->tagName); + $this->assertEquals('wsa:ServiceName', $replyToElements[3]->tagName); + $this->assertEquals('ssp:Chunk', $replyToElements[4]->tagName); } } From d667323cef76376aecbf5d09bae301143a895abe Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 13 Dec 2025 19:45:03 +0100 Subject: [PATCH 34/34] Migrate to xsd-types --- tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/RelTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/SamlTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php | 2 -- tests/WSSecurity/XML/sp_200702/WssX509Pkcs7Token10Test.php | 2 +- tests/WSSecurity/XML/sp_200702/X509TokenTest.php | 2 -- 12 files changed, 1 insertion(+), 23 deletions(-) diff --git a/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php b/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php index 7c1dec0c..573979d4 100644 --- a/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php +++ b/tests/WSSecurity/XML/fed/RequireReferenceTokenTest.php @@ -12,7 +12,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; @@ -30,7 +29,6 @@ */ #[Group('fed')] #[CoversClass(RequireReferenceToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class RequireReferenceTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php index 70741baf..652e0967 100644 --- a/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/IssuedTokenTest.php @@ -12,7 +12,6 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractIssuedTokenType; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200507\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200507\IssuedToken; use SimpleSAML\WSSecurity\XML\sp_200507\Issuer; use SimpleSAML\WSSecurity\XML\sp_200507\RequestSecurityTokenTemplate; @@ -41,7 +40,6 @@ */ #[Group('sp')] #[CoversClass(IssuedToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractIssuedTokenType::class)] #[CoversClass(AbstractSpElement::class)] final class IssuedTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php index e4a9bbf6..d53ae2b6 100644 --- a/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SecureConversationTokenTest.php @@ -12,7 +12,6 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSecureConversationTokenType; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200507\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200507\Issuer; use SimpleSAML\WSSecurity\XML\sp_200507\SecureConversationToken; use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; @@ -40,7 +39,6 @@ */ #[Group('sp')] #[CoversClass(SecureConversationToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractSecureConversationTokenType::class)] #[CoversClass(AbstractSpElement::class)] final class SecureConversationTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php index 678e2a28..7bb471d4 100644 --- a/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200507/SpnegoContextTokenTest.php @@ -12,7 +12,6 @@ use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200507\AbstractSpnegoContextTokenType; use SimpleSAML\WSSecurity\XML\sp_200507\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200507\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200507\Issuer; use SimpleSAML\WSSecurity\XML\sp_200507\SpnegoContextToken; use SimpleSAML\WSSecurity\XML\sp_200507\Type\IncludeTokenValue; @@ -40,7 +39,6 @@ */ #[Group('sp')] #[CoversClass(SpnegoContextToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractSpnegoContextTokenType::class)] #[CoversClass(AbstractSpElement::class)] final class SpnegoContextTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php b/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php index c9d1d12b..a6efba75 100644 --- a/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/HttpsTokenTest.php @@ -12,7 +12,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\HttpsToken; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; use SimpleSAML\XML\Chunk; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(HttpsToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class HttpsTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php b/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php index cdffe34c..1a551268 100644 --- a/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/KerberosTokenTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\KerberosToken; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(KerberosToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class KerberosTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/RelTokenTest.php b/tests/WSSecurity/XML/sp_200702/RelTokenTest.php index e59bfe3e..dff94fbd 100644 --- a/tests/WSSecurity/XML/sp_200702/RelTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/RelTokenTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\RelToken; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(RelToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class RelTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php b/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php index 9a4cad12..2ff00b0e 100644 --- a/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SamlTokenTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\SamlToken; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(SamlToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class SamlTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php b/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php index 23ea6f2f..68d2cb7c 100644 --- a/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/SecurityContextTokenTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\SecurityContextToken; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\XML\Attribute as XMLAttribute; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(SecurityContextToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class SecurityContextTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php b/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php index 02462958..d2ded2f6 100644 --- a/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/UsernameTokenTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\sp_200702\UsernameToken; use SimpleSAML\XML\Attribute as XMLAttribute; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(UsernameToken::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class UsernameTokenTest extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/WssX509Pkcs7Token10Test.php b/tests/WSSecurity/XML/sp_200702/WssX509Pkcs7Token10Test.php index 11679c27..1667a805 100644 --- a/tests/WSSecurity/XML/sp_200702/WssX509Pkcs7Token10Test.php +++ b/tests/WSSecurity/XML/sp_200702/WssX509Pkcs7Token10Test.php @@ -22,7 +22,7 @@ * @package simplesamlphp/ws-security */ #[Group('sp')] -#[CoversClass(WssX509Pkcs7Token10Test::class)] +#[CoversClass(WssX509Pkcs7Token10::class)] #[CoversClass(AbstractQNameAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class WssX509Pkcs7Token10Test extends TestCase diff --git a/tests/WSSecurity/XML/sp_200702/X509TokenTest.php b/tests/WSSecurity/XML/sp_200702/X509TokenTest.php index d05991d3..12d7563e 100644 --- a/tests/WSSecurity/XML/sp_200702/X509TokenTest.php +++ b/tests/WSSecurity/XML/sp_200702/X509TokenTest.php @@ -11,7 +11,6 @@ use SimpleSAML\WSSecurity\XML\sp_200702\AbstractSpElement; use SimpleSAML\WSSecurity\XML\sp_200702\AbstractTokenAssertionType; use SimpleSAML\WSSecurity\XML\sp_200702\IncludeToken; -use SimpleSAML\WSSecurity\XML\sp_200702\IncludeTokenTypeTrait; use SimpleSAML\WSSecurity\XML\sp_200702\Type\IncludeTokenValue; use SimpleSAML\WSSecurity\XML\sp_200702\X509Token; use SimpleSAML\XML\Attribute as XMLAttribute; @@ -30,7 +29,6 @@ */ #[Group('sp')] #[CoversClass(X509Token::class)] -#[CoversClass(IncludeTokenTypeTrait::class)] #[CoversClass(AbstractTokenAssertionType::class)] #[CoversClass(AbstractSpElement::class)] final class X509TokenTest extends TestCase