Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making a robot via /projects/{project_name_or_id}/robots is broken #20692

Open
Kajot-dev opened this issue Jul 3, 2024 · 3 comments
Open

Making a robot via /projects/{project_name_or_id}/robots is broken #20692

Kajot-dev opened this issue Jul 3, 2024 · 3 comments
Assignees

Comments

@Kajot-dev
Copy link

This endpoint does not parse permissions correctly:
Try to create a robot in your project via /projects/{project_name_or_id}/robots with this payload:

{
  "name": "puller",
  "description": "Project puller. Created automatically.",
  "expires_at": -1,
  "access": [
    {
      "resource": "repository",
      "action": "pull",
      "effect": null
    }
  ]
}

This returns 400 with pull action of repository resource not exist in project <project_name>

However creating exactly the same robot via /robots endpoint works perfectly. Working payload:

{
  "name": "puller",
  "description": "Project puller. Created automatically.",
  "level": "project",
  "duration": -1,
  "permissions": [
    {
      "access": [
        {
          "resource": "repository",
          "action": "pull",
          "effect": null
        }
      ],
      "kind": "project",
      "namespace": "<project_name>"
    }
  ]
}
@wy65701436
Copy link
Contributor

can you clarify the problem? It seems that the creation was successfully with the correct payload.

@wy65701436 wy65701436 self-assigned this Jul 8, 2024
@Kajot-dev
Copy link
Author

Payload is correct in both examples (it is different since it uses different api ednpoints). But endpoint /robots works, but /projects/{project_name_or_id}/robots does not.

It should succeed in both examples.

@Kajot-dev
Copy link
Author

To reproduce just try to create a robot via /projects/{project_name_or_id}/robots (a one which haves some permissions) - it's not possible from my testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants