fix: address rotation-revocation verify findings

Close handshakes and logins that started before a revocation or a
password change, converge after a failure in any phase, survive a closed
terminal, lock parallel commands and make the drill detect a dead load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 10:11:17 +03:00
co-authored by Claude Opus 5.5
parent f702a702d5
commit 6b637109de
41 changed files with 4092 additions and 291 deletions
+14 -4
View File
@@ -31,7 +31,8 @@ token и доли читаются в память, токен уходит то
seed — секреты процессов из модели compose (`docker compose config
--format json`, в памяти) в KV; новая версия — только при
изменении; `--changed-services-file` — сервисы, читающие
изменившиеся пути
изменившиеся пути; `--check` — только сверка: версия пути и
`unchanged` / `differs`, ничего не пишется
ready — подъём: ждать слушатель, init на пустом, код 2 на
запечатанном, затем configure и seed
rewrite — учения сверки версий (change openbao-tooling, design,
@@ -783,10 +784,13 @@ class Operator:
ok=(200, 404),
)
data = (current.get("data") or {}) if status == 200 else {}
version = (data.get("metadata") or {}).get("version")
if data.get("data") == desired:
version = (data.get("metadata") or {}).get("version")
log(f"kv {KV_MOUNT}/{path}: version {version}, unchanged")
continue
if getattr(self.args, "check", False):
log(f"kv {KV_MOUNT}/{path}: version {version}, differs")
continue
_, written = self.http.request(
"POST",
kv_data_path(path),
@@ -862,13 +866,14 @@ class Operator:
role, keep = self.args.role, self.args.keep_serial
revoked = kept = 0
for accessor in self._list("auth/token/accessors", token):
# 403 / 404 (и 400 у отзыва) — токен уже истёк или отозван
# 400 («invalid accessor») / 403 / 404 — токен истёк или отозван
# между списком и этим вызовом
status, found = self.http.request(
"POST",
"auth/token/lookup-accessor",
{"accessor": accessor},
token=token,
ok=(200, 403, 404),
ok=(200, 400, 403, 404),
)
data = (found.get("data") or {}) if status == 200 else {} # noqa: PLR2004
if (
@@ -1000,6 +1005,11 @@ def build_parser() -> argparse.ArgumentParser:
sub.add_argument("--compose-config")
seed = commands.add_parser("seed")
seed.add_argument("--changed-services-file")
seed.add_argument(
"--check",
action="store_true",
help="compare only: versions and paths that differ, nothing written",
)
seed.add_argument(
"--compose-config",
help="compose model JSON instead of docker compose config",