Describe the bug
pup integrations aws cloud-auth persona-mappings list returns 401 Unauthorized when authenticated with OAuth2.
The OAuth session is valid, and other Datadog APIs, including AWS integration listing, work with the same token.
To Reproduce
- Authenticate with the elevated scopes accepted by Datadog:
pup auth login --site datadoghq.com \
--extra-scopes service_account_write,user_access_manage
- Confirm that OAuth works for another AWS API:
pup cloud aws list --output json
- Attempt to list WIF persona mappings:
pup integrations aws cloud-auth persona-mappings list \
--output json
- Observe
401 Unauthorized.
I also attempted to request the documented WIF RBAC permissions as OAuth scopes:
pup auth login --site datadoghq.com \
--extra-scopes workload_identity_federation_config_read,workload_identity_federation_config_write
The authorization server rejected both as unrecognized scopes.
Expected behavior
The persona-mapping list command should work with OAuth when the authorizing user has the required WIF permissions.
If this API intentionally does not support OAuth, Pup should fail locally with a clear message that API and application keys are required instead of sending the bearer token and returning a generic 401.
Environment
- OS: Amazon Linux 2, Linux x86_64
- Pup version:
pup 1.10.7
- Datadog site:
datadoghq.com / US1
- Authentication method: OAuth2
Command output
$ pup integrations aws cloud-auth persona-mappings list --output json
Error: failed to list persona mappings: ResponseError(ResponseContent {
status: 401,
content: "{\"errors\":[\"Unauthorized\"]}",
entity: Some(APIErrorResponse(APIErrorResponse {
errors: ["Unauthorized"],
additional_properties: {},
_unparsed: false
}))
})
Requesting the WIF permission names as OAuth scopes produces:
OAuth error: invalid_scope: The following scopes are not recognized:
workload_identity_federation_config_read
workload_identity_federation_config_write
Additional context
Datadog's Workload Identity Federation documentation requires the following RBAC permissions:
workload_identity_federation_config_read
workload_identity_federation_config_write
The documented API supports persona mappings at:
GET /api/v2/cloud_auth/aws/persona_mapping
POST /api/v2/cloud_auth/aws/persona_mapping
The published examples use API and application keys. Pup nevertheless exposes first-class persona-mapping commands and sends its OAuth bearer token to these routes.
This appears similar to previous Pup OAuth enablement gaps:
Those issues required server-side route/client enablement and, where applicable, Pup scope changes.
Could Datadog enable OAuth for the cloud-auth persona-mapping routes and expose the WIF read/write permissions as opt-in OAuth scopes? These permissions appear appropriate for --extra-scopes rather than the default scope set.
Use case: customer-run automation needs to create the initial AWS workload identity mapping without requiring long-lived Datadog API and application keys.
Describe the bug
pup integrations aws cloud-auth persona-mappings listreturns401 Unauthorizedwhen authenticated with OAuth2.The OAuth session is valid, and other Datadog APIs, including AWS integration listing, work with the same token.
To Reproduce
401 Unauthorized.I also attempted to request the documented WIF RBAC permissions as OAuth scopes:
The authorization server rejected both as unrecognized scopes.
Expected behavior
The persona-mapping list command should work with OAuth when the authorizing user has the required WIF permissions.
If this API intentionally does not support OAuth, Pup should fail locally with a clear message that API and application keys are required instead of sending the bearer token and returning a generic
401.Environment
pup 1.10.7datadoghq.com/ US1Command output
Requesting the WIF permission names as OAuth scopes produces:
Additional context
Datadog's Workload Identity Federation documentation requires the following RBAC permissions:
workload_identity_federation_config_readworkload_identity_federation_config_writeThe documented API supports persona mappings at:
The published examples use API and application keys. Pup nevertheless exposes first-class persona-mapping commands and sends its OAuth bearer token to these routes.
This appears similar to previous Pup OAuth enablement gaps:
pup cloud {aws,gcp} listalways 401 #437pup api v1/logs/config/pipelinesalways 401 withlogs_read_configgranted #608Those issues required server-side route/client enablement and, where applicable, Pup scope changes.
Could Datadog enable OAuth for the cloud-auth persona-mapping routes and expose the WIF read/write permissions as opt-in OAuth scopes? These permissions appear appropriate for
--extra-scopesrather than the default scope set.Use case: customer-run automation needs to create the initial AWS workload identity mapping without requiring long-lived Datadog API and application keys.