Authorize project pipeline connections for fine-grained tokens
What does this MR do and why?
Authorize the Project.pipelines connection through the existing fine-grained token framework, including count-only and pageInfo-only requests. For a private project, a token that can read the project but lacks project read_pipeline receives a null pipeline connection.
Authorization behavior and review scope
The existing Pipeline type declares its token permission for pipeline nodes. This resolver declaration applies the same project permission before the connection exposes records, counts, or pagination metadata. Permission granted for another project does not authorize a private project's connection. Empty connections use the same check. The framework's existing anonymous-access bypass for public resources remains intact.
This change is independent of pipeline-name filtering and its feature flag. It was extracted following the review at !261346 (comment 4005240181). The name-specific build permission and count-limit validation remain in that feature MR. The database optimization is independent and can merge in either order with this MR.
The implementation uses the existing token authorization framework and permission. Legacy read_api tokens retain the existing behavior, including namespace enforcement of fine-grained tokens. The generated fine-grained GraphQL reference gains the Project.pipelines entry.
Application Security review is required before merging this authorization change. The MR remains Draft while that review and full CI are pending.
The standalone EE GraphQL request suite passed 72 examples with zero failures and two existing pending examples. Coverage includes missing and wrong-project permissions, count-only and pageInfo-only queries, empty projects, public access, restricted public CI/CD, and narrow legacy tokens. The permission reference was regenerated, both Ruby files passed RuboCop, and an independent code review found no blockers. Full CI and Application Security approval remain pending.
References
- Extraction request: !261346 (comment 4005240181).
- Name-filter feature: !261346 (merged).
- Independent database optimization: !262458 (merged).
Screenshots or screen recordings
Not applicable. This MR changes GraphQL token authorization and has no UI changes.
How to set up and validate locally
- Use a private project containing a pipeline and a user who can read its pipelines. Enable
granular_personal_access_tokensfor that user if needed in the development instance. - Create a fine-grained token with project
read_projectandread_pipelinepermissions. Queryproject(fullPath: "your-group/your-project") { pipelines { nodes { id } count(limit: 1000) pageInfo { endCursor hasNextPage } } }. Check that the pipeline and connection metadata are returned. - Repeat with a token that has
read_projectbut lacksread_pipelinefor this project. Check thatprojectis present andpipelinesis null, without GraphQL errors. - Repeat the denied request with only
count(limit: 1000), then onlypageInfo { endCursor hasNextPage }. Both selections must produce a null connection. Aread_pipelinegrant for another project must not authorize either request. - Repeat the denied request against an empty private project. Then compare a public project's anonymous-visible pipelines: public access must retain the framework's existing behavior.
- Compare with a legacy
read_apitoken under the existing namespace token policy. Its access must retain the current behavior.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.