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
Branches
Tags
No related merge requests found
......@@ -142,10 +142,11 @@ class MetaDataStorageHandler implements \SimpleSAML\Utils\ClearableState
* where the key is the entity id.
*
* @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.
*/
public function getList($set = 'saml20-idp-remote')
public function getList($set = 'saml20-idp-remote', $showExpired = false)
{
assert(is_string($set));
......@@ -154,9 +155,9 @@ class MetaDataStorageHandler implements \SimpleSAML\Utils\ClearableState
foreach ($this->sources as $source) {
$srcList = $source->getMetadataSet($set);
foreach ($srcList as $key => $le) {
if (array_key_exists('expire', $le)) {
if ($le['expire'] < time()) {
if ($showExpired === false) {
foreach ($srcList as $key => $le) {
if (array_key_exists('expire', $le) && ($le['expire'] < time())) {
unset($srcList[$key]);
Logger::warning(
"Dropping metadata entity ".var_export($key, true).", expired ".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment