mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 08:20:52 +00:00
Complete adding GCP GCE auth
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { IdentityGcpAuthsSchema } from "@app/db/schemas";
|
||||
|
||||
export const ModifiedIdentityGcpAuthsSchema = IdentityGcpAuthsSchema.omit({
|
||||
encryptedCredentials: true,
|
||||
credentialsIV: true,
|
||||
credentialsTag: true
|
||||
}).extend({
|
||||
credentials: z.string()
|
||||
});
|
||||
|
||||
export const validateGcpAuthField = z
|
||||
.string()
|
||||
.trim()
|
||||
.default("")
|
||||
.transform((data) => {
|
||||
if (data === "") return "";
|
||||
// Trim each ID and join with ', ' to ensure formatting
|
||||
return data
|
||||
.split(",")
|
||||
.map((id) => id.trim())
|
||||
.join(", ");
|
||||
});
|
||||
Reference in New Issue
Block a user