Skip to content

v5.4.0

Choose a tag to compare

@hogan-yuan hogan-yuan released this 09 Nov 07:29
63abe9a
  • OAuth revoke() / clear(): revoke() revokes the current token on the server (RFC 7009 POST /oauth2/revoke) without touching the local copy; clear() drops the token locally (in-memory + cached file) without contacting the server. Call revoke() then clear() 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 matching code_verifier. public clients (e.g. from dynamic client registration) previously failed with OAuth authorization failed: server_error (#616)
  • Typed OAuth error codes: OAuthError::code() returns a stable number, exposed as lb_error_code (C), Status::code() (C++), OpenApiException.getCode() (Java) and OpenApiException.code (Python), so callers can tell failures apart without parsing messages. A request that fails because the token cannot be obtained is now kind OAuth instead of kind Other (#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 read Server returned error response: <error>[: <error_description>] — 5.3.0 dropped the server's error (e.g. invalid_grant) (#620)
  • oauth2 upgraded to 5: the OAuth stack now uses the workspace's reqwest 0.12 instead of a separate reqwest 0.11 / hyper 0.14 / rustls 0.21 chain. Public API, token persistence and redirect protection are unchanged (#615)
  • Node.js bindings are release builds: the publish workflow now runs yarn build instead of yarn build:debug — the npm binaries are optimized (28.7 MB vs 156.3 MB on macOS arm64) (#622)

Breaking changes

  • Rust: Error::OAuth holds a typed OAuthError instead of a String, SimpleError::OAuth becomes { code, message }, HttpClientError::OAuth holds an OAuthError, and OAuthError is now #[non_exhaustive] (exhaustive matches need a wildcard arm)
  • Java: OAuthBuilder.build() fails with OpenApiException (kind OAuth) instead of a bare RuntimeException
  • Bindings: OAuth exception text now includes the code — Python (kind=..., code=N, ...), Java code=N instead of null

Full Changelog: v5.3.0...v5.4.0