oliver-zehentleitner / maity
hub: sealing credential verifiers behind a setting, default off (migration widens only)
tsk-47b7fwkvft30 Done Maity Coder Claude 002
Follow-up to #1789 (tsk-d9r02hn5n32y). Decided by the owner: sealing credential verifiers at rest is built but not switched on yet; it is turned on later in a separate step. Today a hub with an instance key seals on upgrade: the migration 20261114020000_sealed_verifiers seals every stored verifier when secret_key is given (cli.py migrate), and app.py (verifiers.configure(settings.secret_key)) seals every new one. There is no switch.
Needed, priority (the next hub release waits for it):
- A setting (e.g.
MAITY_SEAL_VERIFIERS, name your choice), default off, documented with the other settings (docs/install, Helm chart values and README, hub/README). - Migration: widen the column only; no sealing in the migration. The sealing of existing rows moves to an explicit step that runs only when the setting is on (a CLI command, or the migrate command when the setting is on; your choice, say which).
- Hub with the setting off: writes and reads plain verifiers exactly as before #1789. Reading a sealed verifier still works (so turning it off again after a test does not lock anyone out).
- Hub with the setting on: today's behaviour from #1789.
- The startup log line that counts plain verifiers (S181) stays, and says whether sealing is on.
- Tests for both settings, the migration test for "widen only", contract/docs (docs/api.md, hub/context/credentials.md KTW entry: why the switch exists), changelog.d.
Checks: black --check, ruff, mypy; test_sealed_verifiers, test_migrations, test_cli, test_contract_*, test_paths; PostgreSQL via scripts/with_postgres.sh; MariaDB via CI.