goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.94k stars 4.74k forks source link

Temporary Access Token for a Robot Account #18595

Open raviranjandutta opened 1 year ago

raviranjandutta commented 1 year ago

I'm trying to get a temporary access token of robot account for docker login through cli so that i can push or pull image.

my question is : 1> is it possible to get temp access token. if yes, what is the curl to get that. if there is any example or document i can check at.

FYI, I'm running a harbor container in local.

thank you

raviranjandutta commented 1 year ago

harbor version is latest docker image

raviranjandutta commented 1 year ago

does someone has answer for this. please comment

wy65701436 commented 1 year ago

no, harbor doesn't provide temp access token for robot account. I will make this as a feature request.

nidhey27 commented 1 year ago

By temporary access token, You mean an access token that would have an expiration time, ensuring that the token is only valid for a certain period of time. @raviranjandutta @wy65701436

raviranjandutta commented 1 year ago

yes have some expiration time say a min something

raviranjandutta commented 1 year ago

i am trying to docker login by robotacct and its password but it doesn't allow me to login. is that the expected behavior. i want to push/pull the image using docker cli.

nidhey27 commented 1 year ago

I'm interested to work on this feature.

wy65701436 commented 2 months ago

By temporary access token, You mean an access token that would have an expiration time, ensuring that the token is only valid for a certain period of time. @raviranjandutta @wy65701436

yes, the current workaround is pretty much what you suggested.

wy65701436 commented 3 weeks ago

I'm interested to work on this feature.

You can file the proposal firstly at goharbor/community, and then the maintainers will take effort to review it.

nidhey27 commented 3 weeks ago

@wy65701436 Please allow me some time to work on this. It's been more than a year since I last looked into the code, so I need to get familiar with it again before filing the proposal.