@@ -391,7 +391,7 @@ func (r *Repository) ParseReference(reference string) (registry.Reference, error
391
391
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc3/spec.md#content-discovery
392
392
// - https://docs.docker.com/registry/spec/api/#tags
393
393
func (r * Repository ) Tags (ctx context.Context , last string , fn func (tags []string ) error ) error {
394
- ctx = auth .AppendScopeHints (ctx , r .Reference , auth .ActionPull )
394
+ ctx = auth .AppendRepositoryScope (ctx , r .Reference , auth .ActionPull )
395
395
url := buildRepositoryTagListURL (r .PlainHTTP , r .Reference )
396
396
var err error
397
397
for err == nil {
@@ -508,7 +508,7 @@ func (r *Repository) Referrers(ctx context.Context, desc ocispec.Descriptor, art
508
508
func (r * Repository ) referrersByAPI (ctx context.Context , desc ocispec.Descriptor , artifactType string , fn func (referrers []ocispec.Descriptor ) error ) error {
509
509
ref := r .Reference
510
510
ref .Reference = desc .Digest .String ()
511
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
511
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
512
512
513
513
url := buildReferrersURL (r .PlainHTTP , ref , artifactType )
514
514
var err error
@@ -642,7 +642,7 @@ func (r *Repository) pingReferrers(ctx context.Context) (bool, error) {
642
642
643
643
ref := r .Reference
644
644
ref .Reference = zeroDigest
645
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
645
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
646
646
647
647
url := buildReferrersURL (r .PlainHTTP , ref , "" )
648
648
req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
@@ -676,7 +676,7 @@ func (r *Repository) pingReferrers(ctx context.Context) (bool, error) {
676
676
func (r * Repository ) delete (ctx context.Context , target ocispec.Descriptor , isManifest bool ) error {
677
677
ref := r .Reference
678
678
ref .Reference = target .Digest .String ()
679
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionDelete )
679
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionDelete )
680
680
buildURL := buildRepositoryBlobURL
681
681
if isManifest {
682
682
buildURL = buildRepositoryManifestURL
@@ -712,7 +712,7 @@ type blobStore struct {
712
712
func (s * blobStore ) Fetch (ctx context.Context , target ocispec.Descriptor ) (rc io.ReadCloser , err error ) {
713
713
ref := s .repo .Reference
714
714
ref .Reference = target .Digest .String ()
715
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
715
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
716
716
url := buildRepositoryBlobURL (s .repo .PlainHTTP , ref )
717
717
req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
718
718
if err != nil {
@@ -754,12 +754,12 @@ func (s *blobStore) Fetch(ctx context.Context, target ocispec.Descriptor) (rc io
754
754
func (s * blobStore ) Mount (ctx context.Context , desc ocispec.Descriptor , fromRepo string , getContent func () (io.ReadCloser , error )) error {
755
755
// pushing usually requires both pull and push actions.
756
756
// Reference: https://github.com/distribution/distribution/blob/v2.7.1/registry/handlers/app.go#L921-L930
757
- ctx = auth .AppendScopeHints (ctx , s .repo .Reference , auth .ActionPull , auth .ActionPush )
757
+ ctx = auth .AppendRepositoryScope (ctx , s .repo .Reference , auth .ActionPull , auth .ActionPush )
758
758
759
759
// We also need pull access to the source repo.
760
760
fromRef := s .repo .Reference
761
761
fromRef .Repository = fromRepo
762
- ctx = auth .AppendScopeHints (ctx , fromRef , auth .ActionPull )
762
+ ctx = auth .AppendRepositoryScope (ctx , fromRef , auth .ActionPull )
763
763
764
764
url := buildRepositoryBlobMountURL (s .repo .PlainHTTP , s .repo .Reference , desc .Digest , fromRepo )
765
765
req , err := http .NewRequestWithContext (ctx , http .MethodPost , url , nil )
@@ -832,7 +832,7 @@ func (s *blobStore) Push(ctx context.Context, expected ocispec.Descriptor, conte
832
832
// start an upload
833
833
// pushing usually requires both pull and push actions.
834
834
// Reference: https://github.com/distribution/distribution/blob/v2.7.1/registry/handlers/app.go#L921-L930
835
- ctx = auth .AppendScopeHints (ctx , s .repo .Reference , auth .ActionPull , auth .ActionPush )
835
+ ctx = auth .AppendRepositoryScope (ctx , s .repo .Reference , auth .ActionPull , auth .ActionPush )
836
836
url := buildRepositoryBlobUploadURL (s .repo .PlainHTTP , s .repo .Reference )
837
837
req , err := http .NewRequestWithContext (ctx , http .MethodPost , url , nil )
838
838
if err != nil {
@@ -933,7 +933,7 @@ func (s *blobStore) Resolve(ctx context.Context, reference string) (ocispec.Desc
933
933
if err != nil {
934
934
return ocispec.Descriptor {}, err
935
935
}
936
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
936
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
937
937
url := buildRepositoryBlobURL (s .repo .PlainHTTP , ref )
938
938
req , err := http .NewRequestWithContext (ctx , http .MethodHead , url , nil )
939
939
if err != nil {
@@ -968,7 +968,7 @@ func (s *blobStore) FetchReference(ctx context.Context, reference string) (desc
968
968
return ocispec.Descriptor {}, nil , err
969
969
}
970
970
971
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
971
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
972
972
url := buildRepositoryBlobURL (s .repo .PlainHTTP , ref )
973
973
req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
974
974
if err != nil {
@@ -1043,7 +1043,7 @@ type manifestStore struct {
1043
1043
func (s * manifestStore ) Fetch (ctx context.Context , target ocispec.Descriptor ) (rc io.ReadCloser , err error ) {
1044
1044
ref := s .repo .Reference
1045
1045
ref .Reference = target .Digest .String ()
1046
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
1046
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
1047
1047
url := buildRepositoryManifestURL (s .repo .PlainHTTP , ref )
1048
1048
req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
1049
1049
if err != nil {
@@ -1169,7 +1169,7 @@ func (s *manifestStore) Resolve(ctx context.Context, reference string) (ocispec.
1169
1169
if err != nil {
1170
1170
return ocispec.Descriptor {}, err
1171
1171
}
1172
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
1172
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
1173
1173
url := buildRepositoryManifestURL (s .repo .PlainHTTP , ref )
1174
1174
req , err := http .NewRequestWithContext (ctx , http .MethodHead , url , nil )
1175
1175
if err != nil {
@@ -1201,7 +1201,7 @@ func (s *manifestStore) FetchReference(ctx context.Context, reference string) (d
1201
1201
return ocispec.Descriptor {}, nil , err
1202
1202
}
1203
1203
1204
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull )
1204
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull )
1205
1205
url := buildRepositoryManifestURL (s .repo .PlainHTTP , ref )
1206
1206
req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
1207
1207
if err != nil {
@@ -1244,7 +1244,7 @@ func (s *manifestStore) Tag(ctx context.Context, desc ocispec.Descriptor, refere
1244
1244
return err
1245
1245
}
1246
1246
1247
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull , auth .ActionPush )
1247
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull , auth .ActionPush )
1248
1248
rc , err := s .Fetch (ctx , desc )
1249
1249
if err != nil {
1250
1250
return err
@@ -1269,7 +1269,7 @@ func (s *manifestStore) push(ctx context.Context, expected ocispec.Descriptor, c
1269
1269
ref .Reference = reference
1270
1270
// pushing usually requires both pull and push actions.
1271
1271
// Reference: https://github.com/distribution/distribution/blob/v2.7.1/registry/handlers/app.go#L921-L930
1272
- ctx = auth .AppendScopeHints (ctx , ref , auth .ActionPull , auth .ActionPush )
1272
+ ctx = auth .AppendRepositoryScope (ctx , ref , auth .ActionPull , auth .ActionPush )
1273
1273
url := buildRepositoryManifestURL (s .repo .PlainHTTP , ref )
1274
1274
// unwrap the content for optimizations of built-in types.
1275
1275
body := ioutil .UnwrapNopCloser (content )
0 commit comments