perf: sync protocol and core hardening updates
This commit is contained in:
parent
152fed3b87
commit
4390ebf5a9
283 changed files with 29231 additions and 2295 deletions
17
deploy/migrations/0067_auth_key_last_used.up.sql
Normal file
17
deploy/migrations/0067_auth_key_last_used.up.sql
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
-- A physical connection touches last_used_at atomically while loading its key. Orphan GC uses
|
||||
-- this watermark in addition to the in-memory active-key snapshot, closing the Get->Register
|
||||
-- race without turning the per-frame encrypted fast path into a database write.
|
||||
ALTER TABLE public.auth_keys
|
||||
ADD COLUMN IF NOT EXISTS last_used_at timestamptz NOT NULL DEFAULT now();
|
||||
|
||||
CREATE INDEX IF NOT EXISTS auth_keys_orphan_last_used_idx
|
||||
ON public.auth_keys (last_used_at, auth_key_id);
|
||||
|
||||
-- DeleteOrphaned now seeks exclusively by last_used_at. Keeping the transitional 0065
|
||||
-- created_at index would duplicate auth-key insert/delete maintenance without serving a query.
|
||||
DROP INDEX IF EXISTS public.auth_keys_orphan_retention_idx;
|
||||
|
||||
-- Delete/revoke and orphan-retention probes both resolve perm->temp bindings. The original
|
||||
-- primary key only covers temp_auth_key_id, so the reverse predicate otherwise scans the table.
|
||||
CREATE INDEX IF NOT EXISTS temp_auth_key_bindings_perm_idx
|
||||
ON public.temp_auth_key_bindings (perm_auth_key_id);
|
||||
Loading…
Add table
Add a link
Reference in a new issue