A gateway key could only be held to accounts picked one by one, so an
account signed in after the key was saved was never used. An entry
"<provider>/!<account>" (access.ExcludeMark) now keeps that account out:
the key uses every other account of the provider, one added later too,
and never the one kept out.
- access: AllowsAccount refuses a kept-out account first, and counts only
the entries naming accounts to use for "the providers it names", so a
provider with only kept-out entries serves every other account.
HeldModels and AccountModels ignore kept-out entries (keeping one out
holds the key to no model). An issued key keeps out what its issuer
does (foldAccounts). CleanAccounts resolves the ref after the mark and
refuses an account both used and kept out. ReplaceAccount moves
kept-out entries too. AccountsShown renders "X; every account but Z"
for the CLI and the gateway's refusals.
- CLI: `magpie gateway-key accounts <id> relay/!Second` prints "every
account but relay/Second"; list and models read it.
- GUI: the key row's menu has "Keep accounts out", which opens the app's
menu (openProtoMenu, no native select); a badge names what is kept out
and opens the same menu; an account the key was held to and is now kept
out leaves the held ones. Strings in zh, zh-TW, ja and de.
- docs: reference.md and providers-accounts.md.
Run (mote, at this tree):
- gofmt -l internal/ clean; go vet darwin, GOOS=linux -tags nogui and
GOOS=windows of access, cli and gateway: clean.
- go test -count=1 ./internal/access ./internal/cli ./internal/gateway: ok.
New: TestKeptOutAccounts, TestKeptOutFolded, TestKeptOutReplaced;
TestGatewayKeyKeptOutAccountsKeyedRoutes (chat, messages, responses,
count_tokens, images, videos, System One and /v1/models over a key
provider, a remote magpie and a Decide provider: the kept-out key never
asked, every account kept out asks nothing, a key added after the
gateway key was saved is used); TestGatewayKeyKeptOutCodexAccounts
(Codex sign-ins, one signed in later used);
TestGatewayKeyKeptOutQuotaCards; TestGatewayKeyAccountsCLI extended.
- GUI: gateway-key-kept-out.test.cjs, chromium and webkit, 1100 and 440
px, en zh zh-TW ja de: 20 of 20. Every gateway-*.test.cjs and
i18n-*.test.cjs file in both engines: 496 of 516, the 20 red all
gateway-card's count of the row menu's items (5, now 6), updated here;
then gateway-card, api-key-theme, gateway-connect-keys, gui-de, gui-ja
and gui-zh-tw: 39 of 39.
- Again after rebasing onto 4869d0c96 (this commit's tree): gofmt clean,
vet darwin/linux nogui/windows clean, go test access, cli, gateway and
gui (TestCoreScriptBudget among them) ok; gateway-key-kept-out,
gateway-card, gateway-key-accounts, i18n-keys, i18n-en-no-cjk, gui-zh-tw,
gui-ja, gui-de in both engines: 61 of 61.
- Rebased onto b922e5168 (nanobot, which also adds i18n strings): go test
gui and access ok; gateway-key-kept-out, i18n-keys, i18n-en-no-cjk,
gui-zh-tw, gui-ja, gui-de in both engines: 37 of 37.
Broken by hand:
- AllowsAccount without its kept-out refusal: TestKeptOutAccounts,
TestKeptOutFolded and all three TestGatewayKeyKeptOut* tests red.
- gatewayKeptOutPick keeping a held account it was told to keep out:
gateway-key-kept-out red (the server key's accounts-key body).
Not tried: a real account kept out on a running magpie (the tests use
fake upstreams and sign-ins); Windows (no OS-specific code).