mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 19:26:07 +00:00
improvement: throw on keyschema leading slash
This commit is contained in:
@@ -38,6 +38,10 @@ const sleep = async () =>
|
|||||||
const getFullPath = ({ path, keySchema, environment }: { path: string; keySchema?: string; environment: string }) => {
|
const getFullPath = ({ path, keySchema, environment }: { path: string; keySchema?: string; environment: string }) => {
|
||||||
if (!keySchema || !keySchema.includes("/")) return path;
|
if (!keySchema || !keySchema.includes("/")) return path;
|
||||||
|
|
||||||
|
if (keySchema.startsWith("/")) {
|
||||||
|
throw new SecretSyncError({ message: `Key schema cannot contain leading '/'`, shouldRetry: false });
|
||||||
|
}
|
||||||
|
|
||||||
const keySchemaSegments = handlebars
|
const keySchemaSegments = handlebars
|
||||||
.compile(keySchema)({
|
.compile(keySchema)({
|
||||||
environment,
|
environment,
|
||||||
|
|||||||
Reference in New Issue
Block a user