fix(rotation): OAuth client ids are identifiers, never rotated (CLI 0.16.2)

c0upons CoinPay sign-in broke with `invalid_client: Invalid client_id`.
c0upons--prod's COINPAY_CLIENT_ID held the same value as COINPAY_API_KEY,
and a rotation writes every vault:key with the value's fingerprint,
whatever the key is called. The 2026-11-22 coinpay-api-key run minted a new
cp_live_ key, wrote it into COINPAY_CLIENT_ID too, and saved the rotator
state as __ROTATE__COINPAY_CLIENT_ID (targets[0] was the client id), so the
plan showed the client id as provider/coinpay/automatic from then on.

- New method `identifier`: every *_CLIENT_ID (COINPAY_CLIENT_ID,
  *_OAUTH_CLIENT_ID, GOOGLE_CLIENT_ID...) gets it from the catalog, never
  automatic, with the reason. A __ROTATE__ entry claiming otherwise is
  ignored and reported in the plan with the command to reset it.
- rotate-keys never writes a rotated value into a client id under another
  name (named in the result instead), records rotator state under the
  plan's own key, and skips a client id outright.
- coinpay-api-key and coinpay-webhook-secret refuse a client id in
  preflight and mint without calling CoinPay.
- rotation-set refuses random/provider/command/ssh-keygen for a client id.
- Tests for each; docs/rotation.md.

Co-authored-by: riotcoder <riotcoder@profullstack.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-11-30 20:10:01 +00:00
parent 41ad9f0987
commit 465d0ae23b
11 changed files with 215 additions and 19 deletions

View file

@ -65,11 +65,19 @@ new-value-command | logicsrc teams rotate-keys <team> <project> <env> --key NAME
| `command` | your command prints the new value on stdout | yes, with `--approve` |
| `manual` | a person or agent follows the steps | no |
| `not-secret` | nothing: public config, dropped from the plan | n/a |
| `identifier` | nothing: an OAuth client id (`*_CLIENT_ID`) is registered at the provider, not a secret | never |
Each value can carry its own instructions in an encrypted companion entry,
`__ROTATE__<KEY>`, set with `logicsrc teams rotation-set`. Entries override the
built-in catalog, with one exception: an entry can never make a wallet,
signing or banned-provider key automatic.
built-in catalog, with two exceptions: an entry can never make a wallet,
signing or banned-provider key automatic, and an OAuth client id
(`COINPAY_CLIENT_ID`, `*_OAUTH_CLIENT_ID`, any `*_CLIENT_ID`) is never rotated
at all. A new client id is not a new credential, it is an unregistered client
(`invalid_client`); only the client secret rotates. `rotation-set` refuses an
automatic method for one, the plan reports a stale entry that claims one rotates,
the CoinPay rotators refuse it, and a rotation never writes into a client id that
happens to hold the rotated value under another name (it is named in the result
so the wrong value can be fixed by hand).
Specs can also say `disruptive` (what users notice, such as everyone being
signed out), `never` (never automated), `owner` (`agent` or the account