Skip to content

Commit

Permalink
Add ds:MgmtData element
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Nov 30, 2024
1 parent bf9e836 commit 55defa2
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/XML/ds/AbstractKeyInfoType.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ abstract class AbstractKeyInfoType extends AbstractDsElement
* \SimpleSAML\XMLSecurity\XML\ds\RetrievalMethod|
* \SimpleSAML\XMLSecurity\XML\ds\X509Data|
* \SimpleSAML\XMLSecurity\XML\ds\PGPData|
* \SimpleSAML\XMLSecurity\XML\ds\MgmtData|
* \SimpleSAML\XML\SerializableElementInterface
* )[] $info
* @param string|null $Id
Expand Down Expand Up @@ -65,7 +66,15 @@ final public function __construct(
if ($item instanceof AbstractDsElement) {
Assert::isInstanceOfAny(
$item,
[KeyName::class, KeyValue::class, RetrievalMethod::class, X509Data::class, PGPData::class],
[
KeyName::class,
KeyValue::class,
RetrievalMethod::class,
X509Data::class,
PGPData::class,
// SPKIData::class,
MgmtData::class,
],
SchemaViolationException::class,
);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/XML/ds/KeyInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use SimpleSAML\XMLSecurity\XML\ds\AbstractKeyInfoType;
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
use SimpleSAML\XMLSecurity\XML\ds\KeyName;
use SimpleSAML\XMLSecurity\XML\ds\MgmtData;
use SimpleSAML\XMLSecurity\XML\ds\PGPData;
use SimpleSAML\XMLSecurity\XML\ds\PGPKeyID;
use SimpleSAML\XMLSecurity\XML\ds\PGPKeyPacket;
Expand Down Expand Up @@ -105,6 +106,7 @@ public function testMarshalling(): void
new PGPKeyPacket('GpM8'),
[new P('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=')],
),
new MgmtData('ManagementData'),
new Chunk(DOMDocumentFactory::fromString(
'<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>',
)->documentElement),
Expand Down
2 changes: 2 additions & 0 deletions tests/XML/xenc/OriginatorKeyInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement;
use SimpleSAML\XMLSecurity\XML\ds\AbstractKeyInfoType;
use SimpleSAML\XMLSecurity\XML\ds\KeyName;
use SimpleSAML\XMLSecurity\XML\ds\MgmtData;
use SimpleSAML\XMLSecurity\XML\ds\PGPData;
use SimpleSAML\XMLSecurity\XML\ds\PGPKeyID;
use SimpleSAML\XMLSecurity\XML\ds\PGPKeyPacket;
Expand Down Expand Up @@ -101,6 +102,7 @@ public function testMarshalling(): void
new PGPKeyPacket('GpM8'),
[new P('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=')],
),
new MgmtData('ManagementData'),
new Chunk(DOMDocumentFactory::fromString(
'<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>',
)->documentElement),
Expand Down
2 changes: 2 additions & 0 deletions tests/XML/xenc/RecipientKeyInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement;
use SimpleSAML\XMLSecurity\XML\ds\AbstractKeyInfoType;
use SimpleSAML\XMLSecurity\XML\ds\KeyName;
use SimpleSAML\XMLSecurity\XML\ds\MgmtData;
use SimpleSAML\XMLSecurity\XML\ds\PGPData;
use SimpleSAML\XMLSecurity\XML\ds\PGPKeyID;
use SimpleSAML\XMLSecurity\XML\ds\PGPKeyPacket;
Expand Down Expand Up @@ -101,6 +102,7 @@ public function testMarshalling(): void
new PGPKeyPacket('GpM8'),
[new P('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=')],
),
new MgmtData('ManagementData'),
new Chunk(DOMDocumentFactory::fromString(
'<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>',
)->documentElement),
Expand Down
1 change: 1 addition & 0 deletions tests/resources/xml/ds_KeyInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<ds:PGPKeyPacket>GpM8</ds:PGPKeyPacket>
<xenc:P xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=</xenc:P>
</ds:PGPData>
<ds:MgmtData xmlns:ds="http://www.w3.org/2000/09/xmldsig#">ManagementData</ds:MgmtData>
<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>
</ds:KeyInfo>
1 change: 1 addition & 0 deletions tests/resources/xml/ds_Signature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ds:PGPKeyPacket>GpM8</ds:PGPKeyPacket>
<xenc:P xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=</xenc:P>
</ds:PGPData>
<ds:MgmtData>ManagementData</ds:MgmtData>
<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>
</ds:KeyInfo>
<ds:Object>
Expand Down
1 change: 1 addition & 0 deletions tests/resources/xml/xenc_OriginatorKeyInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<ds:PGPKeyPacket>GpM8</ds:PGPKeyPacket>
<xenc:P xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=</xenc:P>
</ds:PGPData>
<ds:MgmtData xmlns:ds="http://www.w3.org/2000/09/xmldsig#">ManagementData</ds:MgmtData>
<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>
</xenc:OriginatorKeyInfo>
1 change: 1 addition & 0 deletions tests/resources/xml/xenc_RecipientKeyInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<ds:PGPKeyPacket>GpM8</ds:PGPKeyPacket>
<xenc:P xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=</xenc:P>
</ds:PGPData>
<ds:MgmtData xmlns:ds="http://www.w3.org/2000/09/xmldsig#">ManagementData</ds:MgmtData>
<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:Chunk>
</xenc:RecipientKeyInfo>

0 comments on commit 55defa2

Please sign in to comment.