feat: move vault ssh signing into a plugin (C5)

This commit is contained in:
LukeGus committed 2026-09-24 20:24:09 -05:00
1 parent b027717c46
commit 6e56c90aac
198 files changed
+19717 -3445

No files matched your search

@@ -0,0 +1,38 @@
-- vault 0001: adopt_vault_tables
-- Generated by termix-plugin migrations. Review before committing.
CREATE TABLE IF NOT EXISTS "vault_profiles" (
"id" integer PRIMARY KEY AUTOINCREMENT,
"user_id" text NOT NULL,
"name" text NOT NULL,
"description" text,
"folder" text,
"tags" text,
"vault_addr" text NOT NULL,
"vault_namespace" text,
"oidc_mount" text,
"oidc_role" text,
"ssh_mount" text,
"ssh_role" text NOT NULL,
"valid_principals" text,
"key_type" text,
"shared" integer NOT NULL DEFAULT 0,
"sync_id" text UNIQUE,
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE
);
ALTER TABLE "vault_profiles" RENAME TO "p_vault_profiles";
CREATE TABLE IF NOT EXISTS "vault_tokens" (
"id" integer PRIMARY KEY AUTOINCREMENT,
"user_id" text NOT NULL,
"profile_id" integer NOT NULL,
"ssh_cert" text NOT NULL,
"private_key" text NOT NULL,
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" text NOT NULL,
"last_used" text,
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE
);
CREATE UNIQUE INDEX IF NOT EXISTS "idx_vault_tokens_user_profile" ON "vault_tokens" ("user_id", "profile_id");
ALTER TABLE "vault_tokens" RENAME TO "p_vault_tokens";