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 reading credentials from file store #15

Open
Tracked by #11
jonesbusy opened this issue Oct 4, 2024 · 4 comments · May be fixed by #56
Open
Tracked by #11

Support reading credentials from file store #15

jonesbusy opened this issue Oct 4, 2024 · 4 comments · May be fixed by #56
Labels
enhancement New feature or request
Milestone

Comments

@jonesbusy
Copy link
Collaborator

No description provided.

@jonesbusy jonesbusy mentioned this issue Oct 4, 2024
29 tasks
@jonesbusy jonesbusy added the enhancement New feature or request label Oct 4, 2024
@jonesbusy jonesbusy added this to the 1.0.0 milestone Oct 4, 2024
@AayushSaini101
Copy link
Contributor

@jonesbusy Does the credentials means only username and password from the file store ? or any kind of token we need to read from the file store, https://github.com/oras-project/oras-go/blob/main/registry/remote/credentials/file_store.go i checked oras-go

  • readCredentials ()
  • validateCredentialFormat()
  • saveCredentails()
  • createFileStore()
    these are the methods are mainly present in the go library

@jonesbusy
Copy link
Collaborator Author

@AayushSaini101 I do not know the possible format. I didn't check the implementation. But a common use case to doing a "docker login" before. Then the SDK would reuse such credentials

@AayushSaini101
Copy link
Contributor

@AayushSaini101 I do not know the possible format. I didn't check the implementation. But a common use case to doing a "docker login" before. Then the SDK would reuse such credentials

yes, seems
// FileStore implements a credentials store using the docker configuration file
// to keep the credentials in plain-text.
//
// Reference: https://docs.docker.com/engine/reference/commandline/cli/#docker-cli-configuration-file-configjson-propertie

@AayushSaini101
Copy link
Contributor

AayushSaini101 commented Jan 26, 2025

Basically we use config.json to access the credentials in the format of username: password, reference https://github.com/oras-project/oras-go/blob/bb3d17803e9670f688387f14739e0e94ab35299f/registry/remote/credentials/file_store.go#L91 @jonesbusy

// Username and password will be encoded in the base64(username:password)
// format in the file. The decoded result will be wrong if username
// contains colon(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants