All the UI fixes for now

This commit is contained in:
2026-04-11 17:21:52 +02:00
parent 1bd51ecb5d
commit c67259ebe0
15 changed files with 565 additions and 112 deletions

View File

@@ -39,6 +39,28 @@ async function authenticate(): Promise<string> {
return token;
}
/**
* Read a KV v2 secret. Path relative to KV mount.
* Returns .data.data object or null if 404.
*/
export async function readSecret(
path: string
): Promise<Record<string, string> | null> {
const token = await authenticate();
const res = await fetch(`${OPENBAO_ADDR}/v1/secret/data/${path}`, {
headers: { "X-Vault-Token": token },
});
if (res.status === 404) return null;
if (!res.ok) {
const body = await res.text();
throw new Error(`OpenBao read failed: ${res.status} ${body}`);
}
const json = await res.json();
return json.data?.data ?? null;
}
export async function writePackageSecrets(
tenantId: string,
packageId: string,