mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 08:27:22 +00:00
fix(identity/aws-auth): allow for lowercase authoriazation header
This commit is contained in:
@@ -94,7 +94,7 @@ export const identityAwsAuthServiceFactory = ({
|
|||||||
|
|
||||||
const headers: TAwsGetCallerIdentityHeaders = JSON.parse(Buffer.from(iamRequestHeaders, "base64").toString());
|
const headers: TAwsGetCallerIdentityHeaders = JSON.parse(Buffer.from(iamRequestHeaders, "base64").toString());
|
||||||
const body: string = Buffer.from(iamRequestBody, "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)) {
|
if (!isValidAwsRegion(region)) {
|
||||||
throw new BadRequestError({ message: "Invalid AWS region" });
|
throw new BadRequestError({ message: "Invalid AWS region" });
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ export type TAwsGetCallerIdentityHeaders = {
|
|||||||
"X-Amz-Date": string;
|
"X-Amz-Date": string;
|
||||||
"Content-Length": number;
|
"Content-Length": number;
|
||||||
"x-amz-security-token": string;
|
"x-amz-security-token": string;
|
||||||
Authorization: string;
|
Authorization?: string;
|
||||||
|
authorization?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TGetCallerIdentityResponse = {
|
export type TGetCallerIdentityResponse = {
|
||||||
|
|||||||
Reference in New Issue
Block a user