Draft: Create GraphQL query to get a list of permissions for fine-grained PATs
What does this MR do and why?
- Handbook for the granular personal access tokens effort - https://internal.gitlab.com/handbook/engineering/development/sec/govern/authorization
- This MR create a GraphQL endpoint to get a list of all the permissions that can be applied to fine-grained personal access tokens.
- The endpoint is behind the
fine_grained_personal_access_tokensfeature flag - It also introduces a
include_for_personal_access_tokensto the files defined inconfig/auth/permissionsbecause the same folder is used to add permissions for PATs and DeclarativePolicy and we want to control which permissions are exposed for PATs.
How to set up and validate locally
- Enable feature flag in the rails console:
Feature.enable(:fine_grained_personal_access_tokens)
- Log-in as any user and navigate to GraphQL explorer on
/graphql-explorerand run the following query:
query {
personalAccessTokenPermissions {
name
description
action
resource
featureCategory
}
}
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #572946
Edited by Hinam Mehra