Support wildcard scopes in M2M auth #127
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for wildcard scopes in M2M auth.
This means that an M2M client can have a scope like
read:*
and if given a required scope ofread:foo
, authentication will be allowed.This does not affect "simple" scopes like
read
orread_users
-- only scopes with a separating:
are supported.Furthermore, the assumption is that the scopes will be given as
action:resource
, though it is technically possible to assign in a different way likeusers:read
, though in that case, a scope ofusers:*
would not match a required scope ofread:users
. But as long as an application is consistent, this would be allowed.Furthermore, a scope of just
*
does not get interpreted as an "omniscient" client -- instead, this is seen as the literal character*
and gets matched similarly toread_users
as mentioned above.