-
-
Couldn't load subscription status.
- Fork 4.5k
feat(scopes): Add Distribution permission UI for integration tokens #102298
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: no/add-project-distribution-permission
Are you sure you want to change the base?
feat(scopes): Add Distribution permission UI for integration tokens #102298
Conversation
Add frontend support for the project:distribution permission scope: - Add Distribution resource to SENTRY_APP_PERMISSIONS with read-only access - Update scope lists and TypeScript types - Add scope conversion logic for project:distribution - Hide Distribution permission from personal token creation UI by adding hiddenPermissions prop to PermissionSelection component This allows integration tokens to be created with Distribution permission while preventing personal tokens from accessing it.
| setPermissions(p); | ||
| setPreview(getPreview()); | ||
| }} | ||
| hiddenPermissions={['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.
not sure if this is a good idea or if there is a better way of doing this.
We want to filter the distribution permission from the personal tokens.
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.
One alternative would be to change this component to take PermissionObj[] as another argument (maybe 'displayedPermissionsor something). People who want to show all the boxes passSENTRY_APP_PERMISSIONS(which could also be the default argument) and people who want to show only some can pass:SENTRY_APP_PERMISSIONS.filter(o => o.resource !== "Distribution")` or whatever they like.
I think doing it positively (e.g. show acd) rather than negatively (e.g. show everything except b) is a bit more of a clear API.
| }, | ||
| { | ||
| resource: 'Distribution', | ||
| help: 'Distribution metadata for releases', |
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.
nit: Maybe:
"Pre-release app distribution for trusted testers."
or something along those lines.
| Team: PermissionValue; | ||
| Alerts?: PermissionValue; | ||
| Distribution?: PermissionValue; | ||
| }; |
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.
How come only Alerts and Distribution are optional (with the ?).
| setPermissions(p); | ||
| setPreview(getPreview()); | ||
| }} | ||
| hiddenPermissions={['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.
One alternative would be to change this component to take PermissionObj[] as another argument (maybe 'displayedPermissionsor something). People who want to show all the boxes passSENTRY_APP_PERMISSIONS(which could also be the default argument) and people who want to show only some can pass:SENTRY_APP_PERMISSIONS.filter(o => o.resource !== "Distribution")` or whatever they like.
I think doing it positively (e.g. show acd) rather than negatively (e.g. show everything except b) is a bit more of a clear API.
This PR adds frontend support for the
project:distributionpermission scope, building on top of #102295.Changes
Distributionresource toSENTRY_APP_PERMISSIONSwith read-only accessproject:distributiontoAPI_ACCESS_SCOPESandALLOWED_SCOPESPermissionsTypeScript type to include optionalDistributionfieldproject:distributioninconsolidatedScopes.tsxhiddenPermissionsprop toPermissionSelectioncomponent to filter out specific permissionshiddenPermissionsin personal token creation UI to hide Distribution permissionBehavior
Integration Tokens (Sentry Apps):
project:distributionscopePersonal Tokens:
This ensures that only integration tokens can use the distribution permission, while personal tokens cannot.
Depends On