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

a robot user without permissions breaks the frontend code on the project -> robot user tab #21233

Open
rmalchow opened this issue Nov 22, 2024 · 2 comments
Assignees

Comments

@rmalchow
Copy link

If you are reporting a problem, please make sure the following information are provided:

Expected behavior and actual behavior:
a robot user without permissions breaks the frontend code on the project -> robot user tab

Steps to reproduce the problem:
create a robot user without selecting any permissions. then leave the tab and go back to it.

Versions:

  • harbor version: 2.11.0, 2.11.1, 2.12.0
  • docker engine version: not docker related
  • docker-compose version: not docker related

Additional context:

inspect -> console in the browser give: "s.permissions[0] is undefined"

@wy65701436
Copy link
Contributor

hi @rmalchow

I'm trying to better understand this case. Could you please provide more detailed steps or clarification on how the issue occurred?

@rmalchow
Copy link
Author

hi yan,

thanks for asking. i tried to reproduce it - but i am unable to reproduce the basic situation, not even if i manually mess with the "finish" button in the "Create robot user" dialogue. it pretty thoroughly prevents me from creating any "empty" robot accounts (as in: without selecting permissions).

the basic situation (i honestly dont know how this was created) was this:

the call to

/api/v2.0/robots

returned this:

[ { "creation_time": "2024-07-05T10:48:30.896Z", "disable": false, "duration": -1, "editable": true, "expires_at": -1, "id": 7, "level": "project", "name": "robot$demo-ci", "permissions": [ # # THIS IS EMPTY # # ], "update_time": "2024-07-05T10:48:30.896Z" } ]

note the empty permissions list. the frontend then proceeds to directly access

permissions[0]

in the the list, which doesnt have any elements. so there the frontend fails with an error and stops rendering. a simple check before access should solve this & potentially make the UI a little bit more robust.

in our case, i actually had to remove the row from the database.

regards

.rm

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

No branches or pull requests

2 participants