mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 15:27:16 +02:00
Upgrade dependency to go-containerregistry third-party library
By doing so it will fix issues met when mixing source/remote registry Close #808
This commit is contained in:
+5
-9
@@ -14,11 +14,6 @@
|
||||
|
||||
package authn
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Basic implements Authenticator for basic authentication.
|
||||
type Basic struct {
|
||||
Username string
|
||||
@@ -26,8 +21,9 @@ type Basic struct {
|
||||
}
|
||||
|
||||
// Authorization implements Authenticator.
|
||||
func (b *Basic) Authorization() (string, error) {
|
||||
delimited := fmt.Sprintf("%s:%s", b.Username, b.Password)
|
||||
encoded := base64.StdEncoding.EncodeToString([]byte(delimited))
|
||||
return fmt.Sprintf("Basic %s", encoded), nil
|
||||
func (b *Basic) Authorization() (*AuthConfig, error) {
|
||||
return &AuthConfig{
|
||||
Username: b.Username,
|
||||
Password: b.Password,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user