Skip to content

Add --registry-token flag #968

Closed
Closed

Description

@qweeah

What is the version of your ORAS CLI

v1.0.0

What would you like to be added?

Similar to #742, we can add a new flag --registry-token so user can use registry token directly when accessing remote registries.

Why is this needed for ORAS?

Not all registry supports token refreshing.
For example. ghcr returns 405 for POST requests sent torwards https://ghcr.io/token.

If a registry doesn’t support token refreshing but its user still wants to use a token to access it. They can use registry token and passed it via the proposed flag like

 oras pull $IMAGE --registry-token $TOKEN

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

  • Yes, I am willing to implement it.

Activity

  1. added
    enhancement
    on Jun 7, 2023
  2. sbdtu5498 commented on Jun 27, 2023

    @sbdtu5498

    /assign

  3. added this to the v1.2.0 milestone on Jun 28, 2023
  4. added
    question
    on Jun 28, 2023
  5. removed this from the v1.2.0 milestone on Jun 28, 2023
  6. shizhMSFT commented on Jun 28, 2023

    @shizhMSFT
    Contributor

    Registry token is known as access token, which is used per repository with scope like repository:hello-world:pull,push, registry:catalog:*. It is strange and not useful to use the same access token across repositories.

  7. sajayantony commented on Jun 28, 2023

    @sajayantony
    Contributor

    Is this just the authorization header?

  8. sbdtu5498 commented on Jun 28, 2023

    @sbdtu5498

    Registry token is known as access token, which is used per repository with scope like repository:hello-world:pull,push, registry:catalog:*. It is strange and not useful to use the same access token across repositories.

    It should be noted that registry token are not only limited to a repository, it can also be used to access whole registry just like github tokens. And for the particular usecase that you just mentioned, how about fetching permission metadata and storing it locally to know which registry token is for what purpose.

  9. qweeah commented on Jun 30, 2023

    @qweeah
    ContributorAuthor

    Is this just the authorization header?

    @sajayantony Related to authorization header, but in essence it's about workflow. ORAS now supports below token exchange workflow:

    1. Use the refresh token or username password to obtain a registry token
    2. Use the registry token to do operation

    I found this while trouble shooting an issue: I need to keep using the same registry token to do an operation. After several tries, I found that ORAS CLI doesn't support skipping step 1 and run 2 directly. So, I created an issue. Not sure if it's a common use case and should we support it in oras @FeynmanZhou

  10. sajayantony commented on Jun 30, 2023

    @sajayantony
    Contributor

    The term was confusing. So it sounds like a refresh token or an access token. Overall is sounds like a debug only scenario. Also I would like to get the actual use case since I’m not seeing the value yet besides folks who want to debug the registry.

  11. sbdtu5498 commented on Jun 30, 2023

    @sbdtu5498

    So, @sajayantony @qweeah @shizhMSFT should we drop the plan adding this feature altogether or does it have any benefits. Can it be supported with the current feature that ORAS has. And would it be beneficial.

  12. shizhMSFT commented on Jul 3, 2023

    @shizhMSFT
    Contributor

    I think we should drop it except we have a clear user scenario.

    Meanwhile, this debug function can be achieved by the following command as a workaround:

    oras repo ls -H "Authorization: Bearer $registry_token" $registry
  13. shizhMSFT commented on Aug 1, 2023

    @shizhMSFT
    Contributor

    Closing this issue due to lack of clear user scenarios.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementquestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions