fix: finish 2.9.0 plugin moves and get every check green

This commit is contained in:
LukeGus committed 2026-09-24 23:35:18 -05:00
1 parent 8c1e02af89
commit 6489b62ece
335 files changed
+29878 -17749

No files matched your search

+19
View File
@@ -396,3 +396,22 @@ export function parseSshCertificate(line: string): SshCertificateInfo {
validBefore: toDate(validBefore),
};
}
/** Save-time checks for the admin page: a bad URL or fingerprint says so there. */
export function validateCaSettings(
values: Record<string, unknown>,
): Record<string, string> {
const errors: Record<string, string> = {};
const check = (key: string, normalize: (raw: string) => string) => {
const value = values[key];
if (typeof value !== "string" || value.trim() === "") return;
try {
normalize(value);
} catch (error) {
errors[key] = error instanceof Error ? error.message : String(error);
}
};
check("caUrl", normalizeCaUrl);
check("fingerprint", normalizeFingerprint);
return errors;
}
+2
View File
@@ -6,8 +6,10 @@ import { createRuntime } from "./runtime.js";
import { createAuthSessions } from "./auth-session.js";
import { createStepCaProvider } from "./provider.js";
import { PUBLIC_PATHS, registerRoutes } from "./routes.js";
import { validateCaSettings } from "./client.js";
export async function activate(ctx: PluginContext) {
ctx.settings.onValidate("admin", validateCaSettings);
const table = await ctx.db.define(certsTable);
const certs = createCertStore(ctx, table);