forked from mtusi2026/mtusi2026lab7
fix: address openbao-secrets verify findings
bao_check now compares cert auth roles and policies in OpenBao with the repository and tries every foreign identity against every role and without a role name; API and migrations exit with code 2 on invalid settings; stop-at-start runs its attempts next to the stand's OpenBao again; openbao-outage checks the exit code, the record and the restart; run_docker restarts only services started before seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+16
-1
@@ -18,11 +18,26 @@ URL берётся из `Database.url` секции роли migrate с паро
|
||||
import asyncio
|
||||
|
||||
from alembic import context
|
||||
from pydantic import ValidationError
|
||||
from sqlalchemy import pool, text
|
||||
from sqlalchemy.engine import Connection
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from src.config import settings
|
||||
from src.infra import early_stop
|
||||
|
||||
try:
|
||||
from src.config import settings
|
||||
except ValidationError as e:
|
||||
# неверные настройки (в том числе http-адрес OpenBao): логгер их тоже
|
||||
# читает и не настроен. Запись без значений полей и код 2 вместо
|
||||
# traceback alembic с кодом 1, как у точек входа процессов (change
|
||||
# openbao-secrets, правки verify W2)
|
||||
early_stop.write_settings_error(
|
||||
"Invalid migration settings",
|
||||
module="migrations",
|
||||
error=e,
|
||||
)
|
||||
raise SystemExit(2) from None
|
||||
from src.config.settings import Database
|
||||
from src.infra.db import roles
|
||||
from src.infra.db.models import Base
|
||||
|
||||
Reference in New Issue
Block a user