fix: oci auth for go sdk (#4152)

This commit is contained in:
Daniel Hougaard
2025-07-16 16:36:28 +05:30
committed by GitHub
parent a94a26263a
commit 0e07ebae7b
2 changed files with 13 additions and 2 deletions
@@ -28,7 +28,17 @@ export const registerIdentityOciAuthRouter = async (server: FastifyZodProvider)
.object({ .object({
authorization: z.string(), authorization: z.string(),
host: 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) .describe(OCI_AUTH.LOGIN.headers)
}), }),
@@ -6,7 +6,8 @@ export type TLoginOciAuthDTO = {
headers: { headers: {
authorization: string; authorization: string;
host: string; host: string;
"x-date": string; "x-date"?: string;
date?: string;
}; };
}; };