-
Notifications
You must be signed in to change notification settings - Fork 3
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
DUPLO-13529 Detect token invalidation from user logout #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the user has no access to the default tenant?
maybe, instead, just pick whatever the first tenant in the list is
after calling GetTenantsForUser
Excellent point. The ping test would fail and require re-authorization every time, which wouldn't be a great experience. I've made the change to get the list of tenants first and then take the first in the list for the ping test. If the user has no tenants, then the ping test will fail. However, without access to a tenant, there isn't much the user can do until granted access. Those accessing new deployments are likely to be admins and should be able to see the default tenant, but if not, they likely be creating their own tenant or getting access to another shortly. Additional note: Near future API work will allow us to simplify this solution and eliminate this edge case. |
Change description
Fixes an issue in which the logic continued to attempt to use a Duplo token that was preemptively invalidated by the user logging out of the web portal. This condition is now checked beforehand and a new token retrieved if necessary.
Adds
AdminGetInfrastructure
to api.go which can be used to perform a Duplo token validating test call. This API is called in a new functionPingDuploCreds
used at the time a Duplo token is read from the cache.Type of change
Related issues
Fix DUPLO-13529