Skip to content

test(e2e): token-auth sync roundtrip with gateway-minted token#56

Merged
andinux merged 2 commits into
mainfrom
test/e2e-token-auth
Jul 16, 2026
Merged

test(e2e): token-auth sync roundtrip with gateway-minted token#56
andinux merged 2 commits into
mainfrom
test/e2e-token-auth

Conversation

@andinux

@andinux andinux commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add test_token_auth to the e2e suite: the token authentication path (cloudsync_network_set_token) previously had no automated coverage — only the apikey path was tested end-to-end.
  • The test mints a user token from the weblite gateway (POST /v2/tokens, authenticated with INTEGRATION_TEST_APIKEY as Bearer) via the curl CLI, since the test binary is built without networking. It always uses the same obviously-synthetic userId (e2e7e57e-0000-4000-8000-000000000001), a 24h expiresAt so repeated runs don't leave live credentials behind, and no attributes.
  • It then runs the same sync roundtrip as the Init+Sync test, authenticated with the minted token instead of the apikey, asserting cloudsync_network_sync receives rows.
  • Skips cleanly (like the chunked group) when INTEGRATION_TEST_WEBLITE_ADDRESS is not set.
  • integration_network_init is split into a base (address/init) + apikey wrapper so the token test reuses the init logic; existing tests unchanged.
  • CI: main.yml passes INTEGRATION_TEST_WEBLITE_ADDRESS through the job env, the arm64 docker container, and the Android emulator script. The INTEGRATION_TEST_WEBLITE_ADDRESS repo secret must be added for the test to run in CI; until then it reports SKIPPED.

Testing

  • Manual token roundtrip via the CLI passed 7/7 consecutive runs with freshly minted tokens (after the server-side follower fix).
  • make e2e: Token Auth Test OK on every run. Note: Chunked Capped Receive currently fails on unmodified main as well (pre-existing, unrelated to this branch).

🤖 Generated with Claude Code

andinux and others added 2 commits July 15, 2026 19:18
Add test_token_auth: mints a user token from the weblite gateway
(POST /v2/tokens, authenticated with INTEGRATION_TEST_APIKEY) via the
curl CLI, then runs the same sync roundtrip as test_init authenticated
with cloudsync_network_set_token instead of the apikey. Uses a fixed,
obviously-synthetic userId and a 24h expiry so repeated runs don't leave
live credentials behind. Skips when INTEGRATION_TEST_WEBLITE_ADDRESS is
not set; CI passes the new secret through env, docker and android legs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…flict)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andinux
andinux merged commit d871eb4 into main Jul 16, 2026
21 of 27 checks passed
@andinux
andinux deleted the test/e2e-token-auth branch July 16, 2026 15:09
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