Commit 206fb30
committed
distribution: Also move the Bearer token and OAuth docs
Docker's use of Bearer requires information beyond what's covered in
RFC 6749 and 6750 [1]. So folks writing a client that will interact
with a Docker registry that uses that auth approach will need a
"Docker registry's 'Bearer' additions" spec to follow. While I prefer
off-the-shelf RFCs for HTTP auth, the Docker registry additions are
small enough, and widely used. This change adds the client side of
their specification to the new distribution-spec project.
The docker/distribution repository also includes docs for scope [3]
and the JWT token semantics [4]. The scope docs are borderline useful
for clients, but I've left them out because clients can extract the
required scope from WWW-Authenticate in 401ed responses:
$ curl -IH 'Accept: application/vnd.docker.distribution.manifest.v2+json' https://index.docker.io/v2/library/docker/manifests/1.12.1
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository:library/docker:pull"
...
Clients can consider them opaque, so I've left them out of the
distribution-spec project for now. If distribution-spec maintainers
feel that clients could benefit by explicitly crafting their own scope
strings, they can pull in the scope specification after the project
forms.
JWT token semantics [4] are part of the interface between the auth
server and the registry. Clients can consider them opaque, so I've
left them out of the distribution-spec project.
Also pin the docker/registry links to a specific version so the links
will survive future docker/registry changes (including removing the
docs after the OCI picks them up). As long as the TOB-selected
version isn't far behind (how far will the spec move during a week of
voting?), it should be easy for the new maintainets to catch up on any
subsequent drift.
The signing scope language is from Stephen in [5]. The discovery
scope language is from Derek [6].
[1]: xiekeyang/oci-discovery#64 (comment)
[2]: https://github.com/docker/distribution/blob/5cb406d511b7b9163bff9b6439072e4892e5ae3b/docs/spec/auth/oauth.md
[3]: https://github.com/docker/distribution/blob/5cb406d511b7b9163bff9b6439072e4892e5ae3b/docs/spec/auth/scope.md
[4]: https://github.com/docker/distribution/blob/5cb406d511b7b9163bff9b6439072e4892e5ae3b/docs/spec/auth/jwt.md
[5]: #35 (comment)
[6]: #34 (comment)
Signed-off-by: W. Trevor King <[email protected]>1 parent e2fc9af commit 206fb30
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
0 commit comments