Loading
Add authorize_granular_token skip_reason: :parent_authorizes to WorkItemStatus, WorkItemType, NamespaceAvailableFeatures
What does this MR do and why?
Adds authorize_granular_token skip_reason: :parent_authorizes to four GraphQL types that were listed in config/authz/graphql/authorization_todo.txt without a granular token directive. Each type is only reachable through a parent type that already declares its own authorize_granular_token directive, so skip_reason: :parent_authorizes is the correct annotation per the GPAT GraphQL implementation guide.
Types updated:
WorkItemStatus(ee/app/graphql/types/work_items/status_type.rb) — reachable via three paths, each gated onread_work_item: (1)WorkItem → WorkItemWidgetStatus, where the parentWorkItemtype declaresread_work_item(project boundary); (2)Query.workItemAllowedStatuses, which carries its own field-levelgranular_scope_directive(read_work_item, user boundary); (3)Group.statuses(NamespaceType#statuses), whereGroupTypeonly gatesread_group, so the field carries its owngranular_scope_directive(read_work_item, group boundary).WorkItemType(app/graphql/types/work_items/type_type.rb) — child ofWorkItem,Group, andProjecttypes, all of which already declare their own granular token directives.WorkItemFeatures(app/graphql/types/work_items/features_type.rb) — child ofWorkItem; parentWorkItemtype already declaresread_work_itemwith project boundary.NamespaceAvailableFeatures(app/graphql/types/namespaces/available_features_type.rb) — child ofNamespaceType/GroupType, which declaresread_groupwith group boundary.
The four corresponding entries are removed from authorization_todo.txt.
References
Screenshots or screen recordings
N/A — no UI changes.
How to set up and validate locally
- Run
bundle exec rake gitlab:permissions:validateto confirm no validation errors for these four types. - Run the affected specs:
bin/rspec spec/requests/api/graphql/work_item_spec.rb -e "WorkItemType child type"bin/rspec ee/spec/requests/api/graphql/work_item_spec.rb -e "status widget"bin/rspec ee/spec/requests/api/graphql/namespaces/licensed_features_spec.rb -e "granular PAT"bin/rspec ee/spec/requests/api/graphql/namespace/statuses_spec.rb -e "granular PAT"bin/rspec ee/spec/requests/api/graphql/work_item_allowed_statuses_spec.rb -e "granular PAT"
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.
Edited by Marc Saleiko