Skip to content

test: add e2e tests for system:system-admin cross-VS token authentication#269

Merged
The127 merged 1 commit intomainfrom
feat/system-admin-cross-vs-e2e-tests
Apr 18, 2026
Merged

test: add e2e tests for system:system-admin cross-VS token authentication#269
The127 merged 1 commit intomainfrom
feat/system-admin-cross-vs-e2e-tests

Conversation

@The127
Copy link
Copy Markdown
Owner

@The127 The127 commented Apr 18, 2026

Summary

  • Adds tests/e2e/systemadmin_test.go covering four scenarios for cross-VS auth:
    • system-admin token from initial VS is accepted for VS creation (not 401)
    • system-admin token on a cross-VS endpoint yields policy denial, not a token-validation error
    • admin (VirtualServerAdmin) token from initial VS can create an app in a newly created VS
    • unprivileged user (no roles) is denied app creation in the new VS
  • Sets config.C.InitialVirtualServer.Name = "test-vs" in the e2e harness so the AuthenticationMiddleware fallback resolves the correct signing key during tests

Test plan

  • Run go test -tags e2e ./tests/e2e/... against the memory backend — all four new specs pass
  • Confirm the negative test (unprivileged user) returns 401
  • Confirm the admin cross-VS app creation test returns 201

…tion

Covers four scenarios:
- system-admin token from initial VS is accepted for VS creation
- system-admin token is authenticated (not rejected by token validation)
  on cross-VS endpoints, yielding a policy denial rather than an auth error
- admin (VirtualServerAdmin) token from initial VS can create an application
  in a newly created VS
- unprivileged user (no roles) is denied application creation in the new VS

Also sets config.C.InitialVirtualServer.Name = "test-vs" in the test harness
so the cross-VS fallback in AuthenticationMiddleware resolves to the correct
signing key during tests.

Signed-off-by: karo <karolin.kostial@gmail.com>
@The127 The127 enabled auto-merge (squash) April 18, 2026 22:00
@The127 The127 merged commit 9949d2e into main Apr 18, 2026
8 checks passed
@The127 The127 deleted the feat/system-admin-cross-vs-e2e-tests branch April 18, 2026 22:02
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