2024-11-26 17:13:14 +05:45
|
|
|
@env-config
|
|
|
|
|
Feature: create auth-app token
|
2025-08-11 12:55:07 +05:45
|
|
|
As an administrator
|
2024-11-26 17:13:14 +05:45
|
|
|
I want to create auth-app Tokens
|
|
|
|
|
So that I can use 3rd party apps
|
|
|
|
|
|
2024-12-31 09:38:34 +05:45
|
|
|
Background:
|
|
|
|
|
Given user "Alice" has been created with default attributes
|
|
|
|
|
And the following configs have been set:
|
2025-08-04 14:31:30 +05:45
|
|
|
| service | config | value |
|
|
|
|
|
| authapp | OCIS_ADD_RUN_SERVICES | auth-app |
|
|
|
|
|
| authapp | PROXY_ENABLE_APP_AUTH | true |
|
2024-12-31 09:38:34 +05:45
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: creates auth-app token via CLI
|
2025-02-10 12:56:14 +05:45
|
|
|
When the administrator creates auth-app token for user "Alice" with expiration time "72h" using the auth-app CLI
|
2024-11-26 17:13:14 +05:45
|
|
|
Then the command should be successful
|
2024-12-31 09:38:34 +05:45
|
|
|
And the command output should contain "App token created for Alice"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: user deletes the created auth-app token
|
2025-08-04 14:31:30 +05:45
|
|
|
Given the config "AUTH_APP_ENABLE_IMPERSONATION" has been set to "true" for "auth-app" service
|
2024-12-31 09:38:34 +05:45
|
|
|
And the administrator has created app token for user "Alice" with expiration time "72h" using the auth-app CLI
|
|
|
|
|
When user "Alice" deletes all the created auth-app tokens using the auth-app API
|
|
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
And user "Admin" should have "0" auth-app tokens
|
|
|
|
|
When user "Admin" lists all created tokens using the auth-app API
|
|
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
And the JSON data of the response should match
|
|
|
|
|
"""
|
|
|
|
|
{
|
|
|
|
|
"type": "array",
|
|
|
|
|
"minItems": 0,
|
|
|
|
|
"maxItems": 0
|
|
|
|
|
}
|
|
|
|
|
"""
|
2025-02-11 14:42:28 +05:45
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: try to create auth-app token without expiry
|
|
|
|
|
When the administrator tries to create auth-app token for user "Alice" with expiration time "" using the auth-app CLI
|
|
|
|
|
Then the command should be unsuccessful
|
|
|
|
|
And the command output should contain "time: invalid duration"
|