Repository navigation
Add private registry login + registry-aware pull - #10
Merged
Merged
Conversation
Wraps `container registry login|logout|list` so you can authenticate to private registries from the app, and teaches the pull sheet to notice when the target registry isn't signed in. - RegistryService: login (password piped via --password-stdin, never argv), logout, list. RegistryLogin decodes `registry list --format json` with a tolerant decoder; the pull hint's source of truth is the format-stable `--quiet` host list, so a JSON key rename can't break it. - RegistryHost normalizes hosts and folds Docker Hub aliases to docker.io. - System screen gains a Registries card (list + log in/out); the Pull sheet shows a non-blocking "not signed in to X" hint with a prefilled login sheet. Public/Docker Hub pulls never nag, and the hint never gates a pull. - Tests: registry arg builders (asserts password absent from argv), service (stdin password, failure, quiet-list normalization, JSON decode), tolerant decoding, and RegistryHost normalization. 115 tests pass; app builds clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- RegistryLogin: decode the REAL `container registry list --format json` keys (`name`/`id` for host, `creationDate`/`modificationDate` for dates). The guessed `hostname`/`host`/`server`/`created`/`modified` never matched, so list() always threw and the card silently degraded to hostname-only with a blank username. Fixtures/tests now use real CLI output instead of false-green invented keys. (Verified against the live CLI.) - ExploreScreen: inject `.environment(app)` on its PullImageView sheet — the second call site was missed when PullImageView gained an AppModel dependency, risking a crash on Pull-from-Explore. (ImagesScreen already had it.) - RegistriesSection: clear `errorMessage` at the top of reload() so a stale error no longer sticks under a healthy list; suppress the "signed in to nothing" line while an error is showing. - Logout correctness: the decode-failure fallback now uses verbatim `--quiet` hostnames (new loggedInHostsRaw), not normalized ones — logout(server:) must send the exact stored name or it won't match the credential. 116 tests pass; app builds clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
Adversarial review — done, findings fixedRan a multi-lens adversarial review (7 finder lenses → each finding refuted by 3 diverse skeptics, majority-confirm to survive → completeness critic). 16 findings raised, 10 survived verification. The material ones are now fixed in Fixed
Deferred (by-design or low, with rationale)
116 tests pass; app builds clean. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ship the ability to authenticate to private registries from ContainerUI, and make the pull sheet registry-aware.
Wraps Apple's
container registry login|logout|list. Pull from a private registry already worked once you were logged in — this adds the login UI that unlocks it, plus a hint so a private pull doesn't fail cryptically when you're not signed in.(Registry browse is deliberately out of scope — private registries speak the OCI Distribution API, not Docker Hub's search, so Explore stays Docker-Hub-only.)
Changes
Core
RegistryService—login(password piped via--password-stdin, never in argv),logout,list(rich JSON),loggedInHosts(from--quiet).RegistryLogin— tolerantDecodable(hostname/host/server,username/user), sinceregistry list --format jsonreturns[]today and its keys are unverifiable.RegistryHost— normalizes hosts and folds Docker Hub aliases (docker.io,index.docker.io, …) to one key.App / UI
RegistryLoginView— server / username / password (SecureField) / scheme sheet, mirroringCreateVolumeView.InlineBanner— "Not signed in toghcr.io" with a prefilled Log in action. Docker Hub / public pulls never nag; the hint never gates a pull.Design notes
--quiet(hostname-only, format-stable), not JSON — so a JSON key rename can't break the safety-critical path. JSON only enriches the management list, and falls back to--quietrows if it fails to decode.loggedInRegistriesisSet<String>?:nil= unknown ⇒ hint stays silent (fail safe, never a false nag).Datawith no trailing newline; not a parameter of any argument builder.Testing
RegistryHostnormalization suites).xcodebuild buildclean (per repo convention, the test action skips the SwiftUI app target, so the app target was built separately to catch view compile errors).Runtime QA against a live private registry (actual login/pull) is worth a manual pass before merge.
🤖 Generated with Claude Code