Backport of 'Pre-approve GitLab MCP server read tools in the token claim'

What does this MR do and why?

Backport of !247872 (merged) combined with !247570 (merged), fixing #607151 on 19.1.

The Duo Workflow Service treats the tool_access_policies claim's allow list as a ceiling. Once the claim is present it replaces the pre-approved list Workhorse sent, so a tool missing from the claim prompts for approval even though Workhorse marked it pre-approved.

19.1 is worse off than 19.2. It has no preapproved_tool_names method at all, and the ws endpoint sends only the resolution service verdict, so neither Orbit nor GitLab MCP tools reach the claim and every one of them prompts. 19.2 got the Orbit half via !247676 (merged); 19.1 did not.

Written rather than cherry-picked, because the method does not exist here to patch. Both halves are added, prefixed per MCP server (gitlab_ and orbit_) since that is how Workhorse and DWS address them. The claim list is derived (GITLAB_PREAPPROVED_TOOLS minus GITLAB_TOOL_ALIASES) so it follows this branch's Workhorse list, giving 13 names here.

Deliberately omitted: the ask_tools hunk from !247570 (merged). Permissions::ASK does not exist on this branch, nothing consumes ask_tools here, and I checked that none of the names we append collides with the governable names as they are emitted — 12 catalog tools do start with gitlab_ on this branch, but none overlaps ours, so a subtraction would be a no-op.

One spec assertion is loosened: the existing example pinned tool_access_policies to an exact JSON string, which the appended names break. It now asserts the property it cares about, and a second example asserts the prefixed GitLab names arrive.

Related to !247872 (merged), !247570 (merged), !247676 (merged)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Rahul Barnwal

Merge request reports

Loading