ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleSAML_Metadata_MetaDataStorageHandlerXML Class Reference
+ Inheritance diagram for SimpleSAML_Metadata_MetaDataStorageHandlerXML:
+ Collaboration diagram for SimpleSAML_Metadata_MetaDataStorageHandlerXML:

Public Member Functions

 getMetadataSet ($set)
 This function returns an associative array with metadata for all entities in the given set. More...
 

Protected Member Functions

 __construct ($config)
 This function initializes the XML metadata source. More...
 

Private Attributes

 $metadata
 

Additional Inherited Members

Detailed Description

Definition at line 11 of file MetaDataStorageHandlerXML.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML_Metadata_MetaDataStorageHandlerXML::__construct (   $config)
protected

This function initializes the XML metadata source.

The configuration must contain one of the following options:

  • 'file': Path to a file with the metadata. This path is relative to the SimpleSAMLphp base directory.
  • 'url': URL we should download the metadata from. This is only meant for testing.
Parameters
array$configThe configuration for this instance of the XML metadata source.
Exceptions
ExceptionIf neither the 'file' or 'url' options are defined in the configuration.

Definition at line 33 of file MetaDataStorageHandlerXML.php.

References $config, $entityId, $globalConfig, array, SimpleSAML_Configuration\getInstance(), and SimpleSAML_Metadata_SAMLParser\parseDescriptorsFile().

34  {
35  // get the configuration
37 
38  if (array_key_exists('file', $config)) {
39  $src = $globalConfig->resolvePath($config['file']);
40  } elseif (array_key_exists('url', $config)) {
41  $src = $config['url'];
42  } else {
43  throw new Exception("Missing either 'file' or 'url' in XML metadata source configuration.");
44  }
45 
46 
47  $SP1x = array();
48  $IdP1x = array();
49  $SP20 = array();
50  $IdP20 = array();
51  $AAD = array();
52 
54  foreach ($entities as $entityId => $entity) {
55 
56  $md = $entity->getMetadata1xSP();
57  if ($md !== null) {
58  $SP1x[$entityId] = $md;
59  }
60 
61  $md = $entity->getMetadata1xIdP();
62  if ($md !== null) {
63  $IdP1x[$entityId] = $md;
64  }
65 
66  $md = $entity->getMetadata20SP();
67  if ($md !== null) {
68  $SP20[$entityId] = $md;
69  }
70 
71  $md = $entity->getMetadata20IdP();
72  if ($md !== null) {
73  $IdP20[$entityId] = $md;
74  }
75 
76  $md = $entity->getAttributeAuthorities();
77  if (count($md) > 0) {
78  $AAD[$entityId] = $md[0];
79  }
80  }
81 
82  $this->metadata = array(
83  'shib13-sp-remote' => $SP1x,
84  'shib13-idp-remote' => $IdP1x,
85  'saml20-sp-remote' => $SP20,
86  'saml20-idp-remote' => $IdP20,
87  'attributeauthority-remote' => $AAD,
88  );
89  }
static parseDescriptorsFile($file)
This function parses a file where the root node is either an EntityDescriptor element or an EntitiesD...
Definition: SAMLParser.php:302
Create styles array
The data for the language used.
if($source===null) if(!($source instanceof sspmod_saml_Auth_Source_SP)) $entityId
Definition: metadata.php:22
$globalConfig
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call graph for this function:

Member Function Documentation

◆ getMetadataSet()

SimpleSAML_Metadata_MetaDataStorageHandlerXML::getMetadataSet (   $set)

This function returns an associative array with metadata for all entities in the given set.

The key of the array is the entity id.

Parameters
string$setThe set we want to list metadata for.
Returns
array An associative array with all entities in the given set.

Definition at line 100 of file MetaDataStorageHandlerXML.php.

References array.

101  {
102  if (array_key_exists($set, $this->metadata)) {
103  return $this->metadata[$set];
104  }
105 
106  // we don't have this metadata set
107  return array();
108  }
Create styles array
The data for the language used.

Field Documentation

◆ $metadata

SimpleSAML_Metadata_MetaDataStorageHandlerXML::$metadata
private

Definition at line 19 of file MetaDataStorageHandlerXML.php.


The documentation for this class was generated from the following file: