Skip to content

authn-mappings: send OAuth bearer token, document user_access_manage scope | DAL-546 - #692

Merged
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/authn-mappings-oauth
Jul 29, 2026
Merged

authn-mappings: send OAuth bearer token, document user_access_manage scope | DAL-546#692
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/authn-mappings-oauth

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Flip pup authn-mappings {list,get,create,update,delete} from make_api_no_auth! to make_api! so the OAuth bearer is actually sent.
  • Document in the command help text that create/update/delete require user_access_manage, which is not requested by default -- mirrors the existing logs-restriction precedent.

Scope check

  • list/get require user_access_read -- already in both default_scopes() and read_only_scopes().
  • create/update/delete require user_access_manage -- intentionally not in default_scopes() or read_only_scopes() (same treatment as logs-restriction writes), since it's a broad/sensitive scope. Users must opt in with pup auth login --extra-scopes user_access_manage.

Test plan

  • cargo test authn_mappings passes
  • CI passes
  • Manually verify pup authn-mappings list works with OAuth login, and create/update/delete work after pup auth login --extra-scopes user_access_manage

Jira: DAL-546

…scope

list/get already work with default scopes (user_access_read). Flip from
make_api_no_auth! to make_api! so the OAuth bearer is actually sent for
create/update/delete, and document the user_access_manage opt-in in the
command help text, mirroring the existing logs-restriction pattern.
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review July 29, 2026 00:37
@srosenthal-dd
srosenthal-dd requested a review from a team as a code owner July 29, 2026 00:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a25aad1e6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/authn_mappings.rs
Comment thread src/commands/authn_mappings.rs
- src/client.rs: the make_api_no_auth! macro-contract test used
  AuthNMappingsAPI as its vehicle type, which is no longer accurate now
  that authn_mappings.rs uses make_api!. Swapped to ApplicationSecurityAPI
  (ASM WAF custom rules), which is still genuinely no-auth today.
- Added test_authn_mappings_list_accepts_oauth_bearer_token, which
  configures access_token only (no API/APP keys) and asserts the
  Authorization: Bearer header is sent -- the prior tests all used
  test_config's defaults (access_token: None), so the make_api_no_auth! ->
  make_api! change wasn't actually exercised by any test.
@platinummonkey
platinummonkey merged commit 25f983f into DataDog:main Jul 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants