-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(api) Add option to enforce use of scopes (all/read
, all/write
, etc.) [after #448]
#441
(api) Add option to enforce use of scopes (all/read
, all/write
, etc.) [after #448]
#441
Conversation
all/read
, all/write
, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"statements/read": {"statements/read/mine", "statements/read"}, | ||
"all/read": { | ||
"statements/read/mine", | ||
"statements/read", | ||
"state/read", | ||
"profile/read", | ||
"all/read", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be possible to define them with a wildcard? E.g. statements/read/*
and */read/*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefered this explicit syntax as it seemed clearer when reading the code, but I can change this.
Anyone else has an opinion ?
all/read
, all/write
, etc.)all/read
, all/write
, etc.) [after #448]
Replaced by #463 |
Merge after unification & test refactoring [#448 ]
Purpose
The current state of Ralph allows to restrict users by authority, but does not allow 1. An admin user 2. Finer access control (read, write). This PR aims to solve this issue by implementing
scopes
(a field already present in user accounts) which can allow restricted access.Proposal
The scopes proposed are a slight variation on the scopes defined by the xAPI standard:
NB: This PR also proposes some cleaning (renaming tests and factorizing code in tests).
TODO:
statements/read/mine
scope (ENFORCE_AUTHORITY must be used) (specific test !)test_api_statements_get_statements
->test_api_statements_get
)mock_statement
helper to simplify post and put tests