From 9b4a6f129517e353de70b824d78c755605eb84f6 Mon Sep 17 00:00:00 2001 From: Jacob MacElroy Date: Tue, 26 Oct 2021 12:57:39 -0600 Subject: [PATCH] Generate token options with each scope as a separate string. Currently scopes added to token options are added with all scopes included in space delimited string. This changes it so that each scope is added to the string slice as a separate string. This seems to be the desire behavior based on the fact that a string slice is used and the usage of this function in github.com/moby/buildkit. Signed-off-by: Jacob MacElroy --- remotes/docker/auth/fetch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remotes/docker/auth/fetch.go b/remotes/docker/auth/fetch.go index 8b0a87e75..02b995224 100644 --- a/remotes/docker/auth/fetch.go +++ b/remotes/docker/auth/fetch.go @@ -58,7 +58,7 @@ func GenerateTokenOptions(ctx context.Context, host, username, secret string, c scope, ok := c.Parameters["scope"] if ok { - to.Scopes = append(to.Scopes, scope) + to.Scopes = append(to.Scopes, strings.Split(scope, " ")...) } else { log.G(ctx).WithField("host", host).Debug("no scope specified for token auth challenge") }