Skip to content

Commit 5043a7b

Browse files
docs: updated broken links (#951)
Fixes: #948 Signed-off-by: Xiaoxuan Wang <[email protected]>
1 parent 17e7d15 commit 5043a7b

File tree

11 files changed

+39
-39
lines changed

11 files changed

+39
-39
lines changed

registry/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type Registry interface {
3131
// Note: When implemented by a remote registry, the catalog API is called.
3232
// However, not all registries supports pagination or conforms the
3333
// specification.
34-
// Reference: https://docs.docker.com/registry/spec/api/#catalog
34+
// Reference: https://distribution.github.io/distribution/spec/api/#catalog
3535
// See also `Repositories()` in this package.
3636
Repositories(ctx context.Context, last string, fn func(repos []string) error) error
3737

registry/remote/auth/challenge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (s Scheme) String() string {
6262
// parseChallenge parses the "WWW-Authenticate" header returned by the remote
6363
// registry, and extracts parameters if scheme is Bearer.
6464
// References:
65-
// - https://docs.docker.com/registry/spec/auth/token/#how-to-authenticate
65+
// - https://distribution.github.io/distribution/spec/auth/token/#how-to-authenticate
6666
// - https://tools.ietf.org/html/rfc7235#section-2.1
6767
func parseChallenge(header string) (scheme Scheme, params map[string]string) {
6868
// as defined in RFC 7235 section 2.1, we have

registry/remote/auth/client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var DefaultClient = &Client{
5151
// limit, which is usually 16 KiB. As specified by the distribution, the
5252
// response may contain 2 identical tokens, that is, 16 x 2 = 32 KiB.
5353
// Hence, 128 KiB should be sufficient.
54-
// References: https://docs.docker.com/registry/spec/auth/token/
54+
// References: https://distribution.github.io/distribution/spec/auth/token/
5555
var maxResponseBytes int64 = 128 * 1024 // 128 KiB
5656

5757
// defaultClientID specifies the default client ID used in OAuth2.
@@ -110,15 +110,15 @@ type Client struct {
110110

111111
// ClientID used in fetching OAuth2 token as a required field.
112112
// If empty, a default client ID is used.
113-
// Reference: https://docs.docker.com/registry/spec/auth/oauth/#getting-a-token
113+
// Reference: https://distribution.github.io/distribution/spec/auth/oauth/#getting-a-token
114114
ClientID string
115115

116116
// ForceAttemptOAuth2 controls whether to follow OAuth2 with password grant
117117
// instead the distribution spec when authenticating using username and
118118
// password.
119119
// References:
120-
// - https://docs.docker.com/registry/spec/auth/jwt/
121-
// - https://docs.docker.com/registry/spec/auth/oauth/
120+
// - https://distribution.github.io/distribution/spec/auth/jwt/
121+
// - https://distribution.github.io/distribution/spec/auth/oauth/
122122
ForceAttemptOAuth2 bool
123123
}
124124

@@ -312,8 +312,8 @@ func (c *Client) fetchBearerToken(ctx context.Context, registry, realm, service
312312
// specification.
313313
// It fetches anonymous tokens if no credential is provided.
314314
// References:
315-
// - https://docs.docker.com/registry/spec/auth/jwt/
316-
// - https://docs.docker.com/registry/spec/auth/token/
315+
// - https://distribution.github.io/distribution/spec/auth/jwt/
316+
// - https://distribution.github.io/distribution/spec/auth/token/
317317
func (c *Client) fetchDistributionToken(ctx context.Context, realm, service string, scopes []string, username, password string) (string, error) {
318318
req, err := http.NewRequestWithContext(ctx, http.MethodGet, realm, nil)
319319
if err != nil {
@@ -340,7 +340,7 @@ func (c *Client) fetchDistributionToken(ctx context.Context, realm, service stri
340340
return "", errutil.ParseErrorResponse(resp)
341341
}
342342

343-
// As specified in https://docs.docker.com/registry/spec/auth/token/ section
343+
// As specified in https://distribution.github.io/distribution/spec/auth/token/ section
344344
// "Token Response Fields", the token is either in `token` or
345345
// `access_token`. If both present, they are identical.
346346
var result struct {
@@ -361,7 +361,7 @@ func (c *Client) fetchDistributionToken(ctx context.Context, realm, service stri
361361
}
362362

363363
// fetchOAuth2Token fetches an OAuth2 access token.
364-
// Reference: https://docs.docker.com/registry/spec/auth/oauth/
364+
// Reference: https://distribution.github.io/distribution/spec/auth/oauth/
365365
func (c *Client) fetchOAuth2Token(ctx context.Context, realm, service string, scopes []string, cred Credential) (string, error) {
366366
form := url.Values{}
367367
if cred.RefreshToken != "" {

registry/remote/auth/credential.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ type Credential struct {
3030
// RefreshToken is a bearer token to be sent to the authorization service
3131
// for fetching access tokens.
3232
// A refresh token is often referred as an identity token.
33-
// Reference: https://docs.docker.com/registry/spec/auth/oauth/
33+
// Reference: https://distribution.github.io/distribution/spec/auth/oauth/
3434
RefreshToken string
3535

3636
// AccessToken is a bearer token to be sent to the registry.
3737
// An access token is often referred as a registry token.
38-
// Reference: https://docs.docker.com/registry/spec/auth/token/
38+
// Reference: https://distribution.github.io/distribution/spec/auth/token/
3939
AccessToken string
4040
}

registry/remote/auth/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func ExampleClient_Do_clientConfigurations() {
199199
client.SetUserAgent("example user agent")
200200
// Tokens carry restrictions about what resources they can access and how.
201201
// Such restrictions are represented and enforced as Scopes.
202-
// Reference: https://docs.docker.com/registry/spec/auth/scope/
202+
// Reference: https://distribution.github.io/distribution/spec/auth/scope/
203203
scopes := []string{
204204
"repository:dst:pull,push",
205205
"repository:src:pull",

registry/remote/auth/scope.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
// Actions used in scopes.
27-
// Reference: https://docs.docker.com/registry/spec/auth/scope/
27+
// Reference: https://distribution.github.io/distribution/spec/auth/scope/
2828
const (
2929
// ActionPull represents generic read access for resources of the repository
3030
// type.
@@ -43,7 +43,7 @@ const (
4343
const ScopeRegistryCatalog = "registry:catalog:*"
4444

4545
// ScopeRepository returns a repository scope with given actions.
46-
// Reference: https://docs.docker.com/registry/spec/auth/scope/
46+
// Reference: https://distribution.github.io/distribution/spec/auth/scope/
4747
func ScopeRepository(repository string, actions ...string) string {
4848
actions = cleanActions(actions)
4949
if repository == "" || len(actions) == 0 {
@@ -98,7 +98,7 @@ type scopesContextKey struct{}
9898
// Passing an empty list of scopes will virtually remove the scope hints in the
9999
// context.
100100
//
101-
// Reference: https://docs.docker.com/registry/spec/auth/scope/
101+
// Reference: https://distribution.github.io/distribution/spec/auth/scope/
102102
func WithScopes(ctx context.Context, scopes ...string) context.Context {
103103
scopes = CleanScopes(scopes)
104104
return context.WithValue(ctx, scopesContextKey{}, scopes)
@@ -143,7 +143,7 @@ type scopesForHostContextKey string
143143
// Passing an empty list of scopes will virtually remove the scope hints in the
144144
// context for the given host.
145145
//
146-
// Reference: https://docs.docker.com/registry/spec/auth/scope/
146+
// Reference: https://distribution.github.io/distribution/spec/auth/scope/
147147
func WithScopesForHost(ctx context.Context, host string, scopes ...string) context.Context {
148148
scopes = CleanScopes(scopes)
149149
return context.WithValue(ctx, scopesForHostContextKey(host), scopes)

registry/remote/errcode/errors.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
// References:
2727
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#error-codes
28-
// - https://docs.docker.com/registry/spec/api/#errors-2
28+
// - https://distribution.github.io/distribution/spec/api/#errors-2
2929
const (
3030
ErrorCodeBlobUnknown = "BLOB_UNKNOWN"
3131
ErrorCodeBlobUploadInvalid = "BLOB_UPLOAD_INVALID"
@@ -46,7 +46,7 @@ const (
4646
// registry.
4747
// References:
4848
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#error-codes
49-
// - https://docs.docker.com/registry/spec/api/#errors-2
49+
// - https://distribution.github.io/distribution/spec/api/#errors-2
5050
type Error struct {
5151
Code string `json:"code"`
5252
Message string `json:"message"`
@@ -74,7 +74,7 @@ func (e Error) Error() string {
7474
// server.
7575
// References:
7676
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#error-codes
77-
// - https://docs.docker.com/registry/spec/api/#errors-2
77+
// - https://distribution.github.io/distribution/spec/api/#errors-2
7878
type Errors []Error
7979

8080
// Error returns a error string describing the error.

registry/remote/registry.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type Registry struct {
4343
// RepositoryListPageSize specifies the page size when invoking the catalog
4444
// API.
4545
// If zero, the page size is determined by the remote registry.
46-
// Reference: https://docs.docker.com/registry/spec/api/#catalog
46+
// Reference: https://distribution.github.io/distribution/spec/api/#catalog
4747
RepositoryListPageSize int
4848
}
4949

@@ -93,7 +93,7 @@ func (r *Registry) do(req *http.Request) (*http.Response, error) {
9393
// Ping can be used to check authentication when an auth client is configured.
9494
//
9595
// References:
96-
// - https://docs.docker.com/registry/spec/api/#base
96+
// - https://distribution.github.io/distribution/spec/api/#base
9797
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#api
9898
func (r *Registry) Ping(ctx context.Context) error {
9999
url := buildRegistryBaseURL(r.PlainHTTP, r.Reference)
@@ -125,7 +125,7 @@ func (r *Registry) Ping(ctx context.Context) error {
125125
// repo specified by `last`. Otherwise, the response starts from the top
126126
// of the Repositories list.
127127
//
128-
// Reference: https://docs.docker.com/registry/spec/api/#catalog
128+
// Reference: https://distribution.github.io/distribution/spec/api/#catalog
129129
func (r *Registry) Repositories(ctx context.Context, last string, fn func(repos []string) error) error {
130130
ctx = auth.AppendScopesForHost(ctx, r.Reference.Host(), auth.ScopeRegistryCatalog)
131131
url := buildRegistryCatalogURL(r.PlainHTTP, r.Reference)

registry/remote/repository.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const (
5252
// uploaded blob.
5353
//
5454
// References:
55-
// - https://docs.docker.com/registry/spec/api/#digest-header
55+
// - https://distribution.github.io/distribution/spec/api/#digest-header
5656
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#pull
5757
headerDockerContentDigest = "Docker-Content-Digest"
5858

@@ -112,7 +112,7 @@ type Repository struct {
112112

113113
// TagListPageSize specifies the page size when invoking the tag list API.
114114
// If zero, the page size is determined by the remote registry.
115-
// Reference: https://docs.docker.com/registry/spec/api/#tags
115+
// Reference: https://distribution.github.io/distribution/spec/api/#tags
116116
TagListPageSize int
117117

118118
// ReferrerListPageSize specifies the page size when invoking the Referrers
@@ -394,7 +394,7 @@ func (r *Repository) ParseReference(reference string) (registry.Reference, error
394394
//
395395
// References:
396396
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#content-discovery
397-
// - https://docs.docker.com/registry/spec/api/#tags
397+
// - https://distribution.github.io/distribution/spec/api/#tags
398398
func (r *Repository) Tags(ctx context.Context, last string, fn func(tags []string) error) error {
399399
ctx = auth.AppendRepositoryScope(ctx, r.Reference, auth.ActionPull)
400400
url := buildRepositoryTagListURL(r.PlainHTTP, r.Reference)
@@ -758,7 +758,7 @@ func (s *blobStore) Fetch(ctx context.Context, target ocispec.Descriptor) (rc io
758758
// check server range request capability.
759759
// Docker spec allows range header form of "Range: bytes=<start>-<end>".
760760
// However, the remote server may still not RFC 7233 compliant.
761-
// Reference: https://docs.docker.com/registry/spec/api/#blob
761+
// Reference: https://distribution.github.io/distribution/spec/api/#blob
762762
if rangeUnit := resp.Header.Get("Accept-Ranges"); rangeUnit == "bytes" {
763763
return httputil.NewReadSeekCloser(s.repo.client(), req, resp.Body, target.Size), nil
764764
}
@@ -845,8 +845,8 @@ func (s *blobStore) sibling(otherRepoName string) *blobStore {
845845
// authentication errors.
846846
//
847847
// References:
848-
// - https://docs.docker.com/registry/spec/api/#pushing-an-image
849-
// - https://docs.docker.com/registry/spec/api/#initiate-blob-upload
848+
// - https://distribution.github.io/distribution/spec/api/#pushing-an-image
849+
// - https://distribution.github.io/distribution/spec/api/#initiate-blob-upload
850850
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.1/spec.md#pushing-a-blob-monolithically
851851
func (s *blobStore) Push(ctx context.Context, expected ocispec.Descriptor, content io.Reader) error {
852852
// start an upload
@@ -1019,7 +1019,7 @@ func (s *blobStore) FetchReference(ctx context.Context, reference string) (desc
10191019
// check server range request capability.
10201020
// Docker spec allows range header form of "Range: bytes=<start>-<end>".
10211021
// However, the remote server may still not RFC 7233 compliant.
1022-
// Reference: https://docs.docker.com/registry/spec/api/#blob
1022+
// Reference: https://distribution.github.io/distribution/spec/api/#blob
10231023
if rangeUnit := resp.Header.Get("Accept-Ranges"); rangeUnit == "bytes" {
10241024
return desc, httputil.NewReadSeekCloser(s.repo.client(), req, resp.Body, desc.Size), nil
10251025
}

registry/remote/url.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ func buildScheme(plainHTTP bool) string {
3434

3535
// buildRegistryBaseURL builds the URL for accessing the base API.
3636
// Format: <scheme>://<registry>/v2/
37-
// Reference: https://docs.docker.com/registry/spec/api/#base
37+
// Reference: https://distribution.github.io/distribution/spec/api/#base
3838
func buildRegistryBaseURL(plainHTTP bool, ref registry.Reference) string {
3939
return fmt.Sprintf("%s://%s/v2/", buildScheme(plainHTTP), ref.Host())
4040
}
4141

4242
// buildRegistryCatalogURL builds the URL for accessing the catalog API.
4343
// Format: <scheme>://<registry>/v2/_catalog
44-
// Reference: https://docs.docker.com/registry/spec/api/#catalog
44+
// Reference: https://distribution.github.io/distribution/spec/api/#catalog
4545
func buildRegistryCatalogURL(plainHTTP bool, ref registry.Reference) string {
4646
return fmt.Sprintf("%s://%s/v2/_catalog", buildScheme(plainHTTP), ref.Host())
4747
}
@@ -54,14 +54,14 @@ func buildRepositoryBaseURL(plainHTTP bool, ref registry.Reference) string {
5454

5555
// buildRepositoryTagListURL builds the URL for accessing the tag list API.
5656
// Format: <scheme>://<registry>/v2/<repository>/tags/list
57-
// Reference: https://docs.docker.com/registry/spec/api/#tags
57+
// Reference: https://distribution.github.io/distribution/spec/api/#tags
5858
func buildRepositoryTagListURL(plainHTTP bool, ref registry.Reference) string {
5959
return buildRepositoryBaseURL(plainHTTP, ref) + "/tags/list"
6060
}
6161

6262
// buildRepositoryManifestURL builds the URL for accessing the manifest API.
6363
// Format: <scheme>://<registry>/v2/<repository>/manifests/<digest_or_tag>
64-
// Reference: https://docs.docker.com/registry/spec/api/#manifest
64+
// Reference: https://distribution.github.io/distribution/spec/api/#manifest
6565
func buildRepositoryManifestURL(plainHTTP bool, ref registry.Reference) string {
6666
return strings.Join([]string{
6767
buildRepositoryBaseURL(plainHTTP, ref),
@@ -72,7 +72,7 @@ func buildRepositoryManifestURL(plainHTTP bool, ref registry.Reference) string {
7272

7373
// buildRepositoryBlobURL builds the URL for accessing the blob API.
7474
// Format: <scheme>://<registry>/v2/<repository>/blobs/<digest>
75-
// Reference: https://docs.docker.com/registry/spec/api/#blob
75+
// Reference: https://distribution.github.io/distribution/spec/api/#blob
7676
func buildRepositoryBlobURL(plainHTTP bool, ref registry.Reference) string {
7777
return strings.Join([]string{
7878
buildRepositoryBaseURL(plainHTTP, ref),
@@ -83,14 +83,14 @@ func buildRepositoryBlobURL(plainHTTP bool, ref registry.Reference) string {
8383

8484
// buildRepositoryBlobUploadURL builds the URL for blob uploading.
8585
// Format: <scheme>://<registry>/v2/<repository>/blobs/uploads/
86-
// Reference: https://docs.docker.com/registry/spec/api/#initiate-blob-upload
86+
// Reference: https://distribution.github.io/distribution/spec/api/#initiate-blob-upload
8787
func buildRepositoryBlobUploadURL(plainHTTP bool, ref registry.Reference) string {
8888
return buildRepositoryBaseURL(plainHTTP, ref) + "/blobs/uploads/"
8989
}
9090

9191
// buildRepositoryBlobMountURLbuilds the URL for cross-repository mounting.
9292
// Format: <scheme>://<registry>/v2/<repository>/blobs/uploads/?mount=<digest>&from=<other_repository>
93-
// Reference: https://docs.docker.com/registry/spec/api/#blob
93+
// Reference: https://distribution.github.io/distribution/spec/api/#blob
9494
func buildRepositoryBlobMountURL(plainHTTP bool, ref registry.Reference, d digest.Digest, fromRepo string) string {
9595
return fmt.Sprintf("%s?mount=%s&from=%s",
9696
buildRepositoryBlobUploadURL(plainHTTP, ref),

0 commit comments

Comments
 (0)