refactor #9

Merged
mhahl-a merged 19 commits from refactor into main 2026-08-14 00:18:00 +00:00
Owner
No description provided.
- _require_machine_write compares against 'write' (machine_tokens.role
  value), not 'service-write'.
- mt_select policy test reads app/rbac.sql (policies moved there from
  init.sql).
- config: derive RBAC_*_ROLE_NAMES from the dropdowns; routes and rbac_sync
  reuse them instead of inline list comprehensions.
- lib/: datetime_utils (as_utc/iso_utc/coerce_utc) + serialize (json_safe/
  row_to_dict); eso _iso, mgmt _row, audit _as_utc_dt, and secret_kinds.as_utc
  delegate to them.
Replace the idempotent ensure_schema() stmts re-apply loop with a versioned
migration runner:

- db/migrations/*.sql is the sole source of truth for DDL. 0001_init.sql and
  0002_rbac.sql are the non-idempotent baseline (run by docker-entrypoint);
  0003..0021 are additive/idempotent migrations derived from the old stmts list
  (legacy-marked dead code removed, redundant re-applies deduplicated).
- app/migrations.py records version + sha256 checksum in
  private.schema_migrations, detects drift, and seeds the baseline on existing
  volumes so they never re-run baseline DDL.
- app/schema.py is now a thin ensure_schema() wrapper: advisory lock ->
  migrations.apply_pending() -> bootstrap admin promotion.
- compose.yml mounts the baseline migrations; db/init.sql, db/rbac.sql and
  app/rbac.sql are removed (folded into db/migrations/0001_init.sql and
  0002_rbac.sql).
Restore the uncommitted UI session onto refactor: icon search inputs
without Go buttons, add-team/project dialogs, and a Shared secrets
page for non-team grants (migration 0022).
fix: allow shared-secret viewers to write secret_recent
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
9e4c86bb09
secret_recent/secret_pins RLS required can_read_project, so opening a
shared secret aborted the view transaction. Gate on secret-row read
access and isolate the recent upsert in a savepoint.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Sigaint/corvus!9
No description provided.