Refactor secret-ref format registration to use a UI hint for Paperclip secret UUIDs

This commit is contained in:
gsxdsm
2026-03-14 15:43:56 -07:00
parent 6d65800173
commit 6c7ebaeb59

View File

@@ -35,8 +35,9 @@ export function validateInstanceConfig(
const applyFormats = (addFormats as any).default ?? addFormats;
applyFormats(ajv);
// Register the secret-ref format used by plugin manifests to mark fields that
// hold a Paperclip secret UUID rather than a raw value.
ajv.addFormat("secret-ref", /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
// hold a Paperclip secret UUID rather than a raw value. The format is a UI
// hint only — UUID validation happens in the secrets handler at resolve time.
ajv.addFormat("secret-ref", { validate: () => true });
const validate = ajv.compile(schema);
const valid = validate(configJson);