diff options
author | Patrick Radtke <patrick@cirrusidentity.com> | 2016-02-23 13:11:32 -0800 |
---|---|---|
committer | Patrick Radtke <patrick@cirrusidentity.com> | 2016-02-23 15:01:15 -0800 |
commit | d718ebc34ef9b6fd30c6d5fcf6bd296430e3c560 (patch) | |
tree | a454d21da7a9b64d35fe56cd60e684cff87d02ab /lib/SimpleSAML | |
parent | 1e7c1113036be64fcf202d5a22861f4785eb8a7d (diff) | |
download | simplesamlphp-d718ebc34ef9b6fd30c6d5fcf6bd296430e3c560.zip simplesamlphp-d718ebc34ef9b6fd30c6d5fcf6bd296430e3c560.tar.gz simplesamlphp-d718ebc34ef9b6fd30c6d5fcf6bd296430e3c560.tar.bz2 |
Expose RegistrationInfo in parsed metadata
- Add test case
- Fix .gitignore since it ignored all metadata folders
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r-- | lib/SimpleSAML/Metadata/SAMLParser.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php index ad725e8..2786fff 100644 --- a/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/lib/SimpleSAML/Metadata/SAMLParser.php @@ -124,6 +124,11 @@ class SimpleSAML_Metadata_SAMLParser */ private $entityAttributes; + /** + * An associative array of attributes from the RegistrationInfo element. + * @var array + */ + private $registrationInfo; /** * @var array @@ -180,6 +185,7 @@ class SimpleSAML_Metadata_SAMLParser $this->scopes = $ext['scope']; $this->tags = $ext['tags']; $this->entityAttributes = $ext['EntityAttributes']; + $this->registrationInfo = $ext['RegistrationInfo']; // look over the RoleDescriptors foreach ($entityElement->RoleDescriptor as $child) { @@ -486,6 +492,11 @@ class SimpleSAML_Metadata_SAMLParser $metadata['tags'] = $tags; } + + if (!empty($this->registrationInfo)) { + $metadata['RegistrationInfo'] = $this->registrationInfo; + } + if (!empty($this->entityAttributes)) { $metadata['EntityAttributes'] = $this->entityAttributes; @@ -993,6 +1004,7 @@ class SimpleSAML_Metadata_SAMLParser 'scope' => array(), 'tags' => array(), 'EntityAttributes' => array(), + 'RegistrationInfo' => array(), 'UIInfo' => array(), 'DiscoHints' => array(), ); @@ -1006,6 +1018,9 @@ class SimpleSAML_Metadata_SAMLParser // Entity Attributes are only allowed at entity level extensions and not at RoleDescriptor level if ($element instanceof SAML2_XML_md_EntityDescriptor) { + if ($e instanceof SAML2_XML_mdrpi_RegistrationInfo) { + $ret['RegistrationInfo']['registrationAuthority'] = $e->registrationAuthority; + } if ($e instanceof SAML2_XML_mdattr_EntityAttributes && !empty($e->children)) { foreach ($e->children as $attr) { // only saml:Attribute are currently supported here. The specifications also allows |