Skip to content

test: add isolated local OAuth E2E coverage - #469

Open
DivyamTalwar wants to merge 3 commits into
apify:mainfrom
DivyamTalwar:test/local-client-credentials-e2e-1509
Open

DivyamTalwar wants to merge 3 commits into
apify:mainfrom
DivyamTalwar:test/local-client-credentials-e2e-1509

Conversation

@DivyamTalwar

@DivyamTalwar DivyamTalwar commented Oct 22, 2026 •

Copy link
Copy Markdown

Automate authenticated E2E coverage without external accounts. Strict local fixtures exercise the real CLI, bridges, credential storage, and MCP SDK for client credentials and authorization-code login with dynamic registration, S256 PKCE, and rotating refresh tokens.

  • Verify two isolated profiles, bearer rejection, bounded renewal, refresh persistence across restart, recovery, logout, and secret-free output.
  • Exercise the actual browser/callback boundary with private launchers, including PKCE mismatch, wrong issuer, Host rejection, and denied authorization.
  • Register exact test-owned credentials before login; verify cleanup after interruption, denied authorization after registration, and post-token metadata failure while preserving an unrelated sentinel.
  • Validated: 1,345 unit tests; Linux Node in both protocol eras with native keyring and file fallback; macOS Node/Bun in both eras with Keychain and Node file fallback; build, fixture type checks, and lint (24 existing warnings, no errors).
  • The browser suite explicitly skips Windows until it has a launcher driver; the existing remote OAuth test remains an optional smoke check.

Refs #350. This extends this PR's client-credentials milestone; separate protocol-conformance scope #332 remains outside this change.

@DivyamTalwar DivyamTalwar changed the title test: add isolated local client-credentials E2E coverage test: add isolated local OAuth E2E coverage Oct 22, 2026
Refs apify#350.

Signed-off-by: Divyam Talwar <divyamtalwar0@gmail.com>
Upstream apify#479 defers writing a dynamically registered OAuth client to the
keychain until the login receives tokens, so a rejected PKCE exchange, a
wrong issuer or a denied authorization no longer leaves a registration.
Assert that instead of the old leftover, and note in the test README that
mcpc now checks the callback state.

Verification: ./test/e2e/run.sh --no-build auth/oauth-code.test.sh
auth/oauth-local.test.sh (2 passed, 0 failed).
@DivyamTalwar
DivyamTalwar force-pushed the test/local-client-credentials-e2e-1509 branch 2 times, most recently from dfd99a4 to b22f2b3 Compare November 22, 2026 20:26
@DivyamTalwar

Copy link
Copy Markdown
Author

@jancurn rebased onto current main. Since #479 stores a dynamic OAuth client only after login succeeds, the failed-login assertions now expect no leftover registration. Lint, build and all 1363 unit tests pass, plus the local OAuth e2e suites. Ready for your review.

This branch has not been deployed

No deployments
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