mirror of
https://github.com/containers/podman.git
synced 2025-09-18 07:51:22 +08:00
Remove pkg/auth.Header
It is no longer used. Split the existing tests into MakeXRegistryConfigHeader and MakeXRegistryAuthHeader variants. For now we don't modify the implementations at all, to make review simpler; cleanups will follow. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@ -3,7 +3,6 @@ package auth
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
@ -143,18 +142,6 @@ func getAuthCredentials(headers []string) (*types.DockerAuthConfig, map[string]t
|
||||
return &authConfig, nil, nil
|
||||
}
|
||||
|
||||
// Header builds the requested Authentication Header
|
||||
func Header(sys *types.SystemContext, headerName HeaderAuthName, authfile, username, password string) (map[string]string, error) {
|
||||
switch headerName {
|
||||
case XRegistryAuthHeader:
|
||||
return MakeXRegistryAuthHeader(sys, authfile, username, password)
|
||||
case XRegistryConfigHeader:
|
||||
return MakeXRegistryConfigHeader(sys, authfile, username, password)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported authentication header: %q", headerName)
|
||||
}
|
||||
}
|
||||
|
||||
// MakeXRegistryConfigHeader returns a map with the XRegistryConfigHeader set which can
|
||||
// conveniently be used in the http stack.
|
||||
func MakeXRegistryConfigHeader(sys *types.SystemContext, authfile, username, password string) (map[string]string, error) {
|
||||
|
Reference in New Issue
Block a user