-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use container image repo client from go-containerregistry (#…
…2018) Signed-off-by: Kent Rancourt <[email protected]> Co-authored-by: Hidde Beydals <[email protected]>
- Loading branch information
Showing
19 changed files
with
685 additions
and
1,365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,12 @@ | ||
package image | ||
|
||
import "net/url" | ||
|
||
// Credentials represents the credentials for connecting to a private image | ||
// repository. It implements the | ||
// distribution/V3/registry/client/auth.CredentialStore interface. | ||
// repository. | ||
type Credentials struct { | ||
// Username identifies a principal, which combined with the value of the | ||
// Password field, can be used for reading from some image repository. | ||
Username string | ||
// Password, when combined with the principal identified by the Username | ||
// field, can be used for reading from some image repository. | ||
Password string | ||
refreshTokens map[string]string | ||
} | ||
|
||
// Basic implements distribution/V3/registry/client/auth.CredentialStore. | ||
func (c Credentials) Basic(*url.URL) (string, string) { | ||
return c.Username, c.Password | ||
} | ||
|
||
// RefreshToken implements distribution/V3/registry/client/auth.CredentialStore. | ||
func (c Credentials) RefreshToken(_ *url.URL, service string) string { | ||
return c.refreshTokens[service] | ||
} | ||
|
||
// SetRefreshToken implements | ||
// distribution/V3/registry/client/auth.CredentialStore. | ||
func (c Credentials) SetRefreshToken(_ *url.URL, service, token string) { | ||
if c.refreshTokens != nil { | ||
c.refreshTokens[service] = token | ||
} | ||
Password string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.