Skip to content

GitLab app: no tool covers GET /api/v4/user, so whoami is always blocked even with full access #570

Description

@Anulo2

Summary

The GitLab app's permission catalog (16 tools) has no action covering
GET /api/v4/user. Any request to that endpoint falls into the connection
grant's "everything else" fallback, which is always blocked. Many GitLab
clients (MCP servers, glab, SDK validators) call /api/v4/user on startup
to verify the token, so the integration fails even when the grant is fully
permissive.

Reproduction

  1. Attach a GitLab connection to an agent with --allow on all 7 read tools
    (or even with no tool flags = full access).
  2. Run through the gateway:
    curl https://<gitlab-host>/api/v4/user
  3. Result:
{"error":"blocked_by_policy",                                                                                                                                                                                                                                                                                          
"message":"Blocked by OneCLI policy rule \"Grant: ... : everything else\".                                                                                                                                                                                                                                            
GET /api/v4/user is not allowed."}                   

What I tested (all failed)

  • Grant with access: full → still blocked by the "everything else" fallback.
  • Published org policy rule allow with target
    {"kind":"network","hostPattern":"","pathPattern":"/api/v4/user*","method":"GET"}
    → ignored; connection-grant blocks take precedence.
  • Grant body only accepts access/allow/ask — no path-level exceptions possible.

Feature request

Add a read-only tool to the GitLab permission catalog, e.g.:

  • id: get_current_user
  • name: "Get authenticated user"
  • maps to: GET /api/v4/user (and possibly /api/v4/user token validation)

Environment

  • Dashboard v2.6.0, CLI v2.11.0

Activity

  1. Anulo2 commented on Sep 17, 2026

    @Anulo2
    Author

    A similar issue applies also to the issues global api endpoint

  2. Mohil-Ahuja commented on Oct 26, 2026

    @Mohil-Ahuja

    I'd like to take this one.

    Plan: add a read-only get_current_user tool to the GitLab permission catalog mapping GET /api/v4/user, so token-validation/whoami calls resolve to a read tool instead of the always-blocked "everything else" fallback. The write side stays covered by the existing write_all wildcard (POST/PUT/PATCH/DELETE on /api/v4/*), so read/write separation is preserved. I'll include a regression test asserting GET gitlab.com/api/v4/user resolves to get_current_user.

    PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions