about summary refs log tree commit diff
path: root/tests/test_gn_auth_auth_flow.py
AgeCommit message (Collapse)Author
7 daystests: add TestMasqueradePrivilege auth-flow tests HEAD mainClaude Sonnet 4.6
Test that POST /auth/user/masquerade/ enforces the system:user:masquerade privilege. Both admin and basic users can obtain a token with masquerade scope (the test client supports it), but gn-auth's can_masquerade decorator checks the user's roles: - Basic user → ForbiddenAccess → 403 - Admin user → can masquerade as basic user → 200 Adds three session-scoped fixtures to the test module: admin_masquerade_token, basic_masquerade_token, and basic_user_id.
7 daystests: add TestUserProfileWithToken and TestUserProfileWithoutTokenClaude Sonnet 4.6
Test that GET /auth/user/ returns 200 with user fields when a valid Bearer token is present, and 401 when no token or a garbage token is supplied.
7 daystests: add TestTokenGrantRejection auth-flow testsClaude Sonnet 4.6
Test that POST /auth/token returns 401 when given a wrong password or an unknown email address.
7 daystests: add TestTokenGrant auth-flow testsClaude Sonnet 4.6
Test that POST /auth/token with valid admin credentials returns 200, includes an access_token, sets token_type to bearer, and grants at least the requested scopes.