test(mcp): add granular token authorization coverage for save_pipeline_job

What does this MR do and why?

Adds granular token authorization coverage for the save_pipeline_job MCP tool.

  • Verifies that the tool enforces the required run_job, read_job, and read_pipeline permissions.
  • Adds a regression test ensuring that invoking the tool does not play a manual pipeline job.
  • Updates the MCP request to explicitly use JSON format.

Changelog: added

References

Closes #639861

Related implementation: !264879 (merged)

Screenshots or screen recordings

Not applicable — this MR contains automated request specs only.

How to set up and validate locally

Run the focused request spec:

bundle exec rspec spec/requests/api/mcp/granular_token_authorization_spec.rb

Test results:

  • 23 examples
  • 0 failures

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.

Merge request reports

Loading
Loading