fix(go): refresh web-fallback sessions with the correct key (v2.2.1) - #104
Merged
Conversation
…them A session obtained via the alternate login endpoint (v2.2.0) is issued under the web API key, so its OAuth token refresh must use that key for the Basic credential too — refreshing it with the default app key 401s. Track the key that established the session, use it as the OAuth Basic credential in the transport, and persist it in the session so a restored session refreshes correctly. Signing (signed_info) is unaffected and keeps using the app key. Go-only for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A session established via the alternate login endpoint (v2.2.0) is issued under the web API key. Its OAuth token refresh (
POST /api/v1/oauth/token,Authorization: Basic base64(key)) must therefore use that same key — refreshing with the default app key returns 401.Fix
oauth_key, omitted for default app sessions so their files are unchanged) so a restored session refreshes correctly.signed_info) is unaffected and keeps using the app key.Tests
TestRefresh_WebSessionUsesWebKeyForBasic— web session refreshes with the web key.TestRefresh_AppSessionUsesAppKey— app session refreshes with the app key, nooauth_keypersisted.TestRefresh_RestoredWebSessionUsesWebKey— a cached web session round-tripsoauth_keyand refreshes with the web key.Scope
Go only (v2.2.1). TypeScript / Python / Rust to follow.