Repository navigation
v5.4.0
- OAuth
revoke()/clear():revoke()revokes the current token on the server (RFC 7009POST /oauth2/revoke) without touching the local copy;clear()drops the token locally (in-memory + cached file) without contacting the server. Callrevoke()thenclear()to disconnect completely. Available in Rust, C, C++, Java, Node.js and Python (#616) - PKCE in the browser authorization flow: the authorization request now carries a
code_challenge(RFC 7636,S256) and the token exchange sends the matchingcode_verifier.publicclients (e.g. from dynamic client registration) previously failed withOAuth authorization failed: server_error(#616) - Typed OAuth error codes:
OAuthError::code()returns a stable number, exposed aslb_error_code(C),Status::code()(C++),OpenApiException.getCode()(Java) andOpenApiException.code(Python), so callers can tell failures apart without parsing messages. A request that fails because the token cannot be obtained is now kindOAuthinstead of kindOther(#617) - Token requests are bounded: refresh and revoke time out after 30s instead of holding the token lock indefinitely; the authorization code exchange gets 10s to connect and 35s in total (#617)
revoke()is serialized with refresh: the token lock is held for the whole request, so a concurrent refresh can no longer rotate the refresh token mid-revoke and leave the new one valid (#617)- OAuth errors report their cause: transport failures show the underlying error instead of a bare
Request failed, and server rejections readServer returned error response: <error>[: <error_description>]— 5.3.0 dropped the server'serror(e.g.invalid_grant) (#620) oauth2upgraded to 5: the OAuth stack now uses the workspace'sreqwest0.12 instead of a separatereqwest0.11 /hyper0.14 /rustls0.21 chain. Public API, token persistence and redirect protection are unchanged (#615)- Node.js bindings are release builds: the publish workflow now runs
yarn buildinstead ofyarn build:debug— the npm binaries are optimized (28.7 MB vs 156.3 MB on macOS arm64) (#622)
Breaking changes
- Rust:
Error::OAuthholds a typedOAuthErrorinstead of aString,SimpleError::OAuthbecomes{ code, message },HttpClientError::OAuthholds anOAuthError, andOAuthErroris now#[non_exhaustive](exhaustivematches need a wildcard arm) - Java:
OAuthBuilder.build()fails withOpenApiException(kindOAuth) instead of a bareRuntimeException - Bindings: OAuth exception text now includes the code — Python
(kind=..., code=N, ...), Javacode=Ninstead ofnull
Full Changelog: v5.3.0...v5.4.0