Skip to content

Respect additional authorization token field #174

@sjahreis

Description

@sjahreis

Docker specifies the following token headers during registry authorization:

  • token: An opaque Bearer token that clients should supply to subsequent requests in the Authorization header.
  • access_token: For compatibility with OAuth 2.0, we will also accept token under the name access_token. At least one of these fields must be specified, but both may also appear (for compatibility with older clients). When both are specified, they should be equivalent; if they differ the client's choice is undefined.

See https://github.com/docker/distribution/blob/master/docs/spec/auth/token.md#token-response-fields for more details.

The bundle-lib only accepts the access_token field. See https://github.com/automationbroker/bundle-lib/blob/master/registries/adapters/oauth/client.go#L35-L37 and https://github.com/automationbroker/bundle-lib/blob/master/registries/adapters/oauth/client.go#L191 for more details.

But registries like Artifactory or Harbor send their token in the field token. Therewith we couldn't connect them with the Automation Broker.

I'll create a PR which respects the additional token field token as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions