Skip to content

feat(identity): Add OAuth2ApiStep for API-driven OAuth2 flows#111578

Merged
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/feat-identity-add-oauth2apistep-for-api-driven-oauth2-flows
Mar 27, 2026
Merged

feat(identity): Add OAuth2ApiStep for API-driven OAuth2 flows#111578
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/feat-identity-add-oauth2apistep-for-api-driven-oauth2-flows

Conversation

@evanpurkhiser

Copy link
Copy Markdown
Member

Add a generic API-mode step that handles the full OAuth2 authorization
code flow in a single step: returns the authorize URL for the frontend
to open in a popup, then accepts code/state from the trampoline callback
and exchanges it for an access token. Includes a configurable bind_key
for controlling where token data is stored in pipeline state.

Refs VDY-37

@evanpurkhiser evanpurkhiser requested a review from a team March 25, 2026 22:10
@linear-code

linear-code Bot commented Mar 25, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 25, 2026
Comment thread src/sentry/identity/oauth2.py Outdated
Comment thread src/sentry/identity/oauth2.py Outdated
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-identity-add-oauth2apistep-for-api-driven-oauth2-flows branch from aaef57f to c64d13e Compare March 26, 2026 21:09
Comment thread src/sentry/identity/oauth2.py Outdated
Add a generic API-mode step that handles the full OAuth2 authorization
code flow in a single step: returns the authorize URL for the frontend
to open in a popup, then accepts code/state from the trampoline callback
and exchanges it for an access token. Includes a configurable bind_key
for controlling where token data is stored in pipeline state.

Refs VDY-37
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-identity-add-oauth2apistep-for-api-driven-oauth2-flows branch from c64d13e to 145864f Compare March 26, 2026 21:26

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/sentry/identity/oauth2.py
Comment thread src/sentry/identity/oauth2.py
def handle_post(
self,
validated_data: dict[str, str],
pipeline: Any,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it possible to avoid the Any here? Do the pipelines share some base class we can include?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it was tricky becuase these can be driven from multiple pipelines, yeah let me see if I can fix this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll add a follow up

@evanpurkhiser evanpurkhiser merged commit 28331f1 into master Mar 27, 2026
64 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/feat-identity-add-oauth2apistep-for-api-driven-oauth2-flows branch March 27, 2026 17:25
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants