-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: ui and initial scaffolding for OIDC auth (PROJQUAY-6298) (quay#2646)
* added base class for OIDC auth + UI * adding read-only teams page + display sync config + option to remove team sync * setting page in read only mode fix * ui tests * adding validation for group name input * fixes based on review + fixing test suite * add backend tests for externalOIDC * minor fixes
- Loading branch information
1 parent
e825647
commit 4cb0a57
Showing
22 changed files
with
1,284 additions
and
131 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from data.users.federated import FederatedUsers | ||
|
||
|
||
class OIDCUsers(FederatedUsers): | ||
def __init__( | ||
self, | ||
client_id, | ||
client_secret, | ||
oidc_server, | ||
service_name, | ||
login_scopes, | ||
preferred_group_claim_name, | ||
requires_email=True, | ||
): | ||
super(OIDCUsers, self).__init__("oidc", requires_email) | ||
self._client_id = client_id | ||
self._client_secret = client_secret | ||
self._oidc_server = oidc_server | ||
self._service_name = service_name | ||
self._login_scopes = login_scopes | ||
self._preferred_group_claim_name = preferred_group_claim_name | ||
self._requires_email = requires_email | ||
|
||
def is_superuser(self, username: str): | ||
""" | ||
Initiated from FederatedUserManager.is_superuser(), falls back to ConfigUserManager.is_superuser() | ||
""" | ||
return None | ||
|
||
def verify_credentials(self, username_or_email, password): | ||
""" | ||
Verify the credentials with OIDC: To Implement | ||
""" | ||
pass | ||
|
||
def check_group_lookup_args(self, group_lookup_args, disable_pagination=False): | ||
""" | ||
No way to verify if the group is valid, so assuming the group is valid | ||
""" | ||
return (True, None) | ||
|
||
def get_user(self, username_or_email): | ||
""" | ||
No way to look up a username or email in OIDC so returning None | ||
""" | ||
return (None, "Currently user lookup is not supported with OIDC") | ||
|
||
def query_users(self, query, limit): | ||
""" | ||
No way to query users so returning empty list | ||
""" | ||
return ([], self.federated_service, None) |
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.