Skip to content

✨ Feature: add server-side OAuth token client - #4

Merged
dmahacker merged 2 commits into
mainfrom
user/dmahacker/oauth-token-client
Oct 10, 2026
Merged

dmahacker merged 2 commits into
mainfrom
user/dmahacker/oauth-token-client

Conversation

@dmahacker

Copy link
Copy Markdown
Contributor

Adds PicGoCloudOAuth for partner backends (requires client secret, server-only):

  • createAuthorization – PKCE S256 authorization URL + state/codeVerifier
  • exchangeCode, refresh, revoke – client_secret_basic, form body, matching PicGo Hub /oauth/token and /oauth/revoke
  • tokenProvider – cached access token for PicGoCloudClient, refreshes 30s before expiry, dedupes concurrent refreshes
  • OAuth errors map to PicGoCloudError (invalid_grant/invalid_client → kind authentication)
  • README (EN/ZH) server-side OAuth section

Verification: pnpm check (67 tests incl. 9 new); built dist exercised against the real Hub token service (PGlite) for exchange, shared refresh, revoke → invalid_grant, wrong secret → invalid_client, special-character client credentials.

@dmahacker
dmahacker merged commit bcfa3cb into main Oct 10, 2026
2 checks passed
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