|
| 1 | +@endpoint(oauth2-client-public) @endpoint(oauth2-client-public-v2) |
| 2 | +Feature: OAuth2 Client Public |
| 3 | + Configure OAuth2 clients for Datadog. Supports RFC 7591 Dynamic Client |
| 4 | + Registration and management of OAuth2 client scopes restrictions. |
| 5 | + |
| 6 | + Background: |
| 7 | + Given a valid "apiKeyAuth" key in the system |
| 8 | + And a valid "appKeyAuth" key in the system |
| 9 | + And an instance of "OAuth2ClientPublic" API |
| 10 | + |
| 11 | + @generated @skip @team:DataDog/delegated-auth-login |
| 12 | + Scenario: Delete an OAuth2 client scopes restriction returns "Bad Request" response |
| 13 | + Given operation "DeleteScopesRestriction" enabled |
| 14 | + And new "DeleteScopesRestriction" request |
| 15 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 16 | + When the request is sent |
| 17 | + Then the response status is 400 Bad Request |
| 18 | + |
| 19 | + @generated @skip @team:DataDog/delegated-auth-login |
| 20 | + Scenario: Delete an OAuth2 client scopes restriction returns "No Content" response |
| 21 | + Given operation "DeleteScopesRestriction" enabled |
| 22 | + And new "DeleteScopesRestriction" request |
| 23 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 24 | + When the request is sent |
| 25 | + Then the response status is 204 No Content |
| 26 | + |
| 27 | + @generated @skip @team:DataDog/delegated-auth-login |
| 28 | + Scenario: Delete an OAuth2 client scopes restriction returns "Not Found" response |
| 29 | + Given operation "DeleteScopesRestriction" enabled |
| 30 | + And new "DeleteScopesRestriction" request |
| 31 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 32 | + When the request is sent |
| 33 | + Then the response status is 404 Not Found |
| 34 | + |
| 35 | + @generated @skip @team:DataDog/delegated-auth-login |
| 36 | + Scenario: Get an OAuth2 client scopes restriction returns "Bad Request" response |
| 37 | + Given operation "GetScopesRestriction" enabled |
| 38 | + And new "GetScopesRestriction" request |
| 39 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 40 | + When the request is sent |
| 41 | + Then the response status is 400 Bad Request |
| 42 | + |
| 43 | + @generated @skip @team:DataDog/delegated-auth-login |
| 44 | + Scenario: Get an OAuth2 client scopes restriction returns "Not Found" response |
| 45 | + Given operation "GetScopesRestriction" enabled |
| 46 | + And new "GetScopesRestriction" request |
| 47 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 48 | + When the request is sent |
| 49 | + Then the response status is 404 Not Found |
| 50 | + |
| 51 | + @generated @skip @team:DataDog/delegated-auth-login |
| 52 | + Scenario: Get an OAuth2 client scopes restriction returns "OK" response |
| 53 | + Given operation "GetScopesRestriction" enabled |
| 54 | + And new "GetScopesRestriction" request |
| 55 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 56 | + When the request is sent |
| 57 | + Then the response status is 200 OK |
| 58 | + |
| 59 | + @generated @skip @team:DataDog/delegated-auth-login |
| 60 | + Scenario: Register an OAuth2 client returns "Bad Request" response |
| 61 | + Given operation "RegisterOAuthClient" enabled |
| 62 | + And new "RegisterOAuthClient" request |
| 63 | + And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} |
| 64 | + When the request is sent |
| 65 | + Then the response status is 400 Bad Request |
| 66 | + |
| 67 | + @generated @skip @team:DataDog/delegated-auth-login |
| 68 | + Scenario: Register an OAuth2 client returns "Created" response |
| 69 | + Given operation "RegisterOAuthClient" enabled |
| 70 | + And new "RegisterOAuthClient" request |
| 71 | + And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} |
| 72 | + When the request is sent |
| 73 | + Then the response status is 201 Created |
| 74 | + |
| 75 | + @generated @skip @team:DataDog/delegated-auth-login |
| 76 | + Scenario: Upsert an OAuth2 client scopes restriction returns "Bad Request" response |
| 77 | + Given operation "UpsertScopesRestriction" enabled |
| 78 | + And new "UpsertScopesRestriction" request |
| 79 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 80 | + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} |
| 81 | + When the request is sent |
| 82 | + Then the response status is 400 Bad Request |
| 83 | + |
| 84 | + @generated @skip @team:DataDog/delegated-auth-login |
| 85 | + Scenario: Upsert an OAuth2 client scopes restriction returns "Not Found" response |
| 86 | + Given operation "UpsertScopesRestriction" enabled |
| 87 | + And new "UpsertScopesRestriction" request |
| 88 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 89 | + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} |
| 90 | + When the request is sent |
| 91 | + Then the response status is 404 Not Found |
| 92 | + |
| 93 | + @generated @skip @team:DataDog/delegated-auth-login |
| 94 | + Scenario: Upsert an OAuth2 client scopes restriction returns "OK" response |
| 95 | + Given operation "UpsertScopesRestriction" enabled |
| 96 | + And new "UpsertScopesRestriction" request |
| 97 | + And request contains "client_uuid" parameter from "REPLACE.ME" |
| 98 | + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} |
| 99 | + When the request is sent |
| 100 | + Then the response status is 200 OK |
0 commit comments