mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 10:26:35 +00:00
requested changes
This commit is contained in:
@@ -94,7 +94,9 @@ 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 || headers.authorization) : null;
|
|
||||||
|
const authHeader = headers.Authorization || headers.authorization;
|
||||||
|
const region = authHeader ? awsRegionFromHeader(authHeader) : null;
|
||||||
|
|
||||||
if (!isValidAwsRegion(region)) {
|
if (!isValidAwsRegion(region)) {
|
||||||
throw new BadRequestError({ message: "Invalid AWS region" });
|
throw new BadRequestError({ message: "Invalid AWS region" });
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ access the Infisical API using the AWS Auth authentication method.
|
|||||||
const credentials = await fromNodeProviderChain()();
|
const credentials = await fromNodeProviderChain()();
|
||||||
|
|
||||||
if (!credentials.accessKeyId || !credentials.secretAccessKey) {
|
if (!credentials.accessKeyId || !credentials.secretAccessKey) {
|
||||||
throw new InfisicalSDKError("Credentials not found");
|
throw new Error("Credentials not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
const iamRequestURL = `https://sts.${region}.amazonaws.com/`;
|
const iamRequestURL = `https://sts.${region}.amazonaws.com/`;
|
||||||
@@ -379,7 +379,7 @@ access the Infisical API using the AWS Auth authentication method.
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { accessToken }
|
data: { accessToken }
|
||||||
} = await axios.post<{ accessToken: string }>("https://app.infisical.com/v1/auth/aws-auth/login", {
|
} = await axios.post<{ accessToken: string }>("https://app.infisical.com/api/v1/auth/aws-auth/login", {
|
||||||
...iamRequest,
|
...iamRequest,
|
||||||
identityId: "<replace-with-your-identity-id>"
|
identityId: "<replace-with-your-identity-id>"
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user