scaffolder-backend: fix permission rule schema

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-12-22 10:02:45 +01:00
parent bb6bce457e
commit 8c8430b52d
@@ -106,7 +106,9 @@ function buildHasProperty<Schema extends z.ZodType<JsonPrimitive>>({
key: z
.string()
.describe(`Property within the action parameters to match on`),
value: valueSchema.describe(`Value of the given property to match on`),
value: valueSchema
.optional()
.describe(`Value of the given property to match on`),
}) as unknown as z.ZodType<{ key: string; value?: z.infer<Schema> }>,
apply: (resource, { key, value }) => {
const foundValue = get(resource.input, key);