33 assert(
'is_array($sourcesConfig)');
37 foreach ($sourcesConfig as $sourceConfig) {
38 if (!is_array($sourceConfig)) {
39 throw new Exception(
"Found an element in metadata source configuration which wasn't an array.");
42 $sources[] = self::getSource($sourceConfig);
62 assert(is_array($sourceConfig));
64 if (array_key_exists(
'type', $sourceConfig)) {
65 $type = $sourceConfig[
'type'];
79 return new \SimpleSAML\Metadata\Sources\MDQ($sourceConfig);
88 'SimpleSAML_Metadata_MetaDataStorageSource' 92 "Invalid 'type' for metadata source. Cannot find store '$type'.",
96 return new $className($sourceConfig);
136 if ($metadataSet === null) {
141 foreach ($metadataSet as
$index => $entry) {
143 if (!array_key_exists(
'host', $entry)) {
147 if ($hostPath === $entry[
'host']) {
148 if (
$type ===
'entityid') {
149 return $entry[
'entityid'];
179 foreach ($metadataSet as
$index => $entry) {
181 if (!array_key_exists(
'hint.cidr', $entry)) {
184 if (!is_array($entry[
'hint.cidr'])) {
188 foreach ($entry[
'hint.cidr'] as $hint_entry) {
189 if (
SimpleSAML\Utils\Net::ipCIDRcheck($hint_entry, $ip)) {
190 if (
$type ===
'entityid') {
191 return $entry[
'entityid'];
209 assert(
'is_string($entityId)');
210 assert(
'isset($set)');
217 foreach ($metadataSet as
$index => $entry) {
222 if ($entry[
'host'] ===
'__DEFAULT__' || $entry[
'host'] === $currenthost) {
249 assert(
'is_string($index)');
250 assert(
'isset($set)');
254 if (array_key_exists(
$index, $metadataSet)) {
255 return $metadataSet[
$index];
259 if (isset($indexlookup) && array_key_exists($indexlookup, $metadataSet)) {
260 return $metadataSet[$indexlookup];
Attribute-related utility methods.
static getSelfHost()
Retrieve our own host.
Create styles array
The data for the language used.
static resolveClass($id, $type, $subclass=null)
Resolve module class.