-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GitLab] Implement refresh_user() to keep auth_state
updated
#490
base: main
Are you sure you want to change the base?
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
auth_state
updated
Review points
|
Indeed, sorry for that point, commits should be way better to review now, tell me if anything else needed to ease the review.
I really don't have any ideas about that point, I'd rather keep 300 as it was there already.
If user had permissions updates while logged-in, the
Docstring updated, tell me if more information should be included. |
This looks similar my PR #475 with an attempt to add OAuth token refresh to generic. In the momentum to implement refresh, please consider it as well. |
Background to help review this PR added by Erik
Authenticator.refresh_user is part of the Authenticator base class. By overriding it, the Authenticator can make sure
auth_state
is updated./user/...
but/hub/...
).Misc notes
refresh_user
, by returningNone
can force a user to re-login. This is perhaps not relevant in this PR.refresh_user
, anything done in the authentication flow could be done multiple times again. Because the default value ofAuthenticator.auth_refresh_age
is 300 for the base authenticator class, it means that by implementingrefresh_user()
, users of the GitLab authenticator may experience a performance hit if they don't end up needing this unless that it set to0
to disable refreshing by default.Original PR description
authenticate()
andrefresh_user()
, it has been split into a separate method.auth_state