|
| 1 | +Feature: Agent Gateway Auth Integration |
| 2 | + As a developer using the SDK |
| 3 | + I want to fetch auth credentials from the Agent Gateway |
| 4 | + So that I can make authenticated requests to MCP servers |
| 5 | + |
| 6 | + Background: |
| 7 | + Given the Agent Gateway client is available |
| 8 | + |
| 9 | + Scenario: Get system auth returns a valid AuthResult |
| 10 | + When I call get_system_auth |
| 11 | + Then the result should be an AuthResult |
| 12 | + And the access_token should be a non-empty string |
| 13 | + And the gateway_url should be a non-empty string |
| 14 | + And the gateway_url should have no trailing slash |
| 15 | + And the access_token should not start with "Bearer " |
| 16 | + |
| 17 | + Scenario: Get user auth returns a valid AuthResult |
| 18 | + Given I have a valid user token |
| 19 | + When I call get_user_auth with the user token |
| 20 | + Then the result should be an AuthResult |
| 21 | + And the access_token should be a non-empty string |
| 22 | + And the gateway_url should be a non-empty string |
| 23 | + And the gateway_url should have no trailing slash |
| 24 | + And the access_token should not start with "Bearer " |
| 25 | + |
| 26 | + Scenario: Get user auth accepts a callable user token |
| 27 | + Given I have a valid user token |
| 28 | + When I call get_user_auth with a callable returning the user token |
| 29 | + Then the result should be an AuthResult |
| 30 | + And the access_token should be a non-empty string |
| 31 | + |
| 32 | + Scenario: System auth and user auth return the same gateway URL |
| 33 | + Given I have a valid user token |
| 34 | + When I call get_system_auth |
| 35 | + And I call get_user_auth with the user token |
| 36 | + Then both gateway URLs should match |
| 37 | + |
| 38 | + Scenario: Get user auth fails when user token is empty |
| 39 | + When I call get_user_auth with an empty user token |
| 40 | + Then the operation should fail with AgentGatewaySDKError |
| 41 | + And the error message should mention "user_token is required" |
| 42 | + |
| 43 | + Scenario: List MCP tools returns a non-empty list of tools |
| 44 | + When I call list_mcp_tools |
| 45 | + Then the result should be a list of MCPTool |
| 46 | + And the list should be non-empty |
| 47 | + And each tool should have a non-empty name |
| 48 | + And each tool should have a non-empty url |
0 commit comments