@@ -31,7 +31,7 @@ const (
3131// authConfigKey is the key used to store credentials for Docker Hub. It is
3232// a copy of [registry.IndexServer].
3333//
34- // [registry.IndexServer]: https://pkg.go.dev/github.com/docker/docker/registry#IndexServer
34+ // [registry.IndexServer]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible /registry#IndexServer
3535const authConfigKey = "https://index.docker.io/v1/"
3636
3737// RegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info
@@ -68,6 +68,8 @@ func RegistryAuthenticationPrivilegedFunc(cli Cli, index *registrytypes.IndexInf
6868//
6969// It is similar to [registry.ResolveAuthConfig], but uses the credentials-
7070// store, instead of looking up credentials from a map.
71+ //
72+ // [registry.ResolveAuthConfig]: https://pkg.go.dev/github.com/docker/[email protected] +incompatible/registry#ResolveAuthConfig 7173func ResolveAuthConfig (cfg * configfile.ConfigFile , index * registrytypes.IndexInfo ) registrytypes.AuthConfig {
7274 configKey := index .Name
7375 if index .Official {
@@ -194,12 +196,12 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
194196 }, nil
195197}
196198
197- // RetrieveAuthTokenFromImage retrieves an encoded auth token given a complete
198- // image. The auth configuration is serialized as a base64url encoded RFC4648,
199- // section 5) JSON string for sending through the X-Registry-Auth header.
199+ // RetrieveAuthTokenFromImage retrieves an encoded auth token given a
200+ // complete image reference. The auth configuration is serialized as a
201+ // base64url encoded ([RFC 4648, Section 5]) JSON string for sending through
202+ // the "X-Registry-Auth" header.
200203//
201- // For details on base64url encoding, see:
202- // - RFC4648, section 5: https://tools.ietf.org/html/rfc4648#section-5
204+ // [RFC 4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5
203205func RetrieveAuthTokenFromImage (cfg * configfile.ConfigFile , image string ) (string , error ) {
204206 // Retrieve encoded auth token from the image reference
205207 authConfig , err := resolveAuthConfigFromImage (cfg , image )
@@ -233,8 +235,8 @@ func resolveAuthConfigFromImage(cfg *configfile.ConfigFile, image string) (regis
233235// It is similar to [registry.GetAuthConfigKey], but does not require on
234236// [registrytypes.IndexInfo] as intermediate.
235237//
236- // [registry.GetAuthConfigKey]: https://pkg.go.dev/github.com/docker/docker/registry#GetAuthConfigKey
237- // [registrytypes.IndexInfo]:https://pkg.go.dev/github.com/docker/docker/api/types/registry#IndexInfo
238+ // [registry.GetAuthConfigKey]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible /registry#GetAuthConfigKey
239+ // [registrytypes.IndexInfo]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible /api/types/registry#IndexInfo
238240func getAuthConfigKey (domainName string ) string {
239241 if domainName == "docker.io" || domainName == "index.docker.io" {
240242 return authConfigKey
0 commit comments