ContextWithRepositoryScope returns a context with tokenScopesKey{} and the repository scope value.
(ctx context.Context, refspec reference.Spec, push bool)
| 47 | |
| 48 | // ContextWithRepositoryScope returns a context with tokenScopesKey{} and the repository scope value. |
| 49 | func ContextWithRepositoryScope(ctx context.Context, refspec reference.Spec, push bool) (context.Context, error) { |
| 50 | s, err := RepositoryScope(refspec, push) |
| 51 | if err != nil { |
| 52 | return nil, err |
| 53 | } |
| 54 | return WithScope(ctx, s), nil |
| 55 | } |
| 56 | |
| 57 | // WithScope appends a custom registry auth scope to the context. |
| 58 | func WithScope(ctx context.Context, scope string) context.Context { |
no test coverage detected
searching dependent graphs…