This commit is contained in:
Jack Liu 2016-03-25 09:31:50 +08:00
parent 44b27e71c2
commit aa9fa581ec
5 changed files with 8 additions and 8 deletions

View File

@ -23,7 +23,7 @@ import (
"github.com/vmware/harbor/dao" "github.com/vmware/harbor/dao"
"github.com/vmware/harbor/models" "github.com/vmware/harbor/models"
svc_utils "github.com/vmware/harbor/service/utils" svc_utils "github.com/vmware/harbor/service/utils"
log "github.com/vmware/harbor/utils/log" "github.com/vmware/harbor/utils/log"
"github.com/astaxie/beego" "github.com/astaxie/beego"
) )

View File

@ -21,7 +21,7 @@ import (
"github.com/vmware/harbor/auth" "github.com/vmware/harbor/auth"
"github.com/vmware/harbor/models" "github.com/vmware/harbor/models"
svc_utils "github.com/vmware/harbor/service/utils" svc_utils "github.com/vmware/harbor/service/utils"
log "github.com/vmware/harbor/utils/log" "github.com/vmware/harbor/utils/log"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/docker/distribution/registry/auth/token" "github.com/docker/distribution/registry/auth/token"
@ -38,7 +38,7 @@ type TokenHandler struct {
func (a *TokenHandler) Get() { func (a *TokenHandler) Get() {
request := a.Ctx.Request request := a.Ctx.Request
log.Info("request url: " + request.URL.String()) log.Infof("request url: " + request.URL.String())
username, password, _ := request.BasicAuth() username, password, _ := request.BasicAuth()
authenticated := authenticate(username, password) authenticated := authenticate(username, password)
service := a.GetString("service") service := a.GetString("service")

View File

@ -25,7 +25,7 @@ import (
"time" "time"
"github.com/vmware/harbor/dao" "github.com/vmware/harbor/dao"
log "github.com/vmware/harbor/utils/log" "github.com/vmware/harbor/utils/log"
"github.com/docker/distribution/registry/auth/token" "github.com/docker/distribution/registry/auth/token"
"github.com/docker/libtrust" "github.com/docker/libtrust"

View File

@ -20,7 +20,7 @@ import (
"time" "time"
"github.com/vmware/harbor/models" "github.com/vmware/harbor/models"
log "github.com/vmware/harbor/utils/log" "github.com/vmware/harbor/utils/log"
"github.com/astaxie/beego/cache" "github.com/astaxie/beego/cache"
) )

View File

@ -23,7 +23,7 @@ import (
"os" "os"
"strings" "strings"
log "github.com/vmware/harbor/utils/log" "github.com/vmware/harbor/utils/log"
) )
// BuildRegistryURL ... // BuildRegistryURL ...
@ -35,7 +35,7 @@ func BuildRegistryURL(segments ...string) string {
url := registryURL + "/v2" url := registryURL + "/v2"
for _, s := range segments { for _, s := range segments {
if s == "v2" { if s == "v2" {
log.Infof("unnecessary v2 in %v", segments) log.Debugf("unnecessary v2 in %v", segments)
continue continue
} }
url += "/" + s url += "/" + s
@ -60,7 +60,7 @@ func RegistryAPIGet(url, username string) ([]byte, error) {
} else if response.StatusCode == http.StatusUnauthorized { } else if response.StatusCode == http.StatusUnauthorized {
authenticate := response.Header.Get("WWW-Authenticate") authenticate := response.Header.Get("WWW-Authenticate")
str := strings.Split(authenticate, " ")[1] str := strings.Split(authenticate, " ")[1]
log.Info("url: " + url) log.Debugf("url: " + url)
var service string var service string
var scope string var scope string
strs := strings.Split(str, ",") strs := strings.Split(str, ",")