-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(scopes): Add project:distribution permission scope #102006
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
base: master
Are you sure you want to change the base?
Conversation
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
4d6cc73 to
2bed6fa
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Alter field scopes on apikeyreplica
--
-- (no-op)
--
-- Alter field scopes on apitokenreplica
--
-- (no-op)for --
-- Alter field scopes on apiauthorization
--
-- (no-op)
--
-- Alter field scopes on apikey
--
-- (no-op)
--
-- Alter field scopes on apitoken
--
-- (no-op)
--
-- Alter field scopes on sentryapp
--
-- (no-op) |
2bed6fa to
0734b4b
Compare
0734b4b to
aabe42b
Compare
aabe42b to
0154fdf
Compare
b25ca21 to
4db2460
Compare
Adds a new permission scope for Sentry Distribution functionality. Changes: - Added project:distribution to ApiScopes.project tuple - Added project:distribution to ScopesDict TypedDict - Added project:distribution to SENTRY_SCOPES - Added project:distribution to SENTRY_SCOPE_HIERARCHY_MAPPING - Added project:distribution to SENTRY_SCOPE_SETS with description - Updated tests to verify the new scope works correctly
4db2460 to
217b718
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Alter field scopes on apikeyreplica
--
-- (no-op)
--
-- Alter field scopes on apitokenreplica
--
-- (no-op)for --
-- Alter field scopes on apiauthorization
--
-- (no-op)
--
-- Alter field scopes on apikey
--
-- (no-op)
--
-- Alter field scopes on apitoken
--
-- (no-op)
--
-- Alter field scopes on sentryapp
--
-- (no-op) |
… mapping Registers the project:distribution scope in SENTRY_SCOPES and SENTRY_SCOPE_HIERARCHY_MAPPING to make it available for permission checks throughout the system.
| "project:write": {"project:read", "project:write"}, | ||
| "project:admin": {"project:read", "project:write", "project:admin"}, | ||
| "project:releases": {"project:releases"}, | ||
| "project:distribution": {"project:distribution"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "alerts:read": bool, | ||
| "alerts:write": bool, | ||
| "member:invite": bool, | ||
| "project:distribution": bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this scope will not be used with OAuth, I don't think it needs to be added here.
| ), | ||
| migrations.AlterField( | ||
| model_name="apitoken", | ||
| name="scopes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this field still being used? The last time this value was not 0 was in 2017... 🤔
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="apiauthorization", | ||
| name="scopes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unused, as the value is always 0.
Summary
Adds a new permission scope
project:distributionfor Sentry Build Distribution functionality. This scope allows checking for updates of a given mobile app distribution.Changes
project:distributiontoApiScopes.projecttuple insrc/sentry/models/apiscopes.pyproject:distributiontoScopesDictTypedDictproject:distributiontoSENTRY_SCOPESinsrc/sentry/conf/server.pyproject:distributiontoSENTRY_SCOPE_HIERARCHY_MAPPINGinsrc/sentry/conf/server.pyScope Availability
✅ Available for: