Commit 92d3e78
feat(synthetics): accept OAuth2 bearer for
`synthetics tests run` was the only synthetics command that could not
authenticate with an OAuth2 session (`pup auth login`). Its
`build_auth_headers` hard-required DD_API_KEY + DD_APP_KEY and never read
`cfg.access_token`, unlike every sibling command which routes through
`make_dd_client`/`apply_auth` and prefers a bearer token.
The Datadog CI endpoints this command calls (`synthetics/ci/tunnel`,
`synthetics/tests/trigger/ci`, `synthetics/ci/batch/{id}`) already accept
OAuth2 bearer tokens with the `synthetics_write`/`synthetics_read` scopes,
which pup requests by default — so this was a client-side gap, not a
backend limitation.
- Prefer OAuth2 bearer, fall back to API + app keys, mirroring
`client::apply_auth`.
- Clearer error when no auth is configured.
- Add positive/negative tests for the three auth paths.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>tests run
1 parent 6347a25 commit 92d3e78
1 file changed
Lines changed: 57 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 32 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
959 | 965 | | |
960 | 966 | | |
961 | 967 | | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
962 | 1003 | | |
963 | 1004 | | |
964 | 1005 | | |
| |||
0 commit comments