diff --git a/src/XML/element.registry.php b/src/XML/element.registry.php index 136e9970..96b40314 100644 --- a/src/XML/element.registry.php +++ b/src/XML/element.registry.php @@ -352,6 +352,55 @@ 'TransformationParameters' => '\SimpleSAML\WSSecurity\XML\wsse\TransformationParameters', 'UsernameToken' => '\SimpleSAML\WSSecurity\XML\wsse\UsernameToken', ], + 'http://schemas.xmlsoap.org/ws/2005/02/trust' => [ + 'AllowPostdating' => '\SimpleSAML\WSSecurity\XML\wst_200502\AllowPostdating', + 'AuthenticationType' => '\SimpleSAML\WSSecurity\XML\wst_200502\AuthenticationType', + 'Authenticator' => '\SimpleSAML\WSSecurity\XML\wst_200502\Authenticator', + 'BinaryExchange' => '\SimpleSAML\WSSecurity\XML\wst_200502\BinaryExchange', + 'BinarySecret' => '\SimpleSAML\WSSecurity\XML\wst_200502\BinarySecret', + 'CancelTarget' => '\SimpleSAML\WSSecurity\XML\wst_200502\CancelTarget', + 'CanonicalizationAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200502\CanonicalizationAlgorithm', + 'Challenge' => '\SimpleSAML\WSSecurity\XML\wst_200502\Challenge', + 'Claims' => '\SimpleSAML\WSSecurity\XML\wst_200502\Claims', + 'CombinedHash' => '\SimpleSAML\WSSecurity\XML\wst_200502\CombinedHash', + 'ComputedKey' => '\SimpleSAML\WSSecurity\XML\wst_200502\ComputedKey', + 'ComputedKeyAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200502\ComputedKeyAlgorithm', + 'Delegatable' => '\SimpleSAML\WSSecurity\XML\wst_200502\Delegatable', + 'DelegateTo' => '\SimpleSAML\WSSecurity\XML\wst_200502\DelegateTo', + 'EncryptWith' => '\SimpleSAML\WSSecurity\XML\wst_200502\EncryptWith', + 'Encryption' => '\SimpleSAML\WSSecurity\XML\wst_200502\Encryption', + 'EncryptionAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200502\EncryptionAlgorithm', + 'Entropy' => '\SimpleSAML\WSSecurity\XML\wst_200502\Entropy', + 'Forwardable' => '\SimpleSAML\WSSecurity\XML\wst_200502\Forwardable', + 'IssuedTokens' => '\SimpleSAML\WSSecurity\XML\wst_200502\IssuedTokens', + 'Issuer' => '\SimpleSAML\WSSecurity\XML\wst_200502\Issuer', + 'KeyExchangeToken' => '\SimpleSAML\WSSecurity\XML\wst_200502\KeyExchangeToken', + 'KeySize' => '\SimpleSAML\WSSecurity\XML\wst_200502\KeySize', + 'KeyType' => '\SimpleSAML\WSSecurity\XML\wst_200502\KeyType', + 'Lifetime' => '\SimpleSAML\WSSecurity\XML\wst_200502\Lifetime', + 'OnBehalfOf' => '\SimpleSAML\WSSecurity\XML\wst_200502\OnBehalfOf', + 'Participants' => '\SimpleSAML\WSSecurity\XML\wst_200502\Participants', + 'ProofEncryption' => '\SimpleSAML\WSSecurity\XML\wst_200502\ProofEncryption', + 'RenewTarget' => '\SimpleSAML\WSSecurity\XML\wst_200502\RenewTarget', + 'Renewing' => '\SimpleSAML\WSSecurity\XML\wst_200502\Renewing', + 'RequestKET' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestKET', + 'RequestSecurityToken' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityToken', + 'RequestSecurityTokenResponse' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityTokenResponse', + 'RequestSecurityTokenResponseCollection' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityTokenResponseCollection', + 'RequestType' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestType', + 'RequestedAttachedReference' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestedAttachedReference', + 'RequestedProofToken' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestedProofToken', + 'RequestedSecurityToken' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestedSecurityToken', + 'RequestedTokenCancelled' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestedTokenCancelled', + 'RequestedUnattachedReference' => '\SimpleSAML\WSSecurity\XML\wst_200502\RequestedUnattachedReference', + 'SignChallenge' => '\SimpleSAML\WSSecurity\XML\wst_200502\SignChallenge', + 'SignChallengeResponse' => '\SimpleSAML\WSSecurity\XML\wst_200502\SignChallengeResponse', + 'SignWith' => '\SimpleSAML\WSSecurity\XML\wst_200502\SignWith', + 'SignatureAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200502\SignatureAlgorithm', + 'Status' => '\SimpleSAML\WSSecurity\XML\wst_200502\Status', + 'TokenType' => '\SimpleSAML\WSSecurity\XML\wst_200502\TokenType', + 'UseKey' => '\SimpleSAML\WSSecurity\XML\wst_200502\UseKey', + ], 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/' => [ 'AllowPostdating' => '\SimpleSAML\WSSecurity\XML\wst_200512\AllowPostdating', 'AuthenticationType' => '\SimpleSAML\WSSecurity\XML\wst_200512\AuthenticationType', diff --git a/src/XML/wst_200502/AbstractAuthenticatorType.php b/src/XML/wst_200502/AbstractAuthenticatorType.php new file mode 100644 index 00000000..9ac9f436 --- /dev/null +++ b/src/XML/wst_200502/AbstractAuthenticatorType.php @@ -0,0 +1,106 @@ + $children + */ + final public function __construct( + protected ?CombinedHash $combinedHash = null, + array $children = [], + ) { + $this->setElements($children); + } + + + /** + * @return \SimpleSAML\WSSecurity\XML\wst_200502\CombinedHash|null + */ + public function getCombinedHash(): ?CombinedHash + { + return $this->combinedHash; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getCombinedHash()) + && empty($this->getElements()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $combinedHash = CombinedHash::getChildrenOfClass($xml); + + return new static( + array_pop($combinedHash), + self::getChildElementsFromXML($xml), + ); + } + + + /** + * Add this AuthenticatorType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + $this->getCombinedHash()?->toXML($e); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractBinaryExchangeType.php b/src/XML/wst_200502/AbstractBinaryExchangeType.php new file mode 100644 index 00000000..77131145 --- /dev/null +++ b/src/XML/wst_200502/AbstractBinaryExchangeType.php @@ -0,0 +1,114 @@ + $namespacedAttributes + */ + final public function __construct( + string $content, + protected string $valueType, + protected string $encodingType, + array $namespacedAttributes, + ) { + Assert::validURI($valueType, SchemaViolationException::class); + Assert::validURI($encodingType, SchemaViolationException::class); + + $this->setContent($content); + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * Get the valueType property. + * + * @return string + */ + public function getValueType(): string + { + return $this->valueType; + } + + + /** + * Get the valueType property. + * + * @return string + */ + public function getEncodingType(): string + { + return $this->encodingType; + } + + + /** + * 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( + $xml->textContent, + self::getAttribute($xml, 'ValueType'), + self::getAttribute($xml, 'EncodingType'), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * 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(); + + $e->setAttribute('ValueType', $this->getValueType()); + $e->setAttribute('EncodingType', $this->getEncodingType()); + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractBinarySecretType.php b/src/XML/wst_200502/AbstractBinarySecretType.php new file mode 100644 index 00000000..971e3a8b --- /dev/null +++ b/src/XML/wst_200502/AbstractBinarySecretType.php @@ -0,0 +1,116 @@ + $namespacedAttributes + */ + final public function __construct( + string $content, + ?array $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); + } + + + /** + * Get the Type property. + * + * @return string[]|null + */ + public function getType(): ?array + { + return $this->Type; + } + + + /** + * 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( + $xml->textContent, + explode(' ', self::getAttribute($xml, 'Type')), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * 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(); + + if ($this->getType() !== null) { + $e->setAttribute('Type', implode(' ', $this->getType())); + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractCancelTargetType.php b/src/XML/wst_200502/AbstractCancelTargetType.php new file mode 100644 index 00000000..0b118aa0 --- /dev/null +++ b/src/XML/wst_200502/AbstractCancelTargetType.php @@ -0,0 +1,85 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this CancelTargetType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractClaimsType.php b/src/XML/wst_200502/AbstractClaimsType.php new file mode 100644 index 00000000..e2333d83 --- /dev/null +++ b/src/XML/wst_200502/AbstractClaimsType.php @@ -0,0 +1,121 @@ + $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + */ + final public function __construct( + protected ?string $dialect = null, + array $children = [], + array $namespacedAttributes = [], + ) { + Assert::nullOrValidURI($dialect, SchemaViolationException::class); + + $this->setElements($children); + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * @return string|null + */ + public function getDialect(): ?string + { + return $this->dialect; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getDialect()) + && empty($this->getElements()) + && empty($this->getAttributesNS()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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( + self::getOptionalAttribute($xml, 'Dialect', null), + self::getChildElementsFromXML($xml), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * Add this ClaimsType to an XML element. + * + * @param \DOMElement $parent The element we should append this element to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + if ($this->getDialect() !== null) { + $e->setAttribute('Dialect', $this->getDialect()); + } + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php b/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php new file mode 100644 index 00000000..3f8c46c5 --- /dev/null +++ b/src/XML/wst_200502/AbstractComputedKeyOpenEnum.php @@ -0,0 +1,62 @@ +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)); + } +} diff --git a/src/XML/wst_200502/AbstractDelegateToType.php b/src/XML/wst_200502/AbstractDelegateToType.php new file mode 100644 index 00000000..26cdfc5c --- /dev/null +++ b/src/XML/wst_200502/AbstractDelegateToType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this DelegateToType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractEncryptionType.php b/src/XML/wst_200502/AbstractEncryptionType.php new file mode 100644 index 00000000..e8e3a287 --- /dev/null +++ b/src/XML/wst_200502/AbstractEncryptionType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this EncryptionType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractEntropyType.php b/src/XML/wst_200502/AbstractEntropyType.php new file mode 100644 index 00000000..e498287b --- /dev/null +++ b/src/XML/wst_200502/AbstractEntropyType.php @@ -0,0 +1,101 @@ + $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + */ + final public function __construct( + array $children = [], + array $namespacedAttributes = [], + ) { + $this->setElements($children); + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getElements()) + && empty($this->getAttributesNS()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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( + self::getChildElementsFromXML($xml), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * Add this EntropyType to an XML element. + * + * @param \DOMElement $parent The element we should append this element to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractKeyExchangeTokenType.php b/src/XML/wst_200502/AbstractKeyExchangeTokenType.php new file mode 100644 index 00000000..946616e9 --- /dev/null +++ b/src/XML/wst_200502/AbstractKeyExchangeTokenType.php @@ -0,0 +1,87 @@ + $children + */ + final public function __construct( + array $children = [], + ) { + $this->setElements($children); + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getElements()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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( + self::getChildElementsFromXML($xml), + ); + } + + + /** + * Add this KeyExchangeTokenType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php b/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php new file mode 100644 index 00000000..500eda7c --- /dev/null +++ b/src/XML/wst_200502/AbstractKeyTypeOpenEnum.php @@ -0,0 +1,62 @@ +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)); + } +} diff --git a/src/XML/wst_200502/AbstractLifetimeType.php b/src/XML/wst_200502/AbstractLifetimeType.php new file mode 100644 index 00000000..d96cfbd1 --- /dev/null +++ b/src/XML/wst_200502/AbstractLifetimeType.php @@ -0,0 +1,107 @@ +created; + } + + + /** + * @return \SimpleSAML\WSSecurity\XML\wsu\Expires|null + */ + public function getExpires(): ?Expires + { + return $this->expires; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getCreated()) + && empty($this->getExpires()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $created = Created::getChildrenOfClass($xml); + Assert::maxCount($created, 1, TooManyElementsException::class); + + $expires = Expires::getChildrenOfClass($xml); + Assert::maxCount($expires, 1, TooManyElementsException::class); + + + return new static( + array_pop($created), + array_pop($expires), + ); + } + + + /** + * Add this LifetimeType to an XML element. + * + * @param \DOMElement $parent The element we should append this element to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + $this->getCreated()?->toXML($e); + $this->getExpires()?->toXML($e); + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractOnBehalfOfType.php b/src/XML/wst_200502/AbstractOnBehalfOfType.php new file mode 100644 index 00000000..f47946a9 --- /dev/null +++ b/src/XML/wst_200502/AbstractOnBehalfOfType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this OnBehalfOfType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractParticipantType.php b/src/XML/wst_200502/AbstractParticipantType.php new file mode 100644 index 00000000..de40a4a1 --- /dev/null +++ b/src/XML/wst_200502/AbstractParticipantType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this ParticipantType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractParticipantsType.php b/src/XML/wst_200502/AbstractParticipantsType.php new file mode 100644 index 00000000..1b6140cf --- /dev/null +++ b/src/XML/wst_200502/AbstractParticipantsType.php @@ -0,0 +1,123 @@ + $participant + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + */ + final public function __construct( + protected ?Primary $primary = null, + protected array $participant = [], + array $children = [], + ) { + $this->setElements($children); + } + + + /** + * @return \SimpleSAML\WSSecurity\XML\wst_200502\Primary|null + */ + public function getPrimary(): ?Primary + { + return $this->primary; + } + + + /** + * @return \SimpleSAML\WSSecurity\XML\wst_200502\Participant[] + */ + public function getParticipant(): array + { + return $this->participant; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getPrimary()) + && empty($this->getParticipant()) + && empty($this->getElements()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $primary = Primary::getChildrenOfClass($xml); + Assert::maxCount($primary, 1, TooManyElementsException::class); + + return new static( + array_pop($primary), + Participant::getChildrenOfClass($xml), + self::getChildElementsFromXML($xml), + ); + } + + + /** + * Add this ParticipantsType to an XML element. + * + * @param \DOMElement $parent The element we should append this element to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + $this->getPrimary()?->toXML($e); + + foreach ($this->getParticipant() as $p) { + $p->toXML($e); + } + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractProofEncryptionType.php b/src/XML/wst_200502/AbstractProofEncryptionType.php new file mode 100644 index 00000000..a53dbf2b --- /dev/null +++ b/src/XML/wst_200502/AbstractProofEncryptionType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this ProofEncryptionType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRenewTargetType.php b/src/XML/wst_200502/AbstractRenewTargetType.php new file mode 100644 index 00000000..6c047e0b --- /dev/null +++ b/src/XML/wst_200502/AbstractRenewTargetType.php @@ -0,0 +1,85 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this RenewTargetType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRenewingType.php b/src/XML/wst_200502/AbstractRenewingType.php new file mode 100644 index 00000000..fe49ec04 --- /dev/null +++ b/src/XML/wst_200502/AbstractRenewingType.php @@ -0,0 +1,102 @@ +allow; + } + + + /** + * @return bool|null + */ + public function getOk(): ?bool + { + return $this->ok; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getAllow()) + && empty($this->getOk()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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( + self::getOptionalBooleanAttribute($xml, 'Allow', null), + self::getOptionalBooleanAttribute($xml, 'OK', null), + ); + } + + + /** + * Add this UseKeyType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + if ($this->getAllow() !== null) { + $e->setAttribute('Allow', $this->getAllow() ? 'true' : 'false'); + } + + if ($this->getOk() !== null) { + $e->setAttribute('OK', $this->getOk() ? 'true' : 'false'); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php new file mode 100644 index 00000000..33aae0b4 --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseCollectionType.php @@ -0,0 +1,99 @@ + $requestSecurityTokenResponse + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + */ + final public function __construct( + protected array $requestSecurityTokenResponse, + array $namespacedAttributes, + ) { + Assert::minCount($requestSecurityTokenResponse, 1, MissingElementException::class); + Assert::allIsInstanceOf( + $requestSecurityTokenResponse, + RequestSecurityTokenResponse::class, + SchemaViolationException::class, + ); + + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * Get the requestSecurityTokenResponse property. + * + * @return \SimpleSAML\WSSecurity\XML\wst_200502\RequestSecurityTokenResponse[] + */ + public function getRequestSecurityTokenResponse(): array + { + return $this->requestSecurityTokenResponse; + } + + + /** + * 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( + RequestSecurityTokenResponse::getChildrenOfClass($xml), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * 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); + + foreach ($this->getRequestSecurityTokenResponse() as $r) { + $r->toXML($e); + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php new file mode 100644 index 00000000..0c93349f --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestSecurityTokenResponseType.php @@ -0,0 +1,121 @@ + $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + */ + final public function __construct( + protected ?string $context = null, + array $children = [], + array $namespacedAttributes = [], + ) { + Assert::nullOrValidURI($context, SchemaViolationException::class); + + $this->setElements($children); + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * @return string|null + */ + public function getContext(): ?string + { + return $this->context; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getContext()) + && empty($this->getElements()) + && empty($this->getAttributesNS()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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( + self::getOptionalAttribute($xml, 'Context'), + self::getChildElementsFromXML($xml), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * Add this RequestSecurityTokenResponseType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + if ($this->getContext() !== null) { + $e->setAttribute('Context', $this->getContext()); + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRequestSecurityTokenType.php b/src/XML/wst_200502/AbstractRequestSecurityTokenType.php new file mode 100644 index 00000000..d088f0f7 --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestSecurityTokenType.php @@ -0,0 +1,123 @@ + $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + */ + final public function __construct( + protected ?string $context = null, + array $children = [], + array $namespacedAttributes = [], + ) { + Assert::nullOrValidURI($context, SchemaViolationException::class); + + $this->setElements($children); + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * @return string|null + */ + public function getContext(): ?string + { + return $this->context; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getContext()) + && empty($this->getElements()) + && empty($this->getAttributesNS()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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( + self::getOptionalAttribute($xml, 'Context'), + self::getChildElementsFromXML($xml), + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * Add this RequestSecurityTokenType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + if ($this->getContext() !== null) { + $e->setAttribute('Context', $this->getContext()); + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php b/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php new file mode 100644 index 00000000..f9c776df --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestTypeOpenEnum.php @@ -0,0 +1,62 @@ +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)); + } +} diff --git a/src/XML/wst_200502/AbstractRequestedProofTokenType.php b/src/XML/wst_200502/AbstractRequestedProofTokenType.php new file mode 100644 index 00000000..d83c6a69 --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestedProofTokenType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + ); + } + + + /** + * Add this RequestedProofTokenType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRequestedReferenceType.php b/src/XML/wst_200502/AbstractRequestedReferenceType.php new file mode 100644 index 00000000..3472225b --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestedReferenceType.php @@ -0,0 +1,81 @@ +securityTokenReference; + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $securityTokenReference = SecurityTokenReference::getChildrenOfClass($xml); + Assert::minCount($securityTokenReference, 1, MissingElementException::class); + Assert::maxCount($securityTokenReference, 1, TooManyElementsException::class); + + return new static(array_pop($securityTokenReference)); + } + + + /** + * Add this RequestedReferenceType to an XML element. + * + * @param \DOMElement $parent The element we should append this element to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + $this->getSecurityTokenReference()->toXML($e); + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php b/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php new file mode 100644 index 00000000..f6e4cbd6 --- /dev/null +++ b/src/XML/wst_200502/AbstractRequestedSecurityTokenType.php @@ -0,0 +1,83 @@ +setElements([$child]); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::minCount($children, 1, MissingElementException::class); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static(array_pop($children)); + } + + + /** + * Add this RequestedSecurityTokenType to an XML element. + * + * @param \DOMElement $parent The element we should append this element to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractSignChallengeType.php b/src/XML/wst_200502/AbstractSignChallengeType.php new file mode 100644 index 00000000..223338da --- /dev/null +++ b/src/XML/wst_200502/AbstractSignChallengeType.php @@ -0,0 +1,126 @@ + $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes + */ + final public function __construct( + protected ?Challenge $challenge = null, + array $children = [], + array $namespacedAttributes = [], + ) { + $this->setElements($children); + $this->setAttributesNS($namespacedAttributes); + } + + + /** + * @return \SimpleSAML\WSSecurity\XML\wst_200502\Challenge|null + */ + public function getChallenge(): ?Challenge + { + return $this->challenge; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getChallenge()) + && empty($this->getElements()) + && empty($this->getAttributesNS()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $challenge = Challenge::getChildrenOfClass($xml); + $children = self::getChildElementsFromXML($xml); + + return new static( + array_pop($challenge), + $children, + self::getAttributesNSFromXML($xml), + ); + } + + + /** + * Add this SignChallengeType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + $this->getChallenge()?->toXML($e); + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + foreach ($this->getAttributesNS() as $attr) { + $attr->toXML($e); + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php b/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php new file mode 100644 index 00000000..5d416bed --- /dev/null +++ b/src/XML/wst_200502/AbstractStatusCodeOpenEnum.php @@ -0,0 +1,62 @@ +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)); + } +} diff --git a/src/XML/wst_200502/AbstractStatusType.php b/src/XML/wst_200502/AbstractStatusType.php new file mode 100644 index 00000000..b4e823ea --- /dev/null +++ b/src/XML/wst_200502/AbstractStatusType.php @@ -0,0 +1,95 @@ +code; + } + + + /** + * @return \SimpleSAML\WSSecurity\XML\wst_200502\Reason|null + */ + public function getReason(): ?Reason + { + return $this->reason; + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $code = Code::getChildrenOfClass($xml); + Assert::minCount($code, 1, MissingElementException::class); + Assert::maxCount($code, 1, TooManyElementsException::class); + + $reason = Reason::getChildrenOfClass($xml); + Assert::maxCount($reason, 1, TooManyElementsException::class); + + + return new static( + array_pop($code), + array_pop($reason), + ); + } + + + /** + * Add this UseKeyType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + $this->getCode()->toXML($e); + $this->getReason()?->toXML($e); + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractUseKeyType.php b/src/XML/wst_200502/AbstractUseKeyType.php new file mode 100644 index 00000000..e5f5c989 --- /dev/null +++ b/src/XML/wst_200502/AbstractUseKeyType.php @@ -0,0 +1,114 @@ +setElements([$child]); + } + } + + + /** + * @return string|null + */ + public function getSig(): ?string + { + return $this->Sig; + } + + + /** + * Test if an object, at the state it's in, would produce an empty XML-element + * + * @return bool + */ + public function isEmptyElement(): bool + { + return empty($this->getSig()) + && empty($this->getElements()); + } + + + /** + * Create an instance of this object from its XML representation. + * + * @param \DOMElement $xml + * @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); + + $children = self::getChildElementsFromXML($xml); + Assert::maxCount($children, 1, TooManyElementsException::class); + + return new static( + array_pop($children), + self::getOptionalAttribute($xml, 'Sig', null), + ); + } + + + /** + * Add this UseKeyType to an XML element. + * + * @param \DOMElement $parent The element we should append this username token to. + * @return \DOMElement + */ + public function toXML(DOMElement $parent = null): DOMElement + { + $e = parent::instantiateParentElement($parent); + + if ($this->getSig() !== null) { + $e->setAttribute('Sig', $this->getSig()); + } + + foreach ($this->getElements() as $child) { + if (!$child->isEmptyElement()) { + $child->toXML($e); + } + } + + return $e; + } +} diff --git a/src/XML/wst_200502/AbstractWstElement.php b/src/XML/wst_200502/AbstractWstElement.php new file mode 100644 index 00000000..7156911f --- /dev/null +++ b/src/XML/wst_200502/AbstractWstElement.php @@ -0,0 +1,22 @@ +localName, static::getLocalName(), InvalidDOMElementException::class); + Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + + return new static(); + } + + + /** + * 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 + { + return $this->instantiateParentElement($parent); + } +} diff --git a/src/XML/wst_200502/AuthenticationType.php b/src/XML/wst_200502/AuthenticationType.php new file mode 100644 index 00000000..b164479e --- /dev/null +++ b/src/XML/wst_200502/AuthenticationType.php @@ -0,0 +1,26 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/Authenticator.php b/src/XML/wst_200502/Authenticator.php new file mode 100644 index 00000000..26ae8f7d --- /dev/null +++ b/src/XML/wst_200502/Authenticator.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/Challenge.php b/src/XML/wst_200502/Challenge.php new file mode 100644 index 00000000..0773f8f3 --- /dev/null +++ b/src/XML/wst_200502/Challenge.php @@ -0,0 +1,26 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/Claims.php b/src/XML/wst_200502/Claims.php new file mode 100644 index 00000000..296813bb --- /dev/null +++ b/src/XML/wst_200502/Claims.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/ComputedKey.php b/src/XML/wst_200502/ComputedKey.php new file mode 100644 index 00000000..e3b96ce8 --- /dev/null +++ b/src/XML/wst_200502/ComputedKey.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/ComputedKeyEnum.php b/src/XML/wst_200502/ComputedKeyEnum.php new file mode 100644 index 00000000..9b42e242 --- /dev/null +++ b/src/XML/wst_200502/ComputedKeyEnum.php @@ -0,0 +1,11 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/DelegateTo.php b/src/XML/wst_200502/DelegateTo.php new file mode 100644 index 00000000..86f3724e --- /dev/null +++ b/src/XML/wst_200502/DelegateTo.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/Encryption.php b/src/XML/wst_200502/Encryption.php new file mode 100644 index 00000000..4f158897 --- /dev/null +++ b/src/XML/wst_200502/Encryption.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/Entropy.php b/src/XML/wst_200502/Entropy.php new file mode 100644 index 00000000..6f32df6d --- /dev/null +++ b/src/XML/wst_200502/Entropy.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/IssuedTokens.php b/src/XML/wst_200502/IssuedTokens.php new file mode 100644 index 00000000..a734822f --- /dev/null +++ b/src/XML/wst_200502/IssuedTokens.php @@ -0,0 +1,14 @@ +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); + Assert::range($content, 0, 4294967295, SchemaViolationException::class); + } + + + /** + * 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($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; + } +} diff --git a/src/XML/wst_200502/KeyType.php b/src/XML/wst_200502/KeyType.php new file mode 100644 index 00000000..c7e965a1 --- /dev/null +++ b/src/XML/wst_200502/KeyType.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/RenewTarget.php b/src/XML/wst_200502/RenewTarget.php new file mode 100644 index 00000000..5c6ff994 --- /dev/null +++ b/src/XML/wst_200502/RenewTarget.php @@ -0,0 +1,14 @@ +localName, static::getLocalName(), InvalidDOMElementException::class); + Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + + return new static(); + } + + + /** + * 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 + { + return $this->instantiateParentElement($parent); + } +} diff --git a/src/XML/wst_200502/RequestSecurityToken.php b/src/XML/wst_200502/RequestSecurityToken.php new file mode 100644 index 00000000..52a12b0d --- /dev/null +++ b/src/XML/wst_200502/RequestSecurityToken.php @@ -0,0 +1,14 @@ +localName, static::getLocalName(), InvalidDOMElementException::class); + Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); + + return new static(); + } + + + /** + * 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 + { + return $this->instantiateParentElement($parent); + } +} diff --git a/src/XML/wst_200502/RequestedUnattachedReference.php b/src/XML/wst_200502/RequestedUnattachedReference.php new file mode 100644 index 00000000..db8523e1 --- /dev/null +++ b/src/XML/wst_200502/RequestedUnattachedReference.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/SignatureAlgorithm.php b/src/XML/wst_200502/SignatureAlgorithm.php new file mode 100644 index 00000000..d704ef1a --- /dev/null +++ b/src/XML/wst_200502/SignatureAlgorithm.php @@ -0,0 +1,26 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/Status.php b/src/XML/wst_200502/Status.php new file mode 100644 index 00000000..6f32e92f --- /dev/null +++ b/src/XML/wst_200502/Status.php @@ -0,0 +1,14 @@ +setContent($content); + } +} diff --git a/src/XML/wst_200502/UseKey.php b/src/XML/wst_200502/UseKey.php new file mode 100644 index 00000000..53a2b127 --- /dev/null +++ b/src/XML/wst_200502/UseKey.php @@ -0,0 +1,14 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($allowPostdating), + ); + } + + + /** + * Test creating an empty AllowPostdating object from scratch. + * + * NOTE: This element is empty per definition! + */ + public function testMarshallingEmpty(): void + { + $allowPostdating = new AllowPostdating(); + $this->assertFalse($allowPostdating->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php b/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php new file mode 100644 index 00000000..cb12750a --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/AuthenticationTypeTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($authenticationType), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php b/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php new file mode 100644 index 00000000..8cbe4699 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php @@ -0,0 +1,82 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($authenticator), + ); + } + + + /** + * Test creating an empty Authenticator object from scratch. + */ + public function testMarshallingEmpty(): void + { + $authenticator = new Authenticator(); + + $this->assertTrue($authenticator->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php b/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php new file mode 100644 index 00000000..f60a37ca --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/BinaryExchangeTest.php @@ -0,0 +1,66 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($binaryExchange), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php b/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php new file mode 100644 index 00000000..4bb4b80c --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/BinarySecretTest.php @@ -0,0 +1,72 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($binarySecret), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php b/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php new file mode 100644 index 00000000..9aa39757 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/CancelTargetTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($cancelTarget), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php new file mode 100644 index 00000000..914b28c0 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/CanonicalizationAlgorithmTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($canonicalizationAlgorithm), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ChallengeTest.php b/tests/WSSecurity/XML/wst_200502/ChallengeTest.php new file mode 100644 index 00000000..000bcb8b --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ChallengeTest.php @@ -0,0 +1,61 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($challenge), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ClaimsTest.php b/tests/WSSecurity/XML/wst_200502/ClaimsTest.php new file mode 100644 index 00000000..786e1bc4 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ClaimsTest.php @@ -0,0 +1,82 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($claims), + ); + } + + + /** + * Test creating an empty Claims object from scratch. + */ + public function testMarshallingEmpty(): void + { + $claims = new Claims(); + + $this->assertTrue($claims->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/CodeTest.php b/tests/WSSecurity/XML/wst_200502/CodeTest.php new file mode 100644 index 00000000..31b8d4f3 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/CodeTest.php @@ -0,0 +1,60 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($code), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php b/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php new file mode 100644 index 00000000..4a26667b --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/CombinedHashTest.php @@ -0,0 +1,61 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($combinedHash), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php new file mode 100644 index 00000000..17e35bf3 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ComputedKeyAlgorithmTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($computedKeyAlgorithm), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php b/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php new file mode 100644 index 00000000..2ed60b88 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ComputedKeyTest.php @@ -0,0 +1,64 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($computedKey), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/DelegatableTest.php b/tests/WSSecurity/XML/wst_200502/DelegatableTest.php new file mode 100644 index 00000000..7f35761d --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/DelegatableTest.php @@ -0,0 +1,61 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($delegatable), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/DelegateToTest.php b/tests/WSSecurity/XML/wst_200502/DelegateToTest.php new file mode 100644 index 00000000..2f6810e2 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/DelegateToTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($delegateTo), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php b/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php new file mode 100644 index 00000000..a6f77f3f --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/EncryptWithTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($encryptWith), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php new file mode 100644 index 00000000..a7536aa8 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/EncryptionAlgorithmTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($encryptionAlgorithm), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/EncryptionTest.php b/tests/WSSecurity/XML/wst_200502/EncryptionTest.php new file mode 100644 index 00000000..68391f4b --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/EncryptionTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($encryption), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/EntropyTest.php b/tests/WSSecurity/XML/wst_200502/EntropyTest.php new file mode 100644 index 00000000..9972026d --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/EntropyTest.php @@ -0,0 +1,82 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($entropy), + ); + } + + + /** + * Test creating an empty Entropy object from scratch. + */ + public function testMarshallingEmpty(): void + { + $entropy = new Entropy(); + + $this->assertTrue($entropy->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ForwardableTest.php b/tests/WSSecurity/XML/wst_200502/ForwardableTest.php new file mode 100644 index 00000000..065cfa1e --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ForwardableTest.php @@ -0,0 +1,61 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($forwardable), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php b/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php new file mode 100644 index 00000000..1d8203b5 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php @@ -0,0 +1,78 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($issuedTokens), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/IssuerTest.php b/tests/WSSecurity/XML/wst_200502/IssuerTest.php new file mode 100644 index 00000000..58709364 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/IssuerTest.php @@ -0,0 +1,102 @@ +Pears', + )->documentElement; + + self::$metadataContent = DOMDocumentFactory::fromString( + 'Apples', + )->documentElement; + + self::$customContent = DOMDocumentFactory::fromString( + 'SomeChunk', + )->documentElement; + } + + + // test marshalling + + + /** + * Test creating an Issuer object from scratch. + */ + 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'); + + $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]), + $referenceParameters, + $metadata, + [$chunk], + [$attr1], + ); + + $this->assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($issuer), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php b/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php new file mode 100644 index 00000000..a2e0788a --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php @@ -0,0 +1,80 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($keyExchangeToken), + ); + } + + + /** + * Test creating an empty KeyExchangeToken object from scratch. + */ + public function testMarshallingEmpty(): void + { + $keyExchangeToken = new KeyExchangeToken(); + + $this->assertTrue($keyExchangeToken->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/KeySizeTest.php b/tests/WSSecurity/XML/wst_200502/KeySizeTest.php new file mode 100644 index 00000000..6d590962 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/KeySizeTest.php @@ -0,0 +1,61 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($keySize), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php b/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php new file mode 100644 index 00000000..c0d29bcc --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/KeyTypeTest.php @@ -0,0 +1,64 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($keyType), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/LifetimeTest.php b/tests/WSSecurity/XML/wst_200502/LifetimeTest.php new file mode 100644 index 00000000..7b8a1483 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/LifetimeTest.php @@ -0,0 +1,79 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($lifetime), + ); + } + + + /** + * Test creating an empty Lifetime object from scratch. + */ + public function testMarshallingEmpty(): void + { + $lifetime = new Lifetime(); + + $this->assertTrue($lifetime->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php b/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php new file mode 100644 index 00000000..88774311 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($onBehalfOf), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ParticipantTest.php b/tests/WSSecurity/XML/wst_200502/ParticipantTest.php new file mode 100644 index 00000000..fce43df8 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ParticipantTest.php @@ -0,0 +1,65 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($participant), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php b/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php new file mode 100644 index 00000000..b3e0f7cd --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ParticipantsTest.php @@ -0,0 +1,89 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($participants), + ); + } + + + /** + * Adding an empty Participants element should yield an empty element. + */ + public function testMarshallingEmptyElement(): void + { + $wstns = C::NS_TRUST_200502; + $participants = new Participants(); + $this->assertEquals( + "", + strval($participants), + ); + $this->assertTrue($participants->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/PrimaryTest.php b/tests/WSSecurity/XML/wst_200502/PrimaryTest.php new file mode 100644 index 00000000..eea202a1 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/PrimaryTest.php @@ -0,0 +1,65 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($primary), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php b/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php new file mode 100644 index 00000000..3b1e15f5 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ProofEncryptionTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($proofEncryption), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/ReasonTest.php b/tests/WSSecurity/XML/wst_200502/ReasonTest.php new file mode 100644 index 00000000..8ee6987b --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/ReasonTest.php @@ -0,0 +1,57 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($reason), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php b/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php new file mode 100644 index 00000000..03e97983 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RenewTargetTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($renewTarget), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RenewingTest.php b/tests/WSSecurity/XML/wst_200502/RenewingTest.php new file mode 100644 index 00000000..2f61f1f5 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RenewingTest.php @@ -0,0 +1,74 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($renewing), + ); + } + + + /** + * Test creating an empty Renewing object from scratch. + */ + public function testMarshallingEmpty(): void + { + $renewing = new Renewing(); + + $this->assertTrue($renewing->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestKETTest.php b/tests/WSSecurity/XML/wst_200502/RequestKETTest.php new file mode 100644 index 00000000..0be9613a --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestKETTest.php @@ -0,0 +1,73 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestKET), + ); + } + + + /** + * Test creating an empty RequestKET object from scratch. + * + * NOTE: This element is empty per definition! + */ + public function testMarshallingEmpty(): void + { + $requestKET = new RequestKET(); + $this->assertFalse($requestKET->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php new file mode 100644 index 00000000..b1a3adfc --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseCollectionTest.php @@ -0,0 +1,78 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestSecurityTokenResponseCollection), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php new file mode 100644 index 00000000..54f511f2 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenResponseTest.php @@ -0,0 +1,82 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($RequestSecurityTokenResponse), + ); + } + + + /** + * Test creating an empty RequestSecurityTokenResponse object from scratch. + */ + public function testMarshallingEmpty(): void + { + $RequestSecurityTokenResponse = new RequestSecurityTokenResponse(); + + $this->assertTrue($RequestSecurityTokenResponse->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php new file mode 100644 index 00000000..ab635bc6 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestSecurityTokenTest.php @@ -0,0 +1,82 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($RequestSecurityToken), + ); + } + + + /** + * Test creating an empty RequestSecurityToken object from scratch. + */ + public function testMarshallingEmpty(): void + { + $RequestSecurityToken = new RequestSecurityToken(); + + $this->assertTrue($RequestSecurityToken->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php b/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php new file mode 100644 index 00000000..933cd1b8 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestTypeTest.php @@ -0,0 +1,64 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestType), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php b/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php new file mode 100644 index 00000000..bdc2b463 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestedAttachedReferenceTest.php @@ -0,0 +1,78 @@ +SomeChunk', + ); + + $securityTokenReference = new SecurityTokenReference( + 'SomeID', + 'SomeUsage', + [new Chunk($child->documentElement)], + [$attr1], + ); + + $requestedAttachedReference = new RequestedAttachedReference($securityTokenReference); + + $this->assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestedAttachedReference), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php new file mode 100644 index 00000000..ecd8b9a8 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestedProofTokenTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestedProofToken), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php b/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php new file mode 100644 index 00000000..7e791532 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestedSecurityTokenTest.php @@ -0,0 +1,69 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestedSecurityToken), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestedTokenCancelledTest.php b/tests/WSSecurity/XML/wst_200502/RequestedTokenCancelledTest.php new file mode 100644 index 00000000..bf13f631 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestedTokenCancelledTest.php @@ -0,0 +1,73 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestedTokenCancelled), + ); + } + + + /** + * Test creating an empty RequestedTokenCancelled object from scratch. + * + * NOTE: This element is empty per definition! + */ + public function testMarshallingEmpty(): void + { + $requestedTokenCancelled = new RequestedTokenCancelled(); + $this->assertFalse($requestedTokenCancelled->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php b/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php new file mode 100644 index 00000000..24c238bb --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/RequestedUnattachedReferenceTest.php @@ -0,0 +1,78 @@ +SomeChunk', + ); + + $securityTokenReference = new SecurityTokenReference( + 'SomeID', + 'SomeUsage', + [new Chunk($child->documentElement)], + [$attr1], + ); + + $requestedUnattachedReference = new RequestedUnattachedReference($securityTokenReference); + + $this->assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($requestedUnattachedReference), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php b/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php new file mode 100644 index 00000000..86445fc7 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/SignChallengeResponseTest.php @@ -0,0 +1,74 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($signChallengeResponse), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php b/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php new file mode 100644 index 00000000..6c5b54f6 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/SignChallengeTest.php @@ -0,0 +1,84 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($signChallenge), + ); + } + + + /** + * Test creating an empty SignChallenge object from scratch. + */ + public function testMarshallingEmpty(): void + { + $signChallenge = new SignChallenge(); + + $this->assertTrue($signChallenge->isEmptyElement()); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/SignWithTest.php b/tests/WSSecurity/XML/wst_200502/SignWithTest.php new file mode 100644 index 00000000..bcb8f67a --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/SignWithTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($signWith), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php b/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php new file mode 100644 index 00000000..024c7781 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/SignatureAlgorithmTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($signatureAlgorithm), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/StatusTest.php b/tests/WSSecurity/XML/wst_200502/StatusTest.php new file mode 100644 index 00000000..765889c5 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/StatusTest.php @@ -0,0 +1,68 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($status), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php b/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php new file mode 100644 index 00000000..af796ab4 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/TokenTypeTest.php @@ -0,0 +1,62 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($tokenType), + ); + } +} diff --git a/tests/WSSecurity/XML/wst_200502/UseKeyTest.php b/tests/WSSecurity/XML/wst_200502/UseKeyTest.php new file mode 100644 index 00000000..7a987930 --- /dev/null +++ b/tests/WSSecurity/XML/wst_200502/UseKeyTest.php @@ -0,0 +1,81 @@ +assertEquals( + self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), + strval($useKey), + ); + } + + + /** + * Test creating an empty UseKey object from scratch. + */ + public function testMarshallingEmpty(): void + { + $useKey = new UseKey(); + + $this->assertTrue($useKey->isEmptyElement()); + } +} diff --git a/tests/resources/xml/wst/200502/AllowPostdating.xml b/tests/resources/xml/wst/200502/AllowPostdating.xml new file mode 100644 index 00000000..669a25a2 --- /dev/null +++ b/tests/resources/xml/wst/200502/AllowPostdating.xml @@ -0,0 +1 @@ + diff --git a/tests/resources/xml/wst/200502/AuthenticationType.xml b/tests/resources/xml/wst/200502/AuthenticationType.xml new file mode 100644 index 00000000..df963aa1 --- /dev/null +++ b/tests/resources/xml/wst/200502/AuthenticationType.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/Authenticator.xml b/tests/resources/xml/wst/200502/Authenticator.xml new file mode 100644 index 00000000..a837cfce --- /dev/null +++ b/tests/resources/xml/wst/200502/Authenticator.xml @@ -0,0 +1,4 @@ + + /CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/BinaryExchange.xml b/tests/resources/xml/wst/200502/BinaryExchange.xml new file mode 100644 index 00000000..c8fdb0ea --- /dev/null +++ b/tests/resources/xml/wst/200502/BinaryExchange.xml @@ -0,0 +1 @@ +phpunit diff --git a/tests/resources/xml/wst/200502/BinarySecret.xml b/tests/resources/xml/wst/200502/BinarySecret.xml new file mode 100644 index 00000000..69ea1d42 --- /dev/null +++ b/tests/resources/xml/wst/200502/BinarySecret.xml @@ -0,0 +1 @@ +/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= diff --git a/tests/resources/xml/wst/200502/CancelTarget.xml b/tests/resources/xml/wst/200502/CancelTarget.xml new file mode 100644 index 00000000..b4add4ad --- /dev/null +++ b/tests/resources/xml/wst/200502/CancelTarget.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/CanonicalizationAlgorithm.xml b/tests/resources/xml/wst/200502/CanonicalizationAlgorithm.xml new file mode 100644 index 00000000..179ed95d --- /dev/null +++ b/tests/resources/xml/wst/200502/CanonicalizationAlgorithm.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/Challenge.xml b/tests/resources/xml/wst/200502/Challenge.xml new file mode 100644 index 00000000..f75db88e --- /dev/null +++ b/tests/resources/xml/wst/200502/Challenge.xml @@ -0,0 +1 @@ +accepted diff --git a/tests/resources/xml/wst/200502/Claims.xml b/tests/resources/xml/wst/200502/Claims.xml new file mode 100644 index 00000000..6fcc5d27 --- /dev/null +++ b/tests/resources/xml/wst/200502/Claims.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/Code.xml b/tests/resources/xml/wst/200502/Code.xml new file mode 100644 index 00000000..adeef3a1 --- /dev/null +++ b/tests/resources/xml/wst/200502/Code.xml @@ -0,0 +1 @@ +http://schemas.xmlsoap.org/ws/2005/02/trust/status/invalid diff --git a/tests/resources/xml/wst/200502/CombinedHash.xml b/tests/resources/xml/wst/200502/CombinedHash.xml new file mode 100644 index 00000000..c0d7fa01 --- /dev/null +++ b/tests/resources/xml/wst/200502/CombinedHash.xml @@ -0,0 +1 @@ +/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= diff --git a/tests/resources/xml/wst/200502/ComputedKey.xml b/tests/resources/xml/wst/200502/ComputedKey.xml new file mode 100644 index 00000000..04362a4d --- /dev/null +++ b/tests/resources/xml/wst/200502/ComputedKey.xml @@ -0,0 +1 @@ +http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1 diff --git a/tests/resources/xml/wst/200502/ComputedKeyAlgorithm.xml b/tests/resources/xml/wst/200502/ComputedKeyAlgorithm.xml new file mode 100644 index 00000000..b78220ba --- /dev/null +++ b/tests/resources/xml/wst/200502/ComputedKeyAlgorithm.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/Delegatable.xml b/tests/resources/xml/wst/200502/Delegatable.xml new file mode 100644 index 00000000..6d969188 --- /dev/null +++ b/tests/resources/xml/wst/200502/Delegatable.xml @@ -0,0 +1 @@ +true diff --git a/tests/resources/xml/wst/200502/DelegateTo.xml b/tests/resources/xml/wst/200502/DelegateTo.xml new file mode 100644 index 00000000..f070ba25 --- /dev/null +++ b/tests/resources/xml/wst/200502/DelegateTo.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/EncryptWith.xml b/tests/resources/xml/wst/200502/EncryptWith.xml new file mode 100644 index 00000000..a153980d --- /dev/null +++ b/tests/resources/xml/wst/200502/EncryptWith.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/Encryption.xml b/tests/resources/xml/wst/200502/Encryption.xml new file mode 100644 index 00000000..a05a1852 --- /dev/null +++ b/tests/resources/xml/wst/200502/Encryption.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/EncryptionAlgorithm.xml b/tests/resources/xml/wst/200502/EncryptionAlgorithm.xml new file mode 100644 index 00000000..06447dd1 --- /dev/null +++ b/tests/resources/xml/wst/200502/EncryptionAlgorithm.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/Entropy.xml b/tests/resources/xml/wst/200502/Entropy.xml new file mode 100644 index 00000000..1555a08e --- /dev/null +++ b/tests/resources/xml/wst/200502/Entropy.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/Forwardable.xml b/tests/resources/xml/wst/200502/Forwardable.xml new file mode 100644 index 00000000..06dbe3e3 --- /dev/null +++ b/tests/resources/xml/wst/200502/Forwardable.xml @@ -0,0 +1 @@ +true diff --git a/tests/resources/xml/wst/200502/IssuedTokens.xml b/tests/resources/xml/wst/200502/IssuedTokens.xml new file mode 100644 index 00000000..9240bfab --- /dev/null +++ b/tests/resources/xml/wst/200502/IssuedTokens.xml @@ -0,0 +1,5 @@ + + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + diff --git a/tests/resources/xml/wst/200502/Issuer.xml b/tests/resources/xml/wst/200502/Issuer.xml new file mode 100644 index 00000000..36455907 --- /dev/null +++ b/tests/resources/xml/wst/200502/Issuer.xml @@ -0,0 +1,14 @@ + + https://login.microsoftonline.com/login.srf + + + Pears + + + + + Apples + + + SomeChunk + diff --git a/tests/resources/xml/wst/200502/KeyExchangeToken.xml b/tests/resources/xml/wst/200502/KeyExchangeToken.xml new file mode 100644 index 00000000..a7e7b89b --- /dev/null +++ b/tests/resources/xml/wst/200502/KeyExchangeToken.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/KeySize.xml b/tests/resources/xml/wst/200502/KeySize.xml new file mode 100644 index 00000000..274337dc --- /dev/null +++ b/tests/resources/xml/wst/200502/KeySize.xml @@ -0,0 +1 @@ +4096 diff --git a/tests/resources/xml/wst/200502/KeyType.xml b/tests/resources/xml/wst/200502/KeyType.xml new file mode 100644 index 00000000..78d3bfb8 --- /dev/null +++ b/tests/resources/xml/wst/200502/KeyType.xml @@ -0,0 +1 @@ +http://schemas.xmlsoap.org/ws/2005/02/trust/PublicKey diff --git a/tests/resources/xml/wst/200502/Lifetime.xml b/tests/resources/xml/wst/200502/Lifetime.xml new file mode 100644 index 00000000..4e68c2eb --- /dev/null +++ b/tests/resources/xml/wst/200502/Lifetime.xml @@ -0,0 +1,4 @@ + + 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 new file mode 100644 index 00000000..06842b29 --- /dev/null +++ b/tests/resources/xml/wst/200502/OnBehalfOf.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/Participant.xml b/tests/resources/xml/wst/200502/Participant.xml new file mode 100644 index 00000000..e404f832 --- /dev/null +++ b/tests/resources/xml/wst/200502/Participant.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/Participants.xml b/tests/resources/xml/wst/200502/Participants.xml new file mode 100644 index 00000000..c84e3ba3 --- /dev/null +++ b/tests/resources/xml/wst/200502/Participants.xml @@ -0,0 +1,9 @@ + + + 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 new file mode 100644 index 00000000..f2a2daf4 --- /dev/null +++ b/tests/resources/xml/wst/200502/Primary.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/ProofEncryption.xml b/tests/resources/xml/wst/200502/ProofEncryption.xml new file mode 100644 index 00000000..bf99fe41 --- /dev/null +++ b/tests/resources/xml/wst/200502/ProofEncryption.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/Reason.xml b/tests/resources/xml/wst/200502/Reason.xml new file mode 100644 index 00000000..011f8386 --- /dev/null +++ b/tests/resources/xml/wst/200502/Reason.xml @@ -0,0 +1 @@ +phpunit diff --git a/tests/resources/xml/wst/200502/RenewTarget.xml b/tests/resources/xml/wst/200502/RenewTarget.xml new file mode 100644 index 00000000..76b10231 --- /dev/null +++ b/tests/resources/xml/wst/200502/RenewTarget.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/Renewing.xml b/tests/resources/xml/wst/200502/Renewing.xml new file mode 100644 index 00000000..b2baba1f --- /dev/null +++ b/tests/resources/xml/wst/200502/Renewing.xml @@ -0,0 +1 @@ + diff --git a/tests/resources/xml/wst/200502/RequestKET.xml b/tests/resources/xml/wst/200502/RequestKET.xml new file mode 100644 index 00000000..6f9aac69 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestKET.xml @@ -0,0 +1 @@ + diff --git a/tests/resources/xml/wst/200502/RequestSecurityToken.xml b/tests/resources/xml/wst/200502/RequestSecurityToken.xml new file mode 100644 index 00000000..33d0d05f --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestSecurityToken.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml b/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml new file mode 100644 index 00000000..2b9b11c2 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestSecurityTokenResponse.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml b/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml new file mode 100644 index 00000000..b17babed --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestSecurityTokenResponseCollection.xml @@ -0,0 +1,5 @@ + + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + + diff --git a/tests/resources/xml/wst/200502/RequestType.xml b/tests/resources/xml/wst/200502/RequestType.xml new file mode 100644 index 00000000..93388f88 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestType.xml @@ -0,0 +1 @@ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue diff --git a/tests/resources/xml/wst/200502/RequestedAttachedReference.xml b/tests/resources/xml/wst/200502/RequestedAttachedReference.xml new file mode 100644 index 00000000..e8b56c33 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestedAttachedReference.xml @@ -0,0 +1,5 @@ + + + SomeChunk + + diff --git a/tests/resources/xml/wst/200502/RequestedProofToken.xml b/tests/resources/xml/wst/200502/RequestedProofToken.xml new file mode 100644 index 00000000..6fc7b986 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestedProofToken.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/RequestedSecurityToken.xml b/tests/resources/xml/wst/200502/RequestedSecurityToken.xml new file mode 100644 index 00000000..ea5080b1 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestedSecurityToken.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/RequestedTokenCancelled.xml b/tests/resources/xml/wst/200502/RequestedTokenCancelled.xml new file mode 100644 index 00000000..888f5975 --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestedTokenCancelled.xml @@ -0,0 +1 @@ + diff --git a/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml b/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml new file mode 100644 index 00000000..3d44296c --- /dev/null +++ b/tests/resources/xml/wst/200502/RequestedUnattachedReference.xml @@ -0,0 +1,5 @@ + + + SomeChunk + + diff --git a/tests/resources/xml/wst/200502/SignChallenge.xml b/tests/resources/xml/wst/200502/SignChallenge.xml new file mode 100644 index 00000000..b0dcf186 --- /dev/null +++ b/tests/resources/xml/wst/200502/SignChallenge.xml @@ -0,0 +1,4 @@ + + accepted + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/SignChallengeResponse.xml b/tests/resources/xml/wst/200502/SignChallengeResponse.xml new file mode 100644 index 00000000..dd084297 --- /dev/null +++ b/tests/resources/xml/wst/200502/SignChallengeResponse.xml @@ -0,0 +1,4 @@ + + accepted + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de + diff --git a/tests/resources/xml/wst/200502/SignWith.xml b/tests/resources/xml/wst/200502/SignWith.xml new file mode 100644 index 00000000..41cbe72f --- /dev/null +++ b/tests/resources/xml/wst/200502/SignWith.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/SignatureAlgorithm.xml b/tests/resources/xml/wst/200502/SignatureAlgorithm.xml new file mode 100644 index 00000000..6c304aff --- /dev/null +++ b/tests/resources/xml/wst/200502/SignatureAlgorithm.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/Status.xml b/tests/resources/xml/wst/200502/Status.xml new file mode 100644 index 00000000..753c438c --- /dev/null +++ b/tests/resources/xml/wst/200502/Status.xml @@ -0,0 +1,4 @@ + + http://schemas.xmlsoap.org/ws/2005/02/trust/status/invalid + phpunit + diff --git a/tests/resources/xml/wst/200502/TokenType.xml b/tests/resources/xml/wst/200502/TokenType.xml new file mode 100644 index 00000000..c5890edd --- /dev/null +++ b/tests/resources/xml/wst/200502/TokenType.xml @@ -0,0 +1 @@ +urn:x-simplesamlphp:namespace diff --git a/tests/resources/xml/wst/200502/UseKey.xml b/tests/resources/xml/wst/200502/UseKey.xml new file mode 100644 index 00000000..7bbd65c8 --- /dev/null +++ b/tests/resources/xml/wst/200502/UseKey.xml @@ -0,0 +1,3 @@ + + uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de +