-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
triageNeeds to be looked atNeeds to be looked at
Description
This is a follow-up of #4492
The problem
We can understand about many tokens that they are invalid because they are outdated (token.expiresAt is in the past), but GitHub tokens are not provided with expiration date, therefore we do not decline them by reason of expiration.
GKDev web page sends https://api.github.com/graphql: {"query":"query { rateLimit(dryRun: true) { __typename } }"} and by response they can show on the web-page that it's invalid:
{
"message": "Bad credentials",
"documentation_url": "https://docs.github.com/rest",
"status": "401"
}
Possible solution
Our options are:
- leave it on GitLens as is
- query GitHub for token validity in the same way as it's done on the web page.
- Convince GKDev team to retire invalid GitHub token on their side and do not send them to us, or at least let us know that they are invalid.
- Nuke the invalid token from GKDev. We can do following:
- detect that the GitHub token is invalid
- try to refresh with GKDev, if it succeeds—good, if it fails—go further. (maybe we can skip this step because probably it always fails)
- kick the token away from GKDev. We can use this API endpoint to disconnect:
Use this route to disconnect a token from GK, it will not invalidate the token on the providers end
- open a piece of UI that would let user to reconnect GitHub.
According to this recent discussion it seems that we lean to the option 4.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triageNeeds to be looked atNeeds to be looked at