Add support for validating request against dynamic scopes
The first implementation of the ScitokensChecker
uses a fixed list of scopes defined at initialisation. This works well for servers that validate each request against a fixed set of scopes (normally a set of one, e.g. service.read
).
For more complex services, it would be good to allow specifying the required scope(s) at enforcement time, to allow using the same ScitokensChecker
for different types of requests that require different scopes, e.g. service.read
for GET /data
, but service.create
for POST /data
.
This should be fairly easy to achieve by expanding the test
method of the custom Enforcer
to accept target scopes at runtime.