getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.23k stars 4.21k forks source link

fix(auth): handle uniqueness of ApiAuthorization per org #81160

Open sentaur-athena opened 13 hours ago

sentaur-athena commented 13 hours ago

I added a new unique index in https://github.com/getsentry/sentry/pull/80996 and this PR is using it in code.

Basically:

  1. If organization id is null then ApiAuthorization of an app must be unique per user
  2. If organization id is not null then ApiAuthorization of an app must be unique per user and org (per organization member)
codecov[bot] commented 13 hours ago

:x: 611 Tests Failed:

Tests completed Failed Passed Skipped
23117 611 22506 215
View the top 3 failed tests by shortest run time > > ```python > tests.snuba.search.test_backend.EventsJoinedGroupAttributesSnubaSearchTest::test_date_filter > ``` > >
Stack Traces | 0.006s run time > > > > > ```python > > No failure message available > > ``` > >
tests.snuba.search.test_backend.EventsJoinedGroupAttributesSnubaSearchTest::test_not_perf_category
Stack Traces | 0.006s run time > > ```python > No failure message available > ```
tests.snuba.search.test_backend.EventsJoinedGroupAttributesSnubaSearchTest::test_query_timestamp
Stack Traces | 0.006s run time > > ```python > No failure message available > ```

To view more test analytics, go to the Test Analytics Dashboard Got feedback? Let us know on Github