Let a Core keep a token for one owner's apps on a host

coreapp login <host>/<owner> saves a token used for that owner's
repositories and images before the host's token, so apps from different
accounts on one host can use different tokens. git sends it only under
https://<host>/<owner>/; docker gets it for that pull only. Errors name
the token that was tried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 20:51:41 -07:00
co-authored by Claude Opus 5.5
parent c337ba2530
commit f0468c43f2
6 changed files with 114 additions and 48 deletions
+15
View File
@@ -568,6 +568,21 @@ has a `coreapp.toml` with a published, public `image` (e.g. after
token shown); on the Core `/etc/coreapps` is 700, `credentials` 600, and
`/root/.docker/config.json` has no entry for the host. `coreapp logout
<host>`: installing fails again.
6a. Tokens per owner: `coreapp login <host>/<owner>` with a wrong token is
rejected, the file unchanged. With a token saved for `<host>/<owner>`
(on the Core, a wrong one written with `write_credentials`, to see which
is used), `coreapps plan https://<host>/<owner>/<repo>` uses it before
the host's: "Couldn't read ... (It used the token for <host>/<owner>:
check it can read this repository.)"; with one for another owner, the
host's token is used and the plan works. `coreapp logins` shows
"<host>/<owner> (user ...; for <owner>'s apps)"; `logout
<host>/<Owner>` (any case) forgets it. Keys are lowercase; git's header
is scoped to `https://<host>/<Owner>/` as the URL spells the owner
(`git config --get-urlmatch` gives it for `/Owner/app`, not for
`/owner/app`, `/Ownerx/app` or other owners). The image is pulled with
the owner's token (`<registry>/<owner>/<name>`), or else the host's;
re-installing pub-test with the host's token pulls it again (same
digest), with no docker login left.
7. `coreapp remove` in the app's folder (or `coreapps remove <name>` on the
Core) removes it like any other.