Skip to content

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

fix(identity/aws-auth): allow for lowercase authoriazation header

Daniel Hougaard69392a4a515a
diff --git a/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts b/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts
index fe7b24783d..409f63b1e0 100644
--- a/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts
+++ b/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts
@@ -94,7 +94,7 @@ export const identityAwsAuthServiceFactory = ({
const headers: TAwsGetCallerIdentityHeaders = JSON.parse(Buffer.from(iamRequestHeaders, "base64").toString());
const body: string = Buffer.from(iamRequestBody, "base64").toString();
- const region = headers.Authorization ? awsRegionFromHeader(headers.Authorization) : null;
+ const region = headers.authorization ? awsRegionFromHeader(headers.Authorization || headers.authorization) : null;
if (!isValidAwsRegion(region)) {
throw new BadRequestError({ message: "Invalid AWS region" });
diff --git a/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts b/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts
index 785b37bbc0..9844c8a63d 100644
--- a/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts
+++ b/backend/src/services/identity-aws-auth/identity-aws-auth-types.ts
@@ -40,7 +40,8 @@ export type TAwsGetCallerIdentityHeaders = {
"X-Amz-Date": string;
"Content-Length": number;
"x-amz-security-token": string;
- Authorization: string;
+ Authorization?: string;
+ authorization?: string;
};
export type TGetCallerIdentityResponse = {