You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
credentials.go File-based credential storage with env var override
41
40
account.go Account info retrieval (whoami endpoint)
42
-
client.go Authenticated HTTP client with auto-refresh
41
+
client.go Authenticated HTTP client with connection pooling and auto-refresh
43
42
revisions.go Store API calls (revisions, releases with pagination)
44
43
cache.go Cache data structures, gzip read/write, file lookup
45
44
auth_test.go Tests for macaroon serialization and caveat extraction
46
45
credentials_test.go Tests for credential storage
47
-
client_test.go Tests for refresh detection
46
+
client_test.go Tests for client transport and refresh detection
48
47
```
49
48
50
49
## Command Groups
@@ -55,9 +54,7 @@ Commands are organized into three groups displayed in `--help` output. Sorting i
55
54
-**Query:** list, show
56
55
-**Learn:** readme, design, demo
57
56
58
-
## Authentication
59
-
60
-
### Version
57
+
## Version
61
58
62
59
The project produces two binaries (`revmap` and `cache-build`), both receiving the same version via ldflags at build time.
63
60
@@ -67,7 +64,7 @@ The project produces two binaries (`revmap` and `cache-build`), both receiving t
67
64
68
65
Cobra's built-in `Version` field provides the `--version` flag automatically.
69
66
70
-
### Macaroon Scheme
67
+
##Authentication
71
68
72
69
The Snap Store uses a two-macaroon authentication model:
73
70
@@ -188,7 +185,7 @@ A standalone binary (`cmd/cache-build/main.go`) that fetches the complete revisi
188
185
189
186
Built by `make build` alongside the main binary, with the same version injected via ldflags. Supports `-version` to print its version.
190
187
191
-
**Performance:** The HTTP client is created via `NewClientWithWorkers(n)` which configures a transport with `MaxIdleConnsPerHost`matching the worker count, ensuring TCP/TLS connections are reused across concurrent requests rather than being re-established.
188
+
**Performance:** The HTTP client is created via `NewClientWithWorkers(n)` which configures a transport with `MaxIdleConnsPerHost`set to `n + 10`, ensuring TCP/TLS connections are reused across concurrent requests rather than being re-established.
192
189
193
190
**Authentication:** If credentials already exist (user ran `revmap login` or `SNAPCRAFT_STORE_CREDENTIALS` is set), they are used directly. Otherwise, `cache-build` checks for `REVMAP_EMAIL` and `REVMAP_PASSWORD` environment variables and performs a non-interactive login via `store.Login(email, password, "")`. The OTP parameter is always empty — the account must not have two-factor authentication enabled. A 2FA-enabled account will return `ErrTwoFactorRequired`, surfaced as `"automatic login failed: two-factor authentication required"`.
194
191
@@ -267,6 +264,7 @@ All user-facing messages follow consistent conventions:
0 commit comments