mirror of
https://github.com/containers/skopeo.git
synced 2025-06-26 06:42:21 +00:00
Merge pull request #1604 from containers/dependabot/go_modules/github.com/containers/common-0.47.5
Bump github.com/containers/common from 0.47.4 to 0.47.5
This commit is contained in:
commit
d0d7d97f9c
2
go.mod
2
go.mod
@ -4,7 +4,7 @@ go 1.15
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/containerd/containerd v1.6.1 // indirect
|
github.com/containerd/containerd v1.6.1 // indirect
|
||||||
github.com/containers/common v0.47.4
|
github.com/containers/common v0.47.5
|
||||||
github.com/containers/image/v5 v5.20.0
|
github.com/containers/image/v5 v5.20.0
|
||||||
github.com/containers/ocicrypt v1.1.3
|
github.com/containers/ocicrypt v1.1.3
|
||||||
github.com/containers/storage v1.39.0
|
github.com/containers/storage v1.39.0
|
||||||
|
4
go.sum
4
go.sum
@ -294,8 +294,8 @@ github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtr
|
|||||||
github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM=
|
github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM=
|
||||||
github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8=
|
github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8=
|
||||||
github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE=
|
github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE=
|
||||||
github.com/containers/common v0.47.4 h1:kS202Z/bTQIM/pwyuJ+lF8143Uli6AB9Q9OVR0xa9CM=
|
github.com/containers/common v0.47.5 h1:Qm9o+wVPO9sbggTKubN3xYMtPRaPv7dmcrJQgongHHw=
|
||||||
github.com/containers/common v0.47.4/go.mod h1:HgX0mFXyB0Tbe2REEIp9x9CxET6iSzmHfwR6S/t2LZc=
|
github.com/containers/common v0.47.5/go.mod h1:HgX0mFXyB0Tbe2REEIp9x9CxET6iSzmHfwR6S/t2LZc=
|
||||||
github.com/containers/image/v5 v5.19.1/go.mod h1:ewoo3u+TpJvGmsz64XgzbyTHwHtM94q7mgK/pX+v2SE=
|
github.com/containers/image/v5 v5.19.1/go.mod h1:ewoo3u+TpJvGmsz64XgzbyTHwHtM94q7mgK/pX+v2SE=
|
||||||
github.com/containers/image/v5 v5.20.0 h1:BYFMRvYqmEHnHo0sjTbnLbj0fzkGLDx6P57lszm30B4=
|
github.com/containers/image/v5 v5.20.0 h1:BYFMRvYqmEHnHo0sjTbnLbj0fzkGLDx6P57lszm30B4=
|
||||||
github.com/containers/image/v5 v5.20.0/go.mod h1:5UL1ooih6+USVYXk19r8ScQNsbTprhlJxrHezAu4OVE=
|
github.com/containers/image/v5 v5.20.0/go.mod h1:5UL1ooih6+USVYXk19r8ScQNsbTprhlJxrHezAu4OVE=
|
||||||
|
52
vendor/github.com/containers/common/pkg/auth/auth.go
generated
vendored
52
vendor/github.com/containers/common/pkg/auth/auth.go
generated
vendored
@ -4,6 +4,7 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -165,20 +166,21 @@ func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginO
|
|||||||
// parseCredentialsKey turns the provided argument into a valid credential key
|
// parseCredentialsKey turns the provided argument into a valid credential key
|
||||||
// and computes the registry part.
|
// and computes the registry part.
|
||||||
func parseCredentialsKey(arg string, acceptRepositories bool) (key, registry string, err error) {
|
func parseCredentialsKey(arg string, acceptRepositories bool) (key, registry string, err error) {
|
||||||
|
// URL arguments are replaced with their host[:port] parts.
|
||||||
|
key, err = replaceURLByHostPort(arg)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
split := strings.Split(key, "/")
|
||||||
|
registry = split[0]
|
||||||
|
|
||||||
if !acceptRepositories {
|
if !acceptRepositories {
|
||||||
registry = getRegistryName(arg)
|
return registry, registry, nil
|
||||||
key = registry
|
|
||||||
return key, registry, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
key = trimScheme(arg)
|
// Return early if the key isn't namespaced or uses an http{s} prefix.
|
||||||
if key != arg {
|
|
||||||
return "", "", errors.New("credentials key has https[s]:// prefix")
|
|
||||||
}
|
|
||||||
|
|
||||||
registry = getRegistryName(key)
|
|
||||||
if registry == key {
|
if registry == key {
|
||||||
// The key is not namespaced
|
|
||||||
return key, registry, nil
|
return key, registry, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,24 +204,18 @@ func parseCredentialsKey(arg string, acceptRepositories bool) (key, registry str
|
|||||||
return key, registry, nil
|
return key, registry, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// getRegistryName scrubs and parses the input to get the server name
|
// If the specified string starts with http{s} it is replaced with it's
|
||||||
func getRegistryName(server string) string {
|
// host[:port] parts; everything else is stripped. Otherwise, the string is
|
||||||
// removes 'http://' or 'https://' from the front of the
|
// returned as is.
|
||||||
// server/registry string if either is there. This will be mostly used
|
func replaceURLByHostPort(repository string) (string, error) {
|
||||||
// for user input from 'Buildah login' and 'Buildah logout'.
|
if !strings.HasPrefix(repository, "https://") && !strings.HasPrefix(repository, "http://") {
|
||||||
server = trimScheme(server)
|
return repository, nil
|
||||||
// gets the registry from the input. If the input is of the form
|
}
|
||||||
// quay.io/myuser/myimage, it will parse it and just return quay.io
|
u, err := url.Parse(repository)
|
||||||
split := strings.Split(server, "/")
|
if err != nil {
|
||||||
return split[0]
|
return "", fmt.Errorf("trimming http{s} prefix: %v", err)
|
||||||
}
|
}
|
||||||
|
return u.Host, nil
|
||||||
// trimScheme removes the HTTP(s) scheme from the provided repository.
|
|
||||||
func trimScheme(repository string) string {
|
|
||||||
// removes 'http://' or 'https://' from the front of the
|
|
||||||
// server/registry string if either is there. This will be mostly used
|
|
||||||
// for user input from 'Buildah login' and 'Buildah logout'.
|
|
||||||
return strings.TrimPrefix(strings.TrimPrefix(repository, "https://"), "http://")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getUserAndPass gets the username and password from STDIN if not given
|
// getUserAndPass gets the username and password from STDIN if not given
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -46,7 +46,7 @@ github.com/containerd/containerd/platforms
|
|||||||
# github.com/containerd/stargz-snapshotter/estargz v0.11.3
|
# github.com/containerd/stargz-snapshotter/estargz v0.11.3
|
||||||
github.com/containerd/stargz-snapshotter/estargz
|
github.com/containerd/stargz-snapshotter/estargz
|
||||||
github.com/containerd/stargz-snapshotter/estargz/errorutil
|
github.com/containerd/stargz-snapshotter/estargz/errorutil
|
||||||
# github.com/containers/common v0.47.4
|
# github.com/containers/common v0.47.5
|
||||||
## explicit
|
## explicit
|
||||||
github.com/containers/common/pkg/auth
|
github.com/containers/common/pkg/auth
|
||||||
github.com/containers/common/pkg/capabilities
|
github.com/containers/common/pkg/capabilities
|
||||||
|
Loading…
Reference in New Issue
Block a user