Skip to content

Conversation

jasonyuezhang
Copy link
Owner

Retrieve/Create functionality for org level configs. "GET" requires read and gets all the configs for that org (including project overrides). "POST" requires write and adds a new data forwarding config


Copied from getsentry#101047
Original PR: getsentry#101047

Copy link

Add Organization-Level Data Forwarding API Endpoints

This PR introduces new API endpoints for managing organization-level data forwarding configurations in Sentry. It provides functionality to retrieve all data forwarding configs for an organization (including any project overrides) via a GET request, and to create new data forwarding configurations via a POST request. The endpoints require appropriate scopes (org:read for GET and org:write for POST), and integrate full input validation, permission checks, and audit logging. The change also includes comprehensive test coverage and registers the new endpoint in the main API router.

Key Changes

• Added DataForwardingIndexEndpoint in src/sentry/integrations/api/endpoints/data_forwarding_index.py enabling GET and POST for organization-level data forwarders.
• GET lists all data forwarders for the organization, supports pagination, and requires org:read scope.
• POST creates new data forwarding configs, runs input validation, permission checks, and requires org:write scope.
• Audit log entry is generated for successful creation (POST).
• Integrated OpenAPI schema (drf_spectacular), caching policies, and region silo decorators.
• Registered endpoint route and name in src/sentry/api/urls.py as /organizations/<org>/forwarding/.
• Added extensive tests in tests/sentry/integrations/api/endpoints/test_data_forwarding.py covering success/error/permissions and all supported provider types.

Affected Areas

src/sentry/integrations/api/endpoints/data_forwarding_index.py
src/sentry/api/urls.py
tests/sentry/integrations/api/endpoints/test_data_forwarding.py

This summary was automatically generated by @propel-code-bot

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.

1 participant