Skip to content

Conversation

@nuwang
Copy link
Member

@nuwang nuwang commented Oct 31, 2025

Fixes the following traceback when refresh_token is None:
Oct 31 01:14:47 dev galaxyctl[3357277]: Traceback (most recent call last):
Oct 31 01:14:47 dev galaxyctl[3357277]: File "/mnt/galaxy/galaxy-app/lib/galaxy/authnz/managers.py", line 306, in refresh_expiring_oidc_tokens_for_provider
Oct 31 01:14:47 dev galaxyctl[3357277]: refreshed = backend.refresh(trans, auth)
Oct 31 01:14:47 dev galaxyctl[3357277]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 01:14:47 dev galaxyctl[3357277]: File "/mnt/galaxy/galaxy-app/lib/galaxy/authnz/psa_authnz.py", line 206, in refresh
Oct 31 01:14:47 dev galaxyctl[3357277]: expires = self._try_to_locate_refresh_token_expiration(user_authnz_token.extra_data)
Oct 31 01:14:47 dev galaxyctl[3357277]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 01:14:47 dev galaxyctl[3357277]: File "/mnt/galaxy/galaxy-app/lib/galaxy/authnz/psa_authnz.py", line 228, in _try_to_locate_refresh_token_expiration
Oct 31 01:14:47 dev galaxyctl[3357277]: or extra_data["refresh_token"].get("expires", None)
Oct 31 01:14:47 dev galaxyctl[3357277]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 01:14:47 dev galaxyctl[3357277]: AttributeError: 'NoneType' object has no attribute 'get'

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

Fixes traceback when refresh_token is None:
Oct 31 01:14:47 dev galaxyctl[3357277]: Traceback (most recent call last):
Oct 31 01:14:47 dev galaxyctl[3357277]:   File "/mnt/galaxy/galaxy-app/lib/galaxy/authnz/managers.py", line 306, in refresh_expiring_oidc_tokens_for_provider
Oct 31 01:14:47 dev galaxyctl[3357277]:     refreshed = backend.refresh(trans, auth)
Oct 31 01:14:47 dev galaxyctl[3357277]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 01:14:47 dev galaxyctl[3357277]:   File "/mnt/galaxy/galaxy-app/lib/galaxy/authnz/psa_authnz.py", line 206, in refresh
Oct 31 01:14:47 dev galaxyctl[3357277]:     expires = self._try_to_locate_refresh_token_expiration(user_authnz_token.extra_data)
Oct 31 01:14:47 dev galaxyctl[3357277]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 01:14:47 dev galaxyctl[3357277]:   File "/mnt/galaxy/galaxy-app/lib/galaxy/authnz/psa_authnz.py", line 228, in _try_to_locate_refresh_token_expiration
Oct 31 01:14:47 dev galaxyctl[3357277]:     or extra_data["refresh_token"].get("expires", None)
Oct 31 01:14:47 dev galaxyctl[3357277]:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 01:14:47 dev galaxyctl[3357277]: AttributeError: 'NoneType' object has no attribute 'get'
@github-actions github-actions bot changed the title Fix refresh token expiration retrieval logic [25.0] Fix refresh token expiration retrieval logic Oct 31, 2025
@github-actions github-actions bot added the area/auth Authentication and authorization label Oct 31, 2025
@github-actions github-actions bot added this to the 25.1 milestone Oct 31, 2025
@nuwang nuwang requested a review from jdavcs October 31, 2025 06:55
Copy link
Member

@jdavcs jdavcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jdavcs jdavcs added the kind/bug label Nov 3, 2025
@jdavcs jdavcs merged commit a7e0666 into release_25.0 Nov 3, 2025
91 of 103 checks passed
@davelopez davelopez deleted the nuwang-patch-token branch November 3, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication and authorization kind/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants