fix(auth): add missing OAuth scopes for CI Visibility, Service Catalog, and Teams#144
Open
wzoom wants to merge 2 commits intodatadog-labs:mainfrom
Open
fix(auth): add missing OAuth scopes for CI Visibility, Service Catalog, and Teams#144wzoom wants to merge 2 commits intodatadog-labs:mainfrom
wzoom wants to merge 2 commits intodatadog-labs:mainfrom
Conversation
…g, and Teams Several commands returned 403 Forbidden when using OAuth authentication because the required scopes were not requested during login. This adds 6 missing scopes: - ci_visibility_read (pipelines list/search, tests list/search, code coverage, flaky tests) - ci_visibility_pipelines_write (pipeline event submission) - apm_service_catalog_read (service-catalog list/get) - apm_service_catalog_write (service-catalog create/delete) - teams_read (on-call teams list/get, memberships list) - teams_write (on-call teams create/update/delete, memberships add/update/remove) Co-Authored-By: Claude Opus <noreply@anthropic.com>
00bfae7 to
2192780
Compare
Collaborator
|
Author
@platinummonkey Updated the I see I didn't add |
Rename the Teams write OAuth scope from teams_write to teams_manage to match the correct Datadog API scope name. - Update default_scopes() in src/auth/types.rs - Add teams_manage assertion to test_default_scopes in src/auth/types.rs - Update scope documentation in docs/OAUTH2.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
Ah yeah app key scopes are ahead of oauth scopes, this explains why my test failed, will bring this back internally to get those updated before merging |
Contributor
|
I've added the scopes on the server-side which will fix the invalid scope problem. I don't think the scopes are quite right yet, though. Working on validating them.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Adds 6 missing OAuth scopes to
default_scopes()insrc/auth/types.rsso that CI Visibility, Service Catalog, and Teams commands no longer return 403 Forbidden when authenticated viapup auth login.Scopes Added
ci_visibility_readpup cicd pipelines list/get/search,pup cicd tests list/search, code coverage, flaky testsci_visibility_pipelines_writeapm_service_catalog_readpup service-catalog list/getapm_service_catalog_writeteams_readpup on-call teams list/get,pup on-call memberships listteams_managepup on-call teams create/update/delete, memberships managementMotivation
src/auth/types.rs:default_scopes()defines the OAuth scopes requested duringpup auth login. These scopes were missing, so the OAuth token lacked the necessary permissions for CI Visibility, Service Catalog, and Teams API endpoints. API key authentication was not affected since it uses separate RBAC permissions.Additional Notes
The following scopes may also be missing but need verification against Datadog API docs before adding:
sensitive_data_scanner_read— forpup data-governance scanner-rules liststatus_pages_read/status_pages_write— forpup status-pagescommandsintegrations_read/integrations_write— forpup integrations(Jira, ServiceNow, Slack, Webhooks)Checklist
Related Issues