Skip to content

Commit

Permalink
add tests for session error code
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Feb 26, 2025
1 parent da8a2e0 commit 0d9464b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions features/api/v1/tokens/sessions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,14 @@ Feature: Token sessions
When I send a POST request to "/accounts/test1/licenses/$0/actions/validate"
Then the response status should be "403"
And the response headers should contain "Set-Cookie" with an expired "session_id" cookie
And the first error should have the following properties:
"""
{
"title": "Access denied",
"detail": "Session token authentication is not allowed by policy",
"code": "SESSION_NOT_ALLOWED"
}
"""

Scenario: License validates their key via session authentication (token auth strategy)
Given the current account is "test1"
Expand Down Expand Up @@ -516,6 +524,14 @@ Feature: Token sessions
When I send a POST request to "/accounts/test1/licenses/$0/actions/validate"
Then the response status should be "403"
And the response headers should contain "Set-Cookie" with an expired "session_id" cookie
And the first error should have the following properties:
"""
{
"title": "Access denied",
"detail": "Session token authentication is not allowed by policy",
"code": "SESSION_NOT_ALLOWED"
}
"""

# update
Scenario: Product updates their license via session authentication
Expand Down

0 comments on commit 0d9464b

Please sign in to comment.