Skip to content

Fix test token being rejected under group-based access#201

Merged
rbardaji merged 1 commit into
mainfrom
fix/200-test-token-group-access
Jul 25, 2026
Merged

Fix test token being rejected under group-based access#201
rbardaji merged 1 commit into
mainfrom
fix/200-test-token-group-access

Conversation

@rbardaji

Copy link
Copy Markdown
Collaborator

Closes #200

Problem

The test token is meant to grant full access without contacting the authentication service. On an endpoint with ENABLE_GROUP_BASED_ACCESS=True it was refused: signing in through the UI with the test token returned 403.

The fabricated user carried the roles admin and user and belonged to no groups. The endpoint's platform admin role is ndp_admin, not admin, so entry — which requires an allowed group, ndp_admin, or the endpoint's own group — was denied. Even where the token was admitted, it resolved to no effective role and could exercise no write or management action.

This was reported from the field on the FARSITE endpoint, which has group-based access enabled.

Fix

The test token now carries ndp_admin, the role it is meant to represent. One line, in the fabricated user info.

Verified

New regression tests in tests/test_test_token_access.py cover the reported scenario directly: with group-based access enabled and an allowed group configured, the test user (in no groups) is admitted, is recognized as admin, and resolves to the admin effective role.

  • Full suite: 1157 passed
  • black --check and flake8 clean

No routes or request/response shapes change; only the roles reported for the test token.

The user info fabricated for the test token carried the roles admin and
user and no groups. The endpoint recognizes ndp_admin, not admin, so
with ENABLE_GROUP_BASED_ACCESS enabled the test user failed the entry
check: /user/info returned 403 and the UI refused it. Even when admitted
it resolved to no effective role, so it could exercise nothing.

The test token now carries ndp_admin, the role it is meant to represent,
so it passes group-based access and resolves to admin everywhere.

Closes #200
@rbardaji
rbardaji merged commit c669704 into main Jul 25, 2026
1 check passed
@rbardaji
rbardaji deleted the fix/200-test-token-group-access branch July 25, 2026 07:12
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.

Test token is rejected on endpoints with group-based access enabled

1 participant