registry: parse INDEXSERVERADDRESS into a URL for easier check in isSecure
Signed-off-by: Tibor Vass <teabee89@gmail.com>
This commit is contained in:
parent
cca910e878
commit
f0920e61bf
4 changed files with 18 additions and 9 deletions
10
docs/auth.go
10
docs/auth.go
|
@ -7,6 +7,7 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
@ -27,8 +28,17 @@ const (
|
|||
|
||||
var (
|
||||
ErrConfigFileMissing = errors.New("The Auth config file is missing")
|
||||
IndexServerURL *url.URL
|
||||
)
|
||||
|
||||
func init() {
|
||||
url, err := url.Parse(INDEXSERVER)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
IndexServerURL = url
|
||||
}
|
||||
|
||||
type AuthConfig struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue