Skip to content

Commit

Permalink
Add ws-policy 200507 elements
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 9, 2024
1 parent 94fef1f commit 0de58e5
Show file tree
Hide file tree
Showing 376 changed files with 10,152 additions and 182 deletions.
2 changes: 1 addition & 1 deletion resources/schemas/ws-securitypolicy-1.1.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
schemaLocation="ws-addr-200408.xsd" />

<xs:import namespace="http://schemas.xmlsoap.org/ws/2004/09/policy"
schemaLocation="ws-policy.xsd" />
schemaLocation="ws-policy-200409.xsd" />

<!--
5. Protection Assertions
Expand Down
7 changes: 6 additions & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Constants extends \SimpleSAML\SAML2\Constants
/**
* The namespace for the Web Service Security Policy protocol.
*/
public const NS_SEC_POLICY_11 = 'http://schemas.microsoft.com/ws/2005/07/securitypolicy';
public const NS_SEC_POLICY_11 = 'http://schemas.xmlsoap.org/ws/2005/07/securitypolicy';
public const NS_SEC_POLICY_12 = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702';

/**
Expand All @@ -68,6 +68,11 @@ class Constants extends \SimpleSAML\SAML2\Constants
*/
public const NS_WSDL_ADDR = 'http://www.w3.org/2006/05/addressing/wsdl';

/**
* The namespace for the Microsoft Security Policy protocol.
*/
public const NS_MSSP = 'http://schemas.microsoft.com/ws/2005/07/securitypolicy';

/**
* The schema-defined wsa fault codes
*/
Expand Down
12 changes: 12 additions & 0 deletions src/XML/fed/AbstractApplicationServiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\XML\md\Extensions;
use SimpleSAML\SAML2\XML\md\Organization;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;

Expand All @@ -19,6 +20,16 @@
*/
abstract class AbstractApplicationServiceType extends AbstractWebServiceDescriptorType
{
/** @var string */
public const XSI_TYPE_PREFIX = 'fed';

/** @var string */
public const XSI_TYPE_NAME = 'ApplicationServiceType';

/** @var string */
public const XSI_TYPE_NAMESPACE = C::NS_FED;


/**
* ApplicationServiceType constructor.
*
Expand Down Expand Up @@ -90,6 +101,7 @@ final public function __construct(
);

parent::__construct(
static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME,
$protocolSupportEnumeration,
$ID,
$validUntil,
Expand Down
12 changes: 12 additions & 0 deletions src/XML/fed/AbstractAttributeServiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\XML\md\Extensions;
use SimpleSAML\SAML2\XML\md\Organization;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;

Expand All @@ -19,6 +20,16 @@
*/
abstract class AbstractAttributeServiceType extends AbstractWebServiceDescriptorType
{
/** @var string */
public const XSI_TYPE_PREFIX = 'fed';

/** @var string */
public const XSI_TYPE_NAME = 'AttributeServiceType';

/** @var string */
public const XSI_TYPE_NAMESPACE = C::NS_FED;


/**
* AttributeServiceType constructor.
*
Expand Down Expand Up @@ -83,6 +94,7 @@ final public function __construct(
);

parent::__construct(
static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME,
$protocolSupportEnumeration,
$ID,
$validUntil,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractEndpointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final public function __construct(


/**
* @return array<\SimpleSAML\WSSecurity\XML\wsa\EndpointReference>
* @return array<\SimpleSAML\WSSecurity\XML\wsa_200508\EndpointReference>
*/
public function getEndpointReference(): array
{
Expand Down
12 changes: 12 additions & 0 deletions src/XML/fed/AbstractPseudonymServiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\XML\md\Extensions;
use SimpleSAML\SAML2\XML\md\Organization;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;

Expand All @@ -19,6 +20,16 @@
*/
abstract class AbstractPseudonymServiceType extends AbstractWebServiceDescriptorType
{
/** @var string */
public const XSI_TYPE_PREFIX = 'fed';

/** @var string */
public const XSI_TYPE_NAME = 'PseudonymServiceType';

/** @var string */
public const XSI_TYPE_NAMESPACE = C::NS_FED;


/**
* PseudonymServiceType constructor.
*
Expand Down Expand Up @@ -83,6 +94,7 @@ final public function __construct(
);

parent::__construct(
static::XSI_TYPE_PREFIX . ':' . static::XSI_TYPE_NAME,
$protocolSupportEnumeration,
$ID,
$validUntil,
Expand Down
4 changes: 4 additions & 0 deletions src/XML/mssp/MustNotSendCancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SimpleSAML\WSSecurity\XML\mssp;

use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\sp_200507\AbstractQNameAssertionType;

/**
Expand All @@ -13,6 +14,9 @@
*/
final class MustNotSendCancel extends AbstractQNameAssertionType
{
/** @var string */
public const NS = C::NS_MSSP;

/** @var string */
public const NS_PREFIX = 'mssp';
}
4 changes: 4 additions & 0 deletions src/XML/mssp/RequireClientCertificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SimpleSAML\WSSecurity\XML\mssp;

use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\sp_200507\AbstractQNameAssertionType;

/**
Expand All @@ -13,6 +14,9 @@
*/
final class RequireClientCertificate extends AbstractQNameAssertionType
{
/** @var string */
public const NS = C::NS_MSSP;

/** @var string */
public const NS_PREFIX = 'mssp';
}
4 changes: 4 additions & 0 deletions src/XML/mssp/RsaToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SimpleSAML\WSSecurity\XML\mssp;

use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType;

/**
Expand All @@ -13,6 +14,9 @@
*/
final class RsaToken extends AbstractTokenAssertionType
{
/** @var string */
public const NS = C::NS_MSSP;

/** @var string */
public const NS_PREFIX = 'mssp';
}
4 changes: 4 additions & 0 deletions src/XML/mssp/SslContextToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SimpleSAML\WSSecurity\XML\mssp;

use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\sp_200507\AbstractTokenAssertionType;

/**
Expand All @@ -13,6 +14,9 @@
*/
final class SslContextToken extends AbstractTokenAssertionType
{
/** @var string */
public const NS = C::NS_MSSP;

/** @var string */
public const NS_PREFIX = 'mssp';
}
64 changes: 64 additions & 0 deletions src/XML/sp_200507/AbstractEmptyType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

declare(strict_types=1);

namespace SimpleSAML\WSSecurity\XML\sp_200507;

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

use function sprintf;

/**
* Class representing WS security policy EmptyType.
*
* @package simplesamlphp/ws-security
*/
abstract class AbstractEmptyType extends AbstractSpElement
{
/**
* AbstractEmptyType constructor.
*/
final public function __construct()
{
}


/**
* Initialize an EmptyType.
*
* Note: this method cannot be used when extending this class, if the constructor has a different signature.
*
* @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
{
$qualifiedName = static::getClassName(static::class);
Assert::eq(
$xml->localName,
$qualifiedName,
sprintf('Unexpected name for EmptyType: %s. Expected: %s.', $xml->localName, $qualifiedName),
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);
}
}
Loading

0 comments on commit 0de58e5

Please sign in to comment.