Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(integrations): oauth2 identity pipeline metrics round 2 #80216

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cathteng
Copy link
Member

@cathteng cathteng commented Nov 4, 2024

Changes from #79325

Fixes SENTRY-3H4H

  • We know that the slug must be some IdentityProvider. These are registered via IdentityManager, we can just attempt to get the IdentityProvider class from the manager with the key to check if the slug is valid. This will also handle registrations done in getsentry (e.g. google_login).

register(SlackIdentityProvider) # NOQA
register(GitHubIdentityProvider) # NOQA
register(GitHubEnterpriseIdentityProvider) # NOQA
register(VSTSNewIdentityProvider) # NOQA
register(VSTSIdentityProvider) # NOQA
register(VstsExtensionIdentityProvider) # NOQA
register(VercelIdentityProvider) # NOQA
register(BitbucketIdentityProvider) # NOQA
register(GitlabIdentityProvider) # NOQA
register(GoogleIdentityProvider) # NOQA
register(DiscordIdentityProvider) # NOQA

These are used in the installation flows for:

  • GitHub Enterprise
  • VSTSNewIdentityProvider
  • Slack
  • Vercel
  • Gitlab
  • GitHub (via a redirect, the pipeline is not directly used)

Missing:

  • VSTSOAuth2CallbackView overwrites the exchange_token function (VSTSIdentityProvider, VSTSExtensionIdentityProvider)

Not applicable

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 4, 2024
@cathteng cathteng marked this pull request as ready for review November 4, 2024 22:05
@cathteng cathteng requested review from a team as code owners November 4, 2024 22:05
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 78.68852% with 13 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/identity/oauth2.py 77.58% 10 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #80216      +/-   ##
==========================================
+ Coverage   77.16%   78.08%   +0.92%     
==========================================
  Files        7179     7179              
  Lines      317140   317163      +23     
  Branches    43725    43725              
==========================================
+ Hits       244718   247661    +2943     
+ Misses      65878    63152    -2726     
+ Partials     6544     6350     -194     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant