|
| getMetadataSet ($set) |
| This function is not implemented. More...
|
|
| getMetadataSet ($set) |
| This function attempts to generate an associative array with metadata for all entities in the given set. More...
|
|
| getEntityIdFromHostPath ($hostPath, $set, $type='entityid') |
| This function resolves an host/path combination to an entity id. More...
|
|
| getPreferredEntityIdFromCIDRhint ($set, $ip, $type='entityid') |
| This function will go through all the metadata, and check the DiscoHints->IPHint parameter, which defines a network space (ip range) for each remote entry. More...
|
|
| getMetaData ($index, $set) |
| This function retrieves metadata for the given entity id in the given set of metadata. More...
|
|
|
static | parseSources ($sourcesConfig) |
| Parse array with metadata sources. More...
|
|
static | getSource ($sourceConfig) |
| This function creates a metadata source based on the given configuration. More...
|
|
Definition at line 16 of file MDQ.php.
◆ __construct()
SimpleSAML\Metadata\Sources\MDQ::__construct |
( |
|
$config | ) |
|
|
protected |
This function initializes the dynamic XML metadata source.
Options:
- 'server': URL of the MDQ server (url:port). Mandatory.
- 'validateFingerprint': The fingerprint of the certificate used to sign the metadata. You don't need this option if you don't want to validate the signature on the metadata. Optional.
- 'cachedir': Directory where metadata can be cached. Optional.
- 'cachelength': Maximum time metadata cah be cached, in seconds. Default to 24 hours (86400 seconds).
- Parameters
-
array | $config | The configuration for this instance of the XML metadata source. |
- Exceptions
-
Definition at line 66 of file MDQ.php.
References $config, $globalConfig, and SimpleSAML_Configuration\getInstance().
70 if (!array_key_exists(
'server',
$config)) {
71 throw new \Exception(__CLASS__.
": the 'server' configuration option is not set.");
73 $this->server =
$config[
'server'];
76 if (array_key_exists(
'validateFingerprint',
$config)) {
77 $this->validateFingerprint =
$config[
'validateFingerprint'];
79 $this->validateFingerprint = null;
82 if (array_key_exists(
'cachedir',
$config)) {
86 $this->cacheDir = null;
89 if (array_key_exists(
'cachelength',
$config)) {
90 $this->cacheLength =
$config[
'cachelength'];
92 $this->cacheLength = 86400;
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
◆ getCacheFilename()
SimpleSAML\Metadata\Sources\MDQ::getCacheFilename |
( |
|
$set, |
|
|
|
$entityId |
|
) |
| |
|
private |
◆ getFromCache()
SimpleSAML\Metadata\Sources\MDQ::getFromCache |
( |
|
$set, |
|
|
|
$entityId |
|
) |
| |
|
private |
Load a entity from the cache.
- Parameters
-
string | $set | The metadata set this entity belongs to. |
string | $entityId | The entity id of this entity. |
- Returns
- array|NULL The associative array with the metadata for this entity, or NULL if the entity could not be found.
- Exceptions
-
Definition at line 139 of file MDQ.php.
References $data, $entityId, SimpleSAML\Logger\debug(), and SimpleSAML\Metadata\Sources\MDQ\getCacheFilename().
141 assert(is_string($set));
144 if (empty($this->cacheDir)) {
149 if (!file_exists($cachefilename)) {
152 if (!is_readable($cachefilename)) {
153 throw new \Exception(__CLASS__.
': could not read cache file for entity ['.$cachefilename.
']');
161 $stat = stat($cachefilename);
162 if ($stat[
'mtime'] + $this->cacheLength <= time()) {
163 Logger::debug(__CLASS__.
': cache file older that the cachelength option allows.');
167 $rawData = file_get_contents($cachefilename);
168 if (empty($rawData)) {
169 $error = error_get_last();
170 throw new \Exception(
171 __CLASS__.
': error reading metadata from cache file "'.$cachefilename.
'": '.$error[
'message']
175 $data = unserialize($rawData);
176 if (
$data ===
false) {
177 throw new \Exception(__CLASS__.
': error unserializing cached data from file "'.$cachefilename.
'".');
180 if (!is_array(
$data)) {
181 throw new \Exception(__CLASS__.
': Cached metadata from "'.$cachefilename.
'" wasn\'t an array.');
◆ getMetadataSet()
SimpleSAML\Metadata\Sources\MDQ::getMetadataSet |
( |
|
$set | ) |
|
This function is not implemented.
- Parameters
-
string | $set | The set we want to list metadata for. |
- Returns
- array An empty array.
Definition at line 104 of file MDQ.php.
◆ getParsedSet()
◆ writeToCache()
SimpleSAML\Metadata\Sources\MDQ::writeToCache |
( |
|
$set, |
|
|
|
$entityId, |
|
|
|
$data |
|
) |
| |
|
private |
Save a entity to the cache.
- Parameters
-
string | $set | The metadata set this entity belongs to. |
string | $entityId | The entity id of this entity. |
array | $data | The associative array with the metadata for this entity. |
- Exceptions
-
Definition at line 197 of file MDQ.php.
References $data, $entityId, SimpleSAML\Logger\debug(), and SimpleSAML\Metadata\Sources\MDQ\getCacheFilename().
199 assert(is_string($set));
201 assert(is_array(
$data));
203 if (empty($this->cacheDir)) {
208 if (!is_writable(dirname($cachefilename))) {
209 throw new \Exception(__CLASS__.
': could not write cache file for entity ['.$cachefilename.
']');
212 file_put_contents($cachefilename, serialize(
$data));
◆ $cacheDir
SimpleSAML\Metadata\Sources\MDQ::$cacheDir |
|
private |
◆ $cacheLength
SimpleSAML\Metadata\Sources\MDQ::$cacheLength |
|
private |
◆ $server
SimpleSAML\Metadata\Sources\MDQ::$server |
|
private |
◆ $validateFingerprint
SimpleSAML\Metadata\Sources\MDQ::$validateFingerprint |
|
private |
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php