Skip to content

fix(go): refresh web-fallback sessions with the correct key (v2.2.1) - #104

Merged
ekkx merged 1 commit into
masterfrom
fix/web-session-oauth-refresh-key
Jul 4, 2026
Merged

fix(go): refresh web-fallback sessions with the correct key (v2.2.1)#104
ekkx merged 1 commit into
masterfrom
fix/web-session-oauth-refresh-key

Conversation

@ekkx

@ekkx ekkx commented Jul 4, 2026

Copy link
Copy Markdown
Owner

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

  • Track the API key that established the active session (defaults to the app key; becomes the web key for a fallback session, or a caller-pinned key).
  • The transport uses it as the Basic credential on the OAuth refresh path.
  • Persist it in the session (oauth_key, omitted for default app sessions so their files are unchanged) so a restored session refreshes correctly.
  • Signing (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, no oauth_key persisted.
  • TestRefresh_RestoredWebSessionUsesWebKey — a cached web session round-trips oauth_key and refreshes with the web key.
  • Full Go suite green.

Scope

Go only (v2.2.1). TypeScript / Python / Rust to follow.

…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.
@ekkx
ekkx merged commit 898fff3 into master Jul 4, 2026
14 checks passed
@ekkx
ekkx deleted the fix/web-session-oauth-refresh-key branch July 4, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant