set the scopes correctly (#368)
This commit is contained in:
parent
8ca50f24f3
commit
14220d9833
1 changed files with 6 additions and 1 deletions
|
@ -48,7 +48,12 @@ func (r AuthRedirect) URL() (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s?service=%s&scope=%s&ts=%d&nonce=%s", r.Realm, r.Service, r.Scope, time.Now().Unix(), nonce), nil
|
scopes := []string{}
|
||||||
|
for _, s := range strings.Split(r.Scope, " ") {
|
||||||
|
scopes = append(scopes, fmt.Sprintf("scope=%s", s))
|
||||||
|
}
|
||||||
|
scopeStr := strings.Join(scopes, "&")
|
||||||
|
return fmt.Sprintf("%s?service=%s&%s&ts=%d&nonce=%s", r.Realm, r.Service, scopeStr, time.Now().Unix(), nonce), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getAuthToken(ctx context.Context, redirData AuthRedirect, regOpts *RegistryOptions) (string, error) {
|
func getAuthToken(ctx context.Context, redirData AuthRedirect, regOpts *RegistryOptions) (string, error) {
|
||||||
|
|
Loading…
Reference in a new issue