Skip to content
Snippets Groups Projects
Commit d8a09f10 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Merge branch 'master' of github.com:simplesamlphp/simplesamlphp

# By Brook Schofield
# Via Brook Schofield (1) and Jaime Pérez Crespo (1)
* 'master' of github.com:simplesamlphp/simplesamlphp:
  Improve the local generation of metadata for attributes.required
parents a12bbb15 393abb11
No related branches found
No related tags found
No related merge requests found
......@@ -478,6 +478,9 @@ class SimpleSAML_Metadata_SAMLParser {
if (array_key_exists('attributes', $spd)) {
$ret['attributes'] = $spd['attributes'];
}
if (array_key_exists('attributes.required', $spd)) {
$ret['attributes.required'] = $spd['attributes.required'];
}
if (array_key_exists('attributes.NameFormat', $spd)) {
$ret['attributes.NameFormat'] = $spd['attributes.NameFormat'];
}
......@@ -1098,6 +1101,10 @@ class SimpleSAML_Metadata_SAMLParser {
$sp['attributes.required'][] = $attrname;
}
if ($child->isRequired !== NULL && $child->isRequired === TRUE) {
$sp['attributes.required'][] = $attrname;
}
if ($child->NameFormat !== NULL) {
$attrformat = $child->NameFormat;
} else {
......
......@@ -133,6 +133,10 @@ if ($name !== NULL && !empty($attributes)) {
$metaArray20['name'] = $name;
$metaArray20['attributes'] = $attributes;
$metaArray20['attributes.required'] = $spconfig->getArray('attributes.required', array());
if (empty($metaArray20['attributes.required'])) {
unset($metaArray20['attributes.required']);
}
$description = $spconfig->getArray('description', NULL);
if ($description !== NULL) {
......@@ -184,6 +188,11 @@ if (count($keys) === 1) {
$metaArray20['keys'] = $keys;
}
// add EntityAttributes extension
if ($spconfig->hasValue('EntityAttributes')) {
$metaArray20['EntityAttributes'] = $spconfig->getArray('EntityAttributes');
}
// add UIInfo extension
if ($spconfig->hasValue('UIInfo')) {
$metaArray20['UIInfo'] = $spconfig->getArray('UIInfo');
......@@ -215,7 +224,6 @@ $metaBuilder->addOrganizationInfo($metaArray20);
$xml = $metaBuilder->getEntityDescriptorText();
unset($metaArray20['attributes.required']);
unset($metaArray20['UIInfo']);
unset($metaArray20['metadata-set']);
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