koudaiii/qucli

create robots?

andrewrothstein opened this issue · 7 comments

is there a functionality to create robots? happy to try to add it if ur game. is there a better/different way?

Thank you for issue. Not yet 😢I’ll try this 🤔

030 commented

@andrewrothstein What kind of actions should the robots perform?

my goal was to manage robots from the cli. when I create a new repository on quay.io, I need to create the corresponding robot and extract its credentials for installation into my CI (travis). I wanted to get away from pointing and clicking through the quay.io web front end.

030 commented

@andrewrothstein I prefer this as well. Currently we have to create a lot of robot account manually and assigning the right permissions is even more tedious.

030 commented

@andrewrothstein I assume that you would like to create a robot account and assign permissions as well? Otherwise the robot account cannot access any repositories.

030 commented

@andrewrothstein Regarding the output. If a robot account has been created, what output do you expect from the tool, e.g. docker login -u="user" -p="token" so it could be issued on a machine?

030 commented

Create robot

curl -s -H "Authorization: Bearer ${QUAY_APP_TOKEN}" \
--header "Content-Type:application/json" -X PUT \
-d "{\"description\":\"Robot account created by bot\"}" \
"https://quay.io/api/v1/organization/some-org/robots/some-user"

Add permission

curl -s -H "Authorization: Bearer ${QUAY_APP_TOKEN}" \
--header "Content-Type:application/json" -X PUT \
-d "{\"role\":\"read\"}" \
"https://quay.io/api/v1/repository/some-org/some-repo/permissions/user/some-org+some-user"