Skip to content
Snippets Groups Projects
Commit 393abb11 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Merge pull request #206 from br00k/regAuthority-in-metadata

Improve the local generation of metadata to support registrationAutho…
parents 364ed7e4 75f5c85e
No related branches found
No related tags found
No related merge requests found
...@@ -478,6 +478,9 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -478,6 +478,9 @@ class SimpleSAML_Metadata_SAMLParser {
if (array_key_exists('attributes', $spd)) { if (array_key_exists('attributes', $spd)) {
$ret['attributes'] = $spd['attributes']; $ret['attributes'] = $spd['attributes'];
} }
if (array_key_exists('attributes.required', $spd)) {
$ret['attributes.required'] = $spd['attributes.required'];
}
if (array_key_exists('attributes.NameFormat', $spd)) { if (array_key_exists('attributes.NameFormat', $spd)) {
$ret['attributes.NameFormat'] = $spd['attributes.NameFormat']; $ret['attributes.NameFormat'] = $spd['attributes.NameFormat'];
} }
...@@ -1098,6 +1101,10 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -1098,6 +1101,10 @@ class SimpleSAML_Metadata_SAMLParser {
$sp['attributes.required'][] = $attrname; $sp['attributes.required'][] = $attrname;
} }
if ($child->isRequired !== NULL && $child->isRequired === TRUE) {
$sp['attributes.required'][] = $attrname;
}
if ($child->NameFormat !== NULL) { if ($child->NameFormat !== NULL) {
$attrformat = $child->NameFormat; $attrformat = $child->NameFormat;
} else { } else {
......
...@@ -133,6 +133,10 @@ if ($name !== NULL && !empty($attributes)) { ...@@ -133,6 +133,10 @@ if ($name !== NULL && !empty($attributes)) {
$metaArray20['name'] = $name; $metaArray20['name'] = $name;
$metaArray20['attributes'] = $attributes; $metaArray20['attributes'] = $attributes;
$metaArray20['attributes.required'] = $spconfig->getArray('attributes.required', array()); $metaArray20['attributes.required'] = $spconfig->getArray('attributes.required', array());
if (empty($metaArray20['attributes.required'])) {
unset($metaArray20['attributes.required']);
}
$description = $spconfig->getArray('description', NULL); $description = $spconfig->getArray('description', NULL);
if ($description !== NULL) { if ($description !== NULL) {
...@@ -184,6 +188,11 @@ if (count($keys) === 1) { ...@@ -184,6 +188,11 @@ if (count($keys) === 1) {
$metaArray20['keys'] = $keys; $metaArray20['keys'] = $keys;
} }
// add EntityAttributes extension
if ($spconfig->hasValue('EntityAttributes')) {
$metaArray20['EntityAttributes'] = $spconfig->getArray('EntityAttributes');
}
// add UIInfo extension // add UIInfo extension
if ($spconfig->hasValue('UIInfo')) { if ($spconfig->hasValue('UIInfo')) {
$metaArray20['UIInfo'] = $spconfig->getArray('UIInfo'); $metaArray20['UIInfo'] = $spconfig->getArray('UIInfo');
...@@ -215,7 +224,6 @@ $metaBuilder->addOrganizationInfo($metaArray20); ...@@ -215,7 +224,6 @@ $metaBuilder->addOrganizationInfo($metaArray20);
$xml = $metaBuilder->getEntityDescriptorText(); $xml = $metaBuilder->getEntityDescriptorText();
unset($metaArray20['attributes.required']);
unset($metaArray20['UIInfo']); unset($metaArray20['UIInfo']);
unset($metaArray20['metadata-set']); unset($metaArray20['metadata-set']);
unset($metaArray20['entityid']); unset($metaArray20['entityid']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment