Skip to content
Snippets Groups Projects
Unverified Commit 25c3b456 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Optionally return expired entities

parent f970fb1d
No related branches found
No related tags found
No related merge requests found
...@@ -142,10 +142,11 @@ class MetaDataStorageHandler implements \SimpleSAML\Utils\ClearableState ...@@ -142,10 +142,11 @@ class MetaDataStorageHandler implements \SimpleSAML\Utils\ClearableState
* where the key is the entity id. * where the key is the entity id.
* *
* @param string $set The set we want to list metadata from. * @param string $set The set we want to list metadata from.
* @param bool $showExpired A boolean specifying whether expired entities should be returned
* *
* @return array An associative array with the metadata from from the given set. * @return array An associative array with the metadata from from the given set.
*/ */
public function getList($set = 'saml20-idp-remote') public function getList($set = 'saml20-idp-remote', $showExpired = false)
{ {
assert(is_string($set)); assert(is_string($set));
...@@ -154,9 +155,9 @@ class MetaDataStorageHandler implements \SimpleSAML\Utils\ClearableState ...@@ -154,9 +155,9 @@ class MetaDataStorageHandler implements \SimpleSAML\Utils\ClearableState
foreach ($this->sources as $source) { foreach ($this->sources as $source) {
$srcList = $source->getMetadataSet($set); $srcList = $source->getMetadataSet($set);
foreach ($srcList as $key => $le) { if ($showExpired === false) {
if (array_key_exists('expire', $le)) { foreach ($srcList as $key => $le) {
if ($le['expire'] < time()) { if (array_key_exists('expire', $le) && ($le['expire'] < time())) {
unset($srcList[$key]); unset($srcList[$key]);
Logger::warning( Logger::warning(
"Dropping metadata entity ".var_export($key, true).", expired ". "Dropping metadata entity ".var_export($key, true).", expired ".
......
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