Skip to content

Commit

Permalink
Update log for put_gen3_usernames_for_passport_into_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
k-burt-uch committed Jan 29, 2025
1 parent 18e2acf commit 66f3156
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fence/resources/ga4gh/passports.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ def put_gen3_usernames_for_passport_into_cache(
)

logger.debug(
f"Cached users {user_ids_from_passports} for provided passport in "
f"database cache and placed in in-memory cache. "
f"Cached {user_ids_from_passports} passport in "
f"database. "
f"Expires: {expires_at}"
)

Expand Down
2 changes: 2 additions & 0 deletions fence/resources/openid/idp_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def get_value_from_discovery_doc(self, key, default_value):
using their discovery url.
"""
if self.discovery_url:
self.logger.info(f"Using {self.discovery_url} to get discovery doc")
return_value = default_value
if self.discovery_doc.status_code == requests.codes.ok:
return_value = self.discovery_doc.json().get(key)
Expand Down Expand Up @@ -125,6 +126,7 @@ def get_value_from_discovery_doc(self, key, default_value):
)
# no `discovery_url`, try to use `discovery` config instead
else:
self.logger.info(f"Using discovery from fence settings")
return_value = self.settings.get("discovery", {}).get(key, default_value)

if not return_value:
Expand Down
4 changes: 3 additions & 1 deletion fence/resources/openid/ras_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ def update_user_authorization(self, user, pkey_cache, db_session=None):
db_session = db_session or current_app.scoped_session()
try:
token_endpoint = self.get_value_from_discovery_doc("token_endpoint", "")

self.logger.info(
f"Using token_endpoint {token_endpoint} from discovery doc"
)
# this get_access_token also persists the refresh token in the db
token = self.get_access_token(user, token_endpoint, db_session)
userinfo = self.get_userinfo(token)
Expand Down

0 comments on commit 66f3156

Please sign in to comment.