@@ -26,10 +26,10 @@ import (
2626 "github.com/containerd/containerd/reference"
2727)
2828
29- // repositoryScope returns a repository scope string such as "repository:foo/bar:pull"
29+ // RepositoryScope returns a repository scope string such as "repository:foo/bar:pull"
3030// for "host/foo/bar:baz".
3131// When push is true, both pull and push are added to the scope.
32- func repositoryScope (refspec reference.Spec , push bool ) (string , error ) {
32+ func RepositoryScope (refspec reference.Spec , push bool ) (string , error ) {
3333 u , err := url .Parse ("dummy://" + refspec .Locator )
3434 if err != nil {
3535 return "" , err
@@ -45,9 +45,9 @@ func repositoryScope(refspec reference.Spec, push bool) (string, error) {
4545// value: []string (e.g. {"registry:foo/bar:pull"})
4646type tokenScopesKey struct {}
4747
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 )
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 )
5151 if err != nil {
5252 return nil , err
5353 }
@@ -66,9 +66,9 @@ func WithScope(ctx context.Context, scope string) context.Context {
6666 return context .WithValue (ctx , tokenScopesKey {}, scopes )
6767}
6868
69- // contextWithAppendPullRepositoryScope is used to append repository pull
69+ // ContextWithAppendPullRepositoryScope is used to append repository pull
7070// scope into existing scopes indexed by the tokenScopesKey{}.
71- func contextWithAppendPullRepositoryScope (ctx context.Context , repo string ) context.Context {
71+ func ContextWithAppendPullRepositoryScope (ctx context.Context , repo string ) context.Context {
7272 return WithScope (ctx , fmt .Sprintf ("repository:%s:pull" , repo ))
7373}
7474
0 commit comments