Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bearer authentication #4

Open
a3957273 opened this issue Oct 15, 2022 · 0 comments
Open

Support bearer authentication #4

a3957273 opened this issue Oct 15, 2022 · 0 comments

Comments

@a3957273
Copy link

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
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant