Skip to content

Group Service Account API POST only works with group ids but not with URL encoded path #3108

@zapp42

Description

@zapp42

Description of the problem, including code/CLI snippet

I want to create a group service account on a self-hosted premium instance.

I have a top-level group named "user" with the group id 512.

The following command works:
curl --request POST --header "PRIVATE-TOKEN: secret-token" "https://git.example.com/api/v4/groups/512/service_accounts"

=> {"id":308,"username":"service_account_group_512_3a8565725ac3330996b803e2cab6d908","name":"Service account user"}

This one does not work:
curl --request POST --header "PRIVATE-TOKEN: secret-token" "https://git.example.com/api/v4/groups/user/service_accounts"
=> {"message":"400 Bad request - User does not have permission to create a service account in this namespace."}

Expected Behavior

Endpoint works with id and url-encoded-path.

Actual Behavior

Endpoint only works with id.

Specifications

  • Gitlab server version (or gitlab.com): 17.8.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions