A key rotated at its vendor had to be removed and added again, which
lost its name, its place in the order, its weight, protocol, models,
proxy and concurrency, and any gateway key restricted to it. As decided
on #1869, in multi-key mode the row now has a Change key action, with a
double-click on the row as a shortcut.
- provider.ReplaceKey(id, ref, key) sets the key's new value and moves
what providers.json keys by the key's fingerprint (AccountModels,
AccountProxies, AccountConcurrency) to the new one. An empty value, an
unknown key and a value another key of the provider already holds are
refused. The same value is a no-op.
- access.ReplaceAccount moves gateway keys' Accounts entries from
provider/old to provider/new, under the caller-keys lock.
- gateway.Server.UnrestAll lifts a rest key and every per-model rest
under it. The GUI's keys/replace lifts the key's rest (provider#key, and
the provider's own rest key when it is the only key on), so the new
value is asked from the next request.
- app.js: a pencil beside the key's copy button opens a password field in
place of the masked value. Enter saves, Escape leaves it, and a
double-click on the row away from its controls opens it too. The button
has its own class (.key-edit) with the copy button's look.
- i18n: four strings in zh, zh-TW, ja and de.
- providers-accounts.md: ReplaceKey in the Keys table.
Past requests keep the old fingerprint in history, under the same name.
A rest is lifted only in the gateway this magpie serves.
Run:
- go test ./internal/gateway ./internal/provider ./internal/access
./internal/gui -count=1: ok. New TestReplaceKeyKeepsItsPlace,
TestKeysReplaceKeepsTheKeyAndLiftsItsRest and
TestUnrestAllLiftsAKeysModels each fail with their change taken out.
- gofmt -l clean; go vet darwin, linux -tags nogui, windows.
- key-replace.test.cjs (new): en/zh/zh-TW/ja/de, chromium and webkit,
1100 and 420px. Checks the post, order, note, no sideways scroll, and
no scroll on change or on double-click plus Escape.
- With key-copy, rest-try-now and key-import: 96/96.
- 72 key*/routing*/rest* GUI files at concurrency 6: 863/871. The 8 reds
were key-copy, whose button.copy locator matched the pencil; that's why
it has its own class now, and key-copy passes.
- Under load, about one run in 300 saw the editor body go back to the top
after the copy button's double-click, with no script scrolling it. That
is #1504 (findings added there). The test checks scroll before that
step.