Skip to content

test(NoTicket): enable V2 auth refresh and invalidation coverage - #542

Merged
lorenzhs merged 1 commit into
mainfrom
lorenz/restore-v2-auth-tests
Oct 7, 2026
Merged

lorenzhs merged 1 commit into
mainfrom
lorenz/restore-v2-auth-tests

Conversation

@lorenzhs

@lorenzhs lorenzhs commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

The V2 auth integration tests were copied from legacy FB1 tests with permanent skips and obsolete username/password fixture references. Enable sync and async coverage for the current FB2 client-credentials flow: refresh on local expiration, recover from a rejected token, and reject invalid credentials during refresh.

Use fresh, uncached auth objects per test and restrict these cases to remote V2 connections. Verify refresh is attempted and queries succeed rather than requiring the auth server to return a different token string. Accept the SDK's authentication/authorization error types instead of an obsolete message prefix.

Add mocked sync/async regressions for refresh returning the same token and for auth-endpoint HTTP 400/401 failures.

Validation: 25 relevant auth/client tests and pre-commit passed; all six integration cases collect. Live FB2 integration execution is pending CI because no integration credentials were available locally.


Note

Low Risk
Test-only changes with no production SDK behavior modified.

Overview
Re-enables and rewrites V2 sync/async auth integration tests that were permanently skipped and still assumed legacy username/password flows. Coverage is limited to remote connections, uses uncached ClientCredentials so tests can mutate secrets safely, and asserts get_new_token_generator runs on local expiry or invalid token before queries succeed again.

Credential invalidation is narrowed to the FB2 client-secret path and expects AuthenticationError or AuthorizationError instead of a fixed error message prefix. Unit tests add mirrored sync/async client cases for refresh when the auth server returns the same access token, and for refresh failures mapping auth HTTP 400 → AuthenticationError and 401 → AuthorizationError.

Reviewed by Cursor Bugbot for commit 2c4a6b1. Bugbot is set up for automated code reviews on this repo. Configure here.

@lorenzhs
lorenzhs marked this pull request as ready for review October 7, 2026 12:28
@lorenzhs
lorenzhs requested a review from a team as a code owner October 7, 2026 12:28
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@lorenzhs

lorenzhs commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@lorenzhs
lorenzhs merged commit 58130db into main Oct 7, 2026
18 checks passed
@lorenzhs
lorenzhs deleted the lorenz/restore-v2-auth-tests branch October 7, 2026 12:57
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.

2 participants