Added support for validating token issuer and audience

* Use requireIssuer() and requireAudience() on the JwtValidator to make sure
  that the token is for what you expect it to be for.
* A setAll() method has been added to property bag, applying but not overriding
  values.
* Added tests for JwtValidator.
This commit is contained in:
2021-02-16 18:25:29 +01:00
parent 9d85e2ccef
commit 7753853e58
4 changed files with 96 additions and 5 deletions

View File

@ -45,6 +45,14 @@ class PropertyBag
$this->props[$prop] = $value;
}
public function setAll(array $props)
{
$this->props = array_merge(
$this->props,
$props
);
}
/**
* Get the value of a property, fails if the property does not exist.
* Use the value() method to get with a default value
@ -122,4 +130,4 @@ class PropertyBag
return true;
}
}
}