Refactor secret-ref format registration to use a UI hint for Paperclip secret UUIDs
This commit is contained in:
@@ -35,8 +35,9 @@ export function validateInstanceConfig(
|
|||||||
const applyFormats = (addFormats as any).default ?? addFormats;
|
const applyFormats = (addFormats as any).default ?? addFormats;
|
||||||
applyFormats(ajv);
|
applyFormats(ajv);
|
||||||
// Register the secret-ref format used by plugin manifests to mark fields that
|
// Register the secret-ref format used by plugin manifests to mark fields that
|
||||||
// hold a Paperclip secret UUID rather than a raw value.
|
// hold a Paperclip secret UUID rather than a raw value. The format is a UI
|
||||||
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);
|
// hint only — UUID validation happens in the secrets handler at resolve time.
|
||||||
|
ajv.addFormat("secret-ref", { validate: () => true });
|
||||||
const validate = ajv.compile(schema);
|
const validate = ajv.compile(schema);
|
||||||
const valid = validate(configJson);
|
const valid = validate(configJson);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user