Skip to content

Commit

Permalink
Refactor ws-trust
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 24, 2024
1 parent 4c710fd commit 5830721
Show file tree
Hide file tree
Showing 209 changed files with 987 additions and 544 deletions.
451 changes: 451 additions & 0 deletions resources/schemas/ws-trust-200502.xsd

Large diffs are not rendered by default.

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

/**
* The namespace for WS-Security extensions.
Expand Down
3 changes: 2 additions & 1 deletion src/Utils/XPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public static function getXPath(DOMNode $node): DOMXPath
$xp->registerNamespace('wsa', C::NS_ADDR_200408);
$xp->registerNamespace('auth', C::NS_AUTH);
$xp->registerNamespace('fed', C::NS_FED);
$xp->registerNamespace('trust', C::NS_TRUST);
$xp->registerNamespace('t', C::NS_TRUST_200502);
$xp->registerNamespace('trust', C::NS_TRUST_200512);
$xp->registerNamespace('policy', C::NS_POLICY);
$xp->registerNamespace('sp11', C::NS_SEC_POLICY_11);
$xp->registerNamespace('sp12', C::NS_SEC_POLICY_12);
Expand Down
100 changes: 50 additions & 50 deletions src/XML/element.registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,56 +353,56 @@
'UsernameToken' => '\SimpleSAML\WSSecurity\XML\wsse\UsernameToken',
],
'http://docs.oasis-open.org/ws-sx/ws-trust/200512/' => [
'AllowPostdating' => '\SimpleSAML\WSSecurity\XML\wst\AllowPostdating',
'AuthenticationType' => '\SimpleSAML\WSSecurity\XML\wst\AuthenticationType',
'Authenticator' => '\SimpleSAML\WSSecurity\XML\wst\Authenticator',
'BinaryExchange' => '\SimpleSAML\WSSecurity\XML\wst\BinaryExchange',
'BinarySecret' => '\SimpleSAML\WSSecurity\XML\wst\BinarySecret',
'CancelTarget' => '\SimpleSAML\WSSecurity\XML\wst\CancelTarget',
'CanonicalizationAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst\CanonicalizationAlgorithm',
'Challenge' => '\SimpleSAML\WSSecurity\XML\wst\Challenge',
'Claims' => '\SimpleSAML\WSSecurity\XML\wst\Claims',
'CombinedHash' => '\SimpleSAML\WSSecurity\XML\wst\CombinedHash',
'ComputedKey' => '\SimpleSAML\WSSecurity\XML\wst\ComputedKey',
'ComputedKeyAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst\ComputedKeyAlgorithm',
'Delegatable' => '\SimpleSAML\WSSecurity\XML\wst\Delegatable',
'DelegateTo' => '\SimpleSAML\WSSecurity\XML\wst\DelegateTo',
'EncryptWith' => '\SimpleSAML\WSSecurity\XML\wst\EncryptWith',
'Encryption' => '\SimpleSAML\WSSecurity\XML\wst\Encryption',
'EncryptionAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst\EncryptionAlgorithm',
'Entropy' => '\SimpleSAML\WSSecurity\XML\wst\Entropy',
'Forwardable' => '\SimpleSAML\WSSecurity\XML\wst\Forwardable',
'IssuedTokens' => '\SimpleSAML\WSSecurity\XML\wst\IssuedTokens',
'Issuer' => '\SimpleSAML\WSSecurity\XML\wst\Issuer',
'KeyExchangeToken' => '\SimpleSAML\WSSecurity\XML\wst\KeyExchangeToken',
'KeySize' => '\SimpleSAML\WSSecurity\XML\wst\KeySize',
'KeyType' => '\SimpleSAML\WSSecurity\XML\wst\KeyType',
'KeyWrapAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst\KeyWrapAlgorithm',
'Lifetime' => '\SimpleSAML\WSSecurity\XML\wst\Lifetime',
'OnBehalfOf' => '\SimpleSAML\WSSecurity\XML\wst\OnBehalfOf',
'Participants' => '\SimpleSAML\WSSecurity\XML\wst\Participants',
'ProofEncryption' => '\SimpleSAML\WSSecurity\XML\wst\ProofEncryption',
'RenewTarget' => '\SimpleSAML\WSSecurity\XML\wst\RenewTarget',
'Renewing' => '\SimpleSAML\WSSecurity\XML\wst\Renewing',
'RequestKET' => '\SimpleSAML\WSSecurity\XML\wst\RequestKET',
'RequestSecurityToken' => '\SimpleSAML\WSSecurity\XML\wst\RequestSecurityToken',
'RequestSecurityTokenCollection' => '\SimpleSAML\WSSecurity\XML\wst\RequestSecurityTokenCollection',
'RequestSecurityTokenResponse' => '\SimpleSAML\WSSecurity\XML\wst\RequestSecurityTokenResponse',
'RequestSecurityTokenResponseCollection' => '\SimpleSAML\WSSecurity\XML\wst\RequestSecurityTokenResponseCollection',
'RequestType' => '\SimpleSAML\WSSecurity\XML\wst\RequestType',
'RequestedAttachedReference' => '\SimpleSAML\WSSecurity\XML\wst\RequestedAttachedReference',
'RequestedProofToken' => '\SimpleSAML\WSSecurity\XML\wst\RequestedProofToken',
'RequestedSecurityToken' => '\SimpleSAML\WSSecurity\XML\wst\RequestedSecurityToken',
'RequestedTokenCancelled' => '\SimpleSAML\WSSecurity\XML\wst\RequestedTokenCancelled',
'RequestedUnattachedReference' => '\SimpleSAML\WSSecurity\XML\wst\RequestedUnattachedReference',
'SignChallenge' => '\SimpleSAML\WSSecurity\XML\wst\SignChallenge',
'SignChallengeResponse' => '\SimpleSAML\WSSecurity\XML\wst\SignChallengeResponse',
'SignWith' => '\SimpleSAML\WSSecurity\XML\wst\SignWith',
'SignatureAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst\SignatureAlgorithm',
'Status' => '\SimpleSAML\WSSecurity\XML\wst\Status',
'TokenType' => '\SimpleSAML\WSSecurity\XML\wst\TokenType',
'UseKey' => '\SimpleSAML\WSSecurity\XML\wst\UseKey',
'ValidateTarget' => '\SimpleSAML\WSSecurity\XML\wst\ValidateTarget',
'AllowPostdating' => '\SimpleSAML\WSSecurity\XML\wst_200512\AllowPostdating',
'AuthenticationType' => '\SimpleSAML\WSSecurity\XML\wst_200512\AuthenticationType',
'Authenticator' => '\SimpleSAML\WSSecurity\XML\wst_200512\Authenticator',
'BinaryExchange' => '\SimpleSAML\WSSecurity\XML\wst_200512\BinaryExchange',
'BinarySecret' => '\SimpleSAML\WSSecurity\XML\wst_200512\BinarySecret',
'CancelTarget' => '\SimpleSAML\WSSecurity\XML\wst_200512\CancelTarget',
'CanonicalizationAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200512\CanonicalizationAlgorithm',
'Challenge' => '\SimpleSAML\WSSecurity\XML\wst_200512\Challenge',
'Claims' => '\SimpleSAML\WSSecurity\XML\wst_200512\Claims',
'CombinedHash' => '\SimpleSAML\WSSecurity\XML\wst_200512\CombinedHash',
'ComputedKey' => '\SimpleSAML\WSSecurity\XML\wst_200512\ComputedKey',
'ComputedKeyAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200512\ComputedKeyAlgorithm',
'Delegatable' => '\SimpleSAML\WSSecurity\XML\wst_200512\Delegatable',
'DelegateTo' => '\SimpleSAML\WSSecurity\XML\wst_200512\DelegateTo',
'EncryptWith' => '\SimpleSAML\WSSecurity\XML\wst_200512\EncryptWith',
'Encryption' => '\SimpleSAML\WSSecurity\XML\wst_200512\Encryption',
'EncryptionAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200512\EncryptionAlgorithm',
'Entropy' => '\SimpleSAML\WSSecurity\XML\wst_200512\Entropy',
'Forwardable' => '\SimpleSAML\WSSecurity\XML\wst_200512\Forwardable',
'IssuedTokens' => '\SimpleSAML\WSSecurity\XML\wst_200512\IssuedTokens',
'Issuer' => '\SimpleSAML\WSSecurity\XML\wst_200512\Issuer',
'KeyExchangeToken' => '\SimpleSAML\WSSecurity\XML\wst_200512\KeyExchangeToken',
'KeySize' => '\SimpleSAML\WSSecurity\XML\wst_200512\KeySize',
'KeyType' => '\SimpleSAML\WSSecurity\XML\wst_200512\KeyType',
'KeyWrapAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200512\KeyWrapAlgorithm',
'Lifetime' => '\SimpleSAML\WSSecurity\XML\wst_200512\Lifetime',
'OnBehalfOf' => '\SimpleSAML\WSSecurity\XML\wst_200512\OnBehalfOf',
'Participants' => '\SimpleSAML\WSSecurity\XML\wst_200512\Participants',
'ProofEncryption' => '\SimpleSAML\WSSecurity\XML\wst_200512\ProofEncryption',
'RenewTarget' => '\SimpleSAML\WSSecurity\XML\wst_200512\RenewTarget',
'Renewing' => '\SimpleSAML\WSSecurity\XML\wst_200512\Renewing',
'RequestKET' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestKET',
'RequestSecurityToken' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestSecurityToken',
'RequestSecurityTokenCollection' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestSecurityTokenCollection',
'RequestSecurityTokenResponse' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestSecurityTokenResponse',
'RequestSecurityTokenResponseCollection' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestSecurityTokenResponseCollection',
'RequestType' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestType',
'RequestedAttachedReference' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestedAttachedReference',
'RequestedProofToken' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestedProofToken',
'RequestedSecurityToken' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestedSecurityToken',
'RequestedTokenCancelled' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestedTokenCancelled',
'RequestedUnattachedReference' => '\SimpleSAML\WSSecurity\XML\wst_200512\RequestedUnattachedReference',
'SignChallenge' => '\SimpleSAML\WSSecurity\XML\wst_200512\SignChallenge',
'SignChallengeResponse' => '\SimpleSAML\WSSecurity\XML\wst_200512\SignChallengeResponse',
'SignWith' => '\SimpleSAML\WSSecurity\XML\wst_200512\SignWith',
'SignatureAlgorithm' => '\SimpleSAML\WSSecurity\XML\wst_200512\SignatureAlgorithm',
'Status' => '\SimpleSAML\WSSecurity\XML\wst_200512\Status',
'TokenType' => '\SimpleSAML\WSSecurity\XML\wst_200512\TokenType',
'UseKey' => '\SimpleSAML\WSSecurity\XML\wst_200512\UseKey',
'ValidateTarget' => '\SimpleSAML\WSSecurity\XML\wst_200512\ValidateTarget',
],
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' => [
'Created' => '\SimpleSAML\WSSecurity\XML\wsu\Created',
Expand Down
2 changes: 0 additions & 2 deletions src/XML/sp_200507/AbstractTokenAssertionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use ValueError;

use function is_string;
use function sprintf;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/XML/sp_200702/AbstractIssuedTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use ValueError;

use function array_pop;
use function is_string;
use function sprintf;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/XML/sp_200702/AbstractKeyValueTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use ValueError;

use function is_string;
use function sprintf;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/XML/sp_200702/AbstractSecureConversationTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use ValueError;

use function array_pop;
use function is_string;
use function sprintf;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/XML/sp_200702/AbstractSpnegoContextTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use ValueError;

use function array_pop;
use function is_string;
use function sprintf;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand All @@ -28,7 +28,7 @@ abstract class AbstractAuthenticatorType extends AbstractWstElement
/**
* AbstractAuthenticatorType constructor
*
* @param \SimpleSAML\WSSecurity\XML\wst\CombinedHash|null $combinedHash
* @param \SimpleSAML\WSSecurity\XML\wst_200512\CombinedHash|null $combinedHash
* @param array<\SimpleSAML\XML\SerializableElementInterface> $children
*/
final public function __construct(
Expand All @@ -40,7 +40,7 @@ final public function __construct(


/**
* @return \SimpleSAML\WSSecurity\XML\wst\CombinedHash|null
* @return \SimpleSAML\WSSecurity\XML\wst_200512\CombinedHash|null
*/
public function getCombinedHash(): ?CombinedHash
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down Expand Up @@ -35,7 +35,7 @@ abstract class AbstractBinarySecretType extends AbstractWstElement

/**
* @param string $content
* @param (\SimpleSAML\WSSecurity\XML\wst\BinarySecretTypeEnum|string)[]|null $Type
* @param (\SimpleSAML\WSSecurity\XML\wst_200512\BinarySecretTypeEnum|string)[]|null $Type
* @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes
*/
final public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand All @@ -27,7 +27,7 @@ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement


/**
* @param (\SimpleSAML\WSSecurity\XML\wst\ComputedKeyEnum|string)[] $values
* @param (\SimpleSAML\WSSecurity\XML\wst_200512\ComputedKeyEnum|string)[] $values
*/
public function __construct(array $values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand All @@ -27,7 +27,7 @@ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement


/**
* @param (\SimpleSAML\WSSecurity\XML\wst\KeyTypeEnum|string)[] $values
* @param (\SimpleSAML\WSSecurity\XML\wst_200512\KeyTypeEnum|string)[] $values
*/
public function __construct(array $values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand All @@ -27,8 +27,8 @@ abstract class AbstractParticipantsType extends AbstractWstElement
/**
* AbstractParticipantsType constructor
*
* @param \SimpleSAML\WSSecurity\XML\wst\Primary|null $primary
* @param array<\SimpleSAML\WSSecurity\XML\wst\Participant> $participant
* @param \SimpleSAML\WSSecurity\XML\wst_200512\Primary|null $primary
* @param array<\SimpleSAML\WSSecurity\XML\wst_200512\Participant> $participant
* @param array<\SimpleSAML\XML\SerializableElementInterface> $children
*/
final public function __construct(
Expand All @@ -41,7 +41,7 @@ final public function __construct(


/**
* @return \SimpleSAML\WSSecurity\XML\wst\Primary|null
* @return \SimpleSAML\WSSecurity\XML\wst_200512\Primary|null
*/
public function getPrimary(): ?Primary
{
Expand All @@ -50,7 +50,7 @@ public function getPrimary(): ?Primary


/**
* @return \SimpleSAML\WSSecurity\XML\wst\Participant[]
* @return \SimpleSAML\WSSecurity\XML\wst_200512\Participant[]
*/
public function getParticipant(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\wst;
namespace SimpleSAML\WSSecurity\XML\wst_200512;

use DOMElement;
use SimpleSAML\Assert\Assert;
Expand Down
Loading

0 comments on commit 5830721

Please sign in to comment.