Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: oci auth for go sdk (#4152)

Daniel Hougaard0e07ebae7b47
diff --git a/backend/src/server/routes/v1/identity-oci-auth-router.ts b/backend/src/server/routes/v1/identity-oci-auth-router.ts
index de9866c85e..e529f300bd 100644
--- a/backend/src/server/routes/v1/identity-oci-auth-router.ts
+++ b/backend/src/server/routes/v1/identity-oci-auth-router.ts
@@ -28,7 +28,17 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
.object({
authorization: z.string(),
host: z.string(),
- "x-date": z.string()
+ "x-date": z.string().optional(),
+ date: z.string().optional()
+ })
+ .superRefine((val, ctx) => {
+ if (!val.date && !val["x-date"]) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: "Either date or x-date must be provided",
+ path: ["headers", "date"]
+ });
+ }
})
.describe(OCI_AUTH.LOGIN.headers)
}),
diff --git a/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts b/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts
index c7a131bde5..8eb33a8661 100644
--- a/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts
+++ b/backend/src/services/identity-oci-auth/identity-oci-auth-types.ts
@@ -6,7 +6,8 @@ export type TLoginOciAuthDTO = {
headers: {
authorization: string;
host: string;
- "x-date": string;
+ "x-date"?: string;
+ date?: string;
};
};