oras icon indicating copy to clipboard operation
oras copied to clipboard

Make `--identity-token` an alias of `--password`

Open shizhMSFT opened this issue 2 years ago • 13 comments

What is the version of your ORAS CLI

v0.16.0

What would you like to be added?

Make --identity-token an alias of --password

Why is this needed for ORAS?

oras supports using identity token as the credential without a username.

The UX of oras login $REGISTRY --password $TOKEN does not seem good enough. It will be better if it is

oras login $REGISTRY --identity-token $TOKEN

Are you willing to submit PRs to contribute to this feature?

  • [ ] Yes, I am willing to implement it.

shizhMSFT avatar Jan 10 '23 14:01 shizhMSFT

What if a user mistakenly use oras login $REGISTRY --username $USERNAME --identity-token $TOKEN

qweeah avatar Jan 11 '23 01:01 qweeah

What if a user mistakenly use oras login $REGISTRY --username $USERNAME --identity-token $TOKEN

I think we should return error for this case.

shizhMSFT avatar Jan 20 '23 08:01 shizhMSFT

I would like to work on this

rafiya2003 avatar Jun 06 '23 05:06 rafiya2003

@rafiya2003 If you have any questions, feel free to join oras slack and ping me

qweeah avatar Jun 07 '23 06:06 qweeah

Not all registry support token refreshing from identity token to registry token. E.g. ghcr returns 405 for token refreshing.

@shizhMSFT We should also add a flag --registry-token allow user to use registry token in oras commands.

qweeah avatar Jun 07 '23 06:06 qweeah

Not all registry support token refreshing from identity token to registry token. E.g. ghcr returns 405 for token refreshing.

@shizhMSFT We should also add a flag --registry-token allow user to use registry token in oras commands.

That can be another issue and I noticed that you have created one #968

shizhMSFT avatar Jun 07 '23 07:06 shizhMSFT

I have completed the implementation. Will try to push it soon,

sbdtu5498 avatar Jun 27 '23 22:06 sbdtu5498

@sbdtu5498 Any update on this?

qweeah avatar Jul 12 '23 05:07 qweeah

Oh sorry for the delays. I was busy with some other stuff and left the task hanging. Will push it before Monday.

sbdtu5498 avatar Jul 14 '23 09:07 sbdtu5498

@shizhMSFT Do we also need --registry-token-stdin?

qweeah avatar Aug 01 '23 12:08 qweeah

@shizhMSFT Do we also need --registry-token-stdin?

SGTM but is that --identity-token-stdin?

shizhMSFT avatar Aug 01 '23 15:08 shizhMSFT

@sbdtu5498 So we need to add another flag to enable read identity token from stdin like:

echo $TOKEN | oras login $REGISTRY --identity-token-stdin 

qweeah avatar Aug 03 '23 02:08 qweeah

Sure, will do it ASAP. Sorry for the delayed response.

sbdtu5498 avatar Aug 06 '23 23:08 sbdtu5498