[v7r3][WIP] OAuth2/OIDC AuthN/AuthZ mechanism (Full version)#4650
Closed
TaykYoku wants to merge 105 commits into
Closed
[v7r3][WIP] OAuth2/OIDC AuthN/AuthZ mechanism (Full version)#4650TaykYoku wants to merge 105 commits into
TaykYoku wants to merge 105 commits into
Conversation
fstagni
reviewed
Jul 29, 2020
fstagni
left a comment
Contributor
There was a problem hiding this comment.
I didn't look at everything. This is just a first round of review.
| The starting definition of this class is as follows:: | ||
|
|
||
| from WebAppDIRAC.Lib.WebHandler import WebHandler | ||
| from DIRAC.Core.Web.WebHandler import WebHandler |
Contributor
There was a problem hiding this comment.
I don't like these changes. Not for this release, at least.
| SESSION_FINISHING = "finishing" | ||
|
|
||
|
|
||
| class AuthDB(DB): |
Contributor
There was a problem hiding this comment.
There's no integration test of this class...?
chrisburr
reviewed
Jul 30, 2020
chrisburr
reviewed
Jul 30, 2020
andresailer
reviewed
Sep 16, 2020
andresailer
left a comment
Contributor
There was a problem hiding this comment.
Here are a number of comments from minor to maybe major.
Some of them were written quite some time ago, so they might no longer apply.
Quite a lot of work to understand.
Closed
Contributor
Author
|
This version is obsolete with the release of a v7.2.0, based on it a new one #5045 is created, all comments are taken into account. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 introduces the AuthN/AuthZ mechanism to DIRAC based on the use of Identity Provider
services using OAuth2/OIDC protocols.
Few remarks about the implementation.
The user AuthN/AuthZ paradigm changes. Before we collected all the necessary user information
in the CS Registry and then used it to identify and authorize client requests. Now we can use
external identity providers dynamically. Each time a user is starting a DIRAC session, the
authentication can be delegated to an external identity provider. If authentication is successful,
then actual user profile information is cached in a dynamic session object which is created
for each active user. This session is used for further identification of user requests. Therefore,
DIRAC CS Registry becomes just one of the possible sources of the user profile information. Other
sources are (Federated) Identity Providers, e.g. Check-In, Indigo AIM, Google, etc, VOMS.
The use of X509 certificates is no more the only way for user identification. Therefore,
certificate DN's are no more the primary user identifiers. Now there can be also user IDs
from various identity providers. Within DIRAC, user name becomes the main, single and unique
user identifier independent on various user identities from different providers. As a consequence,
all the CS options with user identities as values, e.g. pilot user, should be expressed in terms
of user names rather than DNs. For backward compatibility current options in a form of DN are
still accepted but should be replaced eventually.
There can be now DIRAC users that do not have usual personal certificates and will identified
via OAuth2/OIDC mechanism. However, in order to ensure the work of the DISET protocol still based
on the use of X509 certificate proxies, the us of Proxy Provider services is enabled. These
services can create a certificate proxy on demand to be used by users in CLI interfaces and
by DIRAC services for performing operation on the users' behalf. Current solution is DIRAC Proxy
Provider using DIRAC CA certificates to generate user proxies (for the DIRAC internal use only).
Solution using RCauth Proxy Provider service is tested and will be available in later PRs.
Users having usual X509 certificates will continue to use those in a usual way.
Identity Providers and Proxy Providers are added as new types of Resources.
Although this PR introduces new functionalities, the current mechanisms of X509 based user
authentication are still maintained. Installations and users using old good X509 certificates
will continue to work without any changes.
It also presents the "core part" of the WebAppDIRAC extension for implementing some of the OAuth2 AuthN/AuthZ flow required REST API endpoints.
BEGINRELEASENOTES
NEW: Multiple changes to provide OAuth2/OIDC user AuthN/AuthZ and OAuth session management.
CHANGE: multiple changes to use username instead of DN where applicable.
Changes affect the following Systems: Transformation, Configuration, DataManagement, Framework, RequestManagement, WorkloadManagement. Also tests, Core, Interfaces, Resources.
*ConfigurationSystem
NEW: Registry - use cached data from the AuthManager and ProxyManager clients, modify methods in new logic context
FIX: Resources - split difficult method
FIX: Utilities - fix method name and path
NEW: Add REST API
*Core
NEW: Move the WebApp "core part" to the DIRAC
NEW: Add DB version
NEW: DictCache - add getDict method
CHANGE: AuthManager - split authorization logic, fix test
CHANGE: RequestHandler - fill credDict by AuthManager methods
CHANGE: align with the PR changes, use ID as IdP user ID in DISET transport flow
*FrameworkSystem
NEW: Add AuthManager service, DB, client and client with caching IdP information data, REST API
NEW: ProxyManager - split client part to parts with VOMS information cache data and simple client, add REST API
CHANGE: ProxyManager - modify to use user/group in requests
NEW: dirac-proxy-init - able to use authentication flow through the Identity providers
NEW: halo - new class to use spinners for waiting process, for ex. waiting authentication
*RequestManagementSystem
CHANGE: Request - add owner parameter, use AuthManager methods
CHANGE: align with the PR changes
*WorkloadManagementSystem
NEW: Add User/pilotUser parameter
CHANGE: align with the PR changes
*TransformationSystem
CHANGE: align with the PR changes
*DataManagementSystem
CHANGE: align with the PR changes
*Resources
NEW: add OAuth identity and proxy providers
CHANGE: align with the PR changes
*Interfaces
CHANGE: align with the PR changes
*tests
CHANGE: align with the PR changes
ENDRELEASENOTES