Skip to content

Commit

Permalink
maint: update some additional docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Jun 27, 2023
1 parent 8d1da50 commit 69535f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions oauthenticator/cilogon.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ def user_info_to_username(self, user_info):

def _user_info_to_unprocessed_username(self, user_info):
"""
Returns a username from
Returns a username from user_info without also applying the "action"
specified under "username_derivation" for the associated idp.
"""
user_idp = user_info["idp"]
username_derivation = self.allowed_idps[user_idp]["username_derivation"]
Expand All @@ -330,8 +331,8 @@ def _user_info_to_unprocessed_username(self, user_info):

def _get_processed_username(self, username, user_info):
"""
This method optionally adjusts a username from user_info based on the
"action" specified under "username_derivation" for the associated idp.
Optionally adjusts a username from user_info based on the "action"
specified under "username_derivation" for the associated idp.
"""
user_idp = user_info["idp"]
username_derivation = self.allowed_idps[user_idp]["username_derivation"]
Expand Down
5 changes: 5 additions & 0 deletions oauthenticator/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def _default_http_client(self):
)

def user_info_to_username(self, user_info):
"""
Overrides OAuthenticator.user_info_to_username to support the
GenericOAuthenticator unique feature of allowing username_claim to be a
callable function.
"""
if callable(self.username_claim):
username = self.username_claim(user_info)
else:
Expand Down

0 comments on commit 69535f0

Please sign in to comment.