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

Screenshots or screen recordings

Not applicable. This MR changes GraphQL token authorization and has no UI changes.

How to set up and validate locally

  1. Use a private project containing a pipeline and a user who can read its pipelines. Enable granular_personal_access_tokens for that user if needed in the development instance.
  2. Create a fine-grained token with project read_project and read_pipeline permissions. Query project(fullPath: "your-group/your-project") { pipelines { nodes { id } count(limit: 1000) pageInfo { endCursor hasNextPage } } }. Check that the pipeline and connection metadata are returned.
  3. Repeat with a token that has read_project but lacks read_pipeline for this project. Check that project is present and pipelines is null, without GraphQL errors.
  4. Repeat the denied request with only count(limit: 1000), then only pageInfo { endCursor hasNextPage }. Both selections must produce a null connection. A read_pipeline grant for another project must not authorize either request.
  5. 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.
  6. Compare with a legacy read_api token under the existing namespace token policy. Its access must retain the current behavior.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Aleksandr Kotlyar

Merge request reports

Loading
Loading