Skip to content

Commit

Permalink
Add wst classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jan 23, 2024
1 parent 7f864a3 commit 8f7ff11
Show file tree
Hide file tree
Showing 115 changed files with 1,963 additions and 377 deletions.
545 changes: 269 additions & 276 deletions resources/schemas/ws-trust.xsd

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Constants extends \SimpleSAML\SAML2\Constants
/**
* The namespace for WS-Trust protocol.
*/
public const NS_TRUST = 'http://schemas.xmlsoap.org/ws/2005/02/trust';
public const NS_TRUST = 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/';

/**
* The namespace for WS-Security extensions.
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractAssertionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractClientPseudonymType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;

use function array_pop;
Expand Down
3 changes: 0 additions & 3 deletions src/XML/fed/AbstractFederationMetadataHandlerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\WSSecurity\XML\auth\ClaimType;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\XsNamespace as NS;

Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractFederationMetadataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractFederationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
3 changes: 0 additions & 3 deletions src/XML/fed/AbstractFilterPseudonymsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
Expand Down
3 changes: 1 addition & 2 deletions src/XML/fed/AbstractFreshnessType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\StringElementTrait;
use SimpleSAML\XML\XsNamespace as NS;

Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractProofTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
use SimpleSAML\XML\XsNamespace as NS;

Expand Down
1 change: 0 additions & 1 deletion src/XML/fed/AbstractPseudonymBasisType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
Expand Down
2 changes: 0 additions & 2 deletions src/XML/fed/AbstractPseudonymType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

namespace SimpleSAML\WSSecurity\XML\fed;

use DateTimeImmutable;
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\wsu\Expires;
use SimpleSAML\XML\Attribute as XMLAttribute;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
Expand Down
2 changes: 0 additions & 2 deletions src/XML/fed/AbstractRelativeToType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractRequestProofTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/XML/fed/AbstractRequestPseudonymType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractSecurityTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
use SimpleSAML\XML\XsNamespace as NS;

Expand Down
2 changes: 0 additions & 2 deletions src/XML/fed/AbstractSignOutType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\wsu\Expires;
use SimpleSAML\XML\Attribute as XMLAttribute;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
Expand Down
1 change: 0 additions & 1 deletion src/XML/fed/AbstractWebServiceDescriptorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use DateTimeImmutable;
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\XML\md\AbstractRoleDescriptorType;
use SimpleSAML\SAML2\XML\md\Extensions;
use SimpleSAML\SAML2\XML\md\Organization;
Expand Down
2 changes: 1 addition & 1 deletion src/XML/wsa/AbstractAttributedLongType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final public function __construct(string $value, array $namespacedAttributes = [
* Validate the content of the element.
*
* @param string $content The value to go in the XML textContent
* @throws \SimpleSAML\WSSecurity\Exception\ProtocolViolationException on failure
* @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure
* @return void
*/
protected function validateContent(string $content): void
Expand Down
1 change: 0 additions & 1 deletion src/XML/wsa/AbstractAttributedQNameType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\QNameElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
Expand Down
1 change: 0 additions & 1 deletion src/XML/wsa/AbstractAttributedURIType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\URIElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
Expand Down
1 change: 0 additions & 1 deletion src/XML/wsa/SoapAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\URIElementTrait;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/XML/wst/AbstractParticipantType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\XsNamespace as NS;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
use SimpleSAML\XML\XsNamespace as NS;

/**
* Class defining the ParticipantType element
Expand Down
3 changes: 1 addition & 2 deletions src/XML/wst/AbstractParticipantsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use SimpleSAML\XML\SerializableElementInterface;

/**
* Class defining the ParticipantsType element
Expand Down
46 changes: 46 additions & 0 deletions src/XML/wst/AllowPostdating.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;

/**
* A AllowPostdating element
*
* @package tvdijen/ws-security
*/
final class AllowPostdating extends AbstractWstElement
{
/**
* 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();
}


/**
* 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);
}
}
26 changes: 26 additions & 0 deletions src/XML/wst/AuthenticationType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;

use SimpleSAML\XML\URIElementTrait;

/**
* A AuthenticationType element
*
* @package tvdijen/ws-security
*/
final class AuthenticationType extends AbstractWstElement
{
use URIElementTrait;


/**
* @param string $content
*/
public function __construct(string $content)
{
$this->setContent($content);
}
}
12 changes: 12 additions & 0 deletions src/XML/wst/BinarySecretTypeEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;

enum BinarySecretTypeEnum: string
{
case Asymmetric = 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/AsymmetricKey';
case Nonce = 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce';
case Symmetric = 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey';
}
26 changes: 26 additions & 0 deletions src/XML/wst/CanonicalizationAlgorithm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;

use SimpleSAML\XML\URIElementTrait;

/**
* A CanonicalizationAlgorithm element
*
* @package tvdijen/ws-security
*/
final class CanonicalizationAlgorithm extends AbstractWstElement
{
use URIElementTrait;


/**
* @param string $content
*/
public function __construct(string $content)
{
$this->setContent($content);
}
}
26 changes: 26 additions & 0 deletions src/XML/wst/Challenge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;

use SimpleSAML\XML\StringElementTrait;

/**
* A Challenge element
*
* @package tvdijen/ws-security
*/
final class Challenge extends AbstractWstElement
{
use StringElementTrait;


/**
* @param string $content
*/
public function __construct(string $content)
{
$this->setContent($content);
}
}
Loading

0 comments on commit 8f7ff11

Please sign in to comment.