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 <jacob@okteto.com>
This commit is contained in:
Jacob MacElroy 2021-10-26 12:57:39 -06:00
parent 0d0fb68589
commit 9b4a6f1295

View File

@ -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")
}