Skip to content

Commit 6eb6230

Browse files
committed
docs(registry): note the pull-only token scope and non-retryable body
1 parent aa9dceb commit 6eb6230

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/main/java/io/github/intisy/docker/registry/UrlRegistryHttp.java‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*
1616
* @implNote acquires a bearer token lazily on a 401 and retries once, caching per scope. Docker
1717
* Hub answers 401 with a challenge on the very first anonymous request, so without the retry every
18-
* pull would need the caller to know the flow.
18+
* pull would need the caller to know the flow. The retry is skipped when the request carries a
19+
* body: a body stream cannot be replayed once consumed, so a write cannot be transparently
20+
* retried after a challenge.
1921
*
2022
* @author Finn Birich
2123
*/
@@ -49,7 +51,10 @@ private String tokenFor(String url) {
4951

5052
/**
5153
* @implNote derives the pull scope from the request path, so that one client can walk several
52-
* repositories without the caller tracking tokens.
54+
* repositories without the caller tracking tokens. The scope is deliberately pull-only:
55+
* anonymous pull from Docker Hub is the only authenticated flow this client implements.
56+
* Supporting a registry that requires a token for writes would mean threading the HTTP method
57+
* through and requesting {@code pull,push}.
5358
*/
5459
static String scopeFor(String url) {
5560
int v2 = url.indexOf("/v2/");

0 commit comments

Comments
 (0)