improvement: throw on keyschema leading slash

This commit is contained in:
Scott Wilson
2025-08-14 16:59:26 -07:00
parent a7847f177c
commit d24f5a57a8

View File

@@ -38,6 +38,10 @@ const sleep = async () =>
const getFullPath = ({ path, keySchema, environment }: { path: string; keySchema?: string; environment: string }) => {
if (!keySchema || !keySchema.includes("/")) return path;
if (keySchema.startsWith("/")) {
throw new SecretSyncError({ message: `Key schema cannot contain leading '/'`, shouldRetry: false });
}
const keySchemaSegments = handlebars
.compile(keySchema)({
environment,