Skip to content

Support bearer authentication #4

Description

@a3957273

To comply with allowing minimum permissions, we'd like to be able to authenticate to our docker registry with a token that provides the access to just push to a single namespace. The registry lets you generate tokens with specific scopes as JWT tokens. It would be useful if this library allowed the user to provide an already generated JWT bearer token that it would use for authentication.

e.g.

const namespace = 'internal'
const image = 'nginx'

# user provided function for generating a token
const token = await generateAccessToken([{ type: 'repository', name: `${namespace}/${image}`, actions: ['push', 'pull'] }])

const options: DockerTarPusherOptions = {
  registryUrl: 'http://localhost:5000',
  ...
  auth: {
    token
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions