-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current state of Ralph allows to restrict users by authority, but does not allow a/An admin user b/Finer access control (read, write). This PR aims to solve this issue by implementing `RESTRICT_BY_SCOPES` (`scopes` field is already present in user accounts) which restricts access when enabled.
- Loading branch information
Showing
18 changed files
with
731 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
"""Main module for Ralph's LRS API authentication.""" | ||
|
||
from ralph.api.auth.basic import get_authenticated_user as get_basic_user | ||
from ralph.api.auth.oidc import get_authenticated_user as get_oidc_user | ||
from ralph.api.auth.basic import get_basic_auth_user | ||
from ralph.api.auth.oidc import get_oidc_user | ||
from ralph.conf import settings | ||
|
||
# At startup, select the authentication mode that will be used | ||
get_authenticated_user = ( | ||
get_oidc_user | ||
if settings.RUNSERVER_AUTH_BACKEND == settings.AuthBackends.OIDC | ||
else get_basic_user | ||
) | ||
if settings.RUNSERVER_AUTH_BACKEND == settings.AuthBackends.OIDC: | ||
get_authenticated_user = get_oidc_user | ||
else: | ||
get_authenticated_user = get_basic_auth_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.