From 6e1fb3d500cc9ca2638b9647a68771854e283f9d Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Mon, 23 Sep 2024 19:14:37 +0400 Subject: [PATCH] fixes --- src/custom/auth.ts | 4 ++-- test/index.ts | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/custom/auth.ts b/src/custom/auth.ts index 409f9b3..91a82f8 100644 --- a/src/custom/auth.ts +++ b/src/custom/auth.ts @@ -23,8 +23,8 @@ export default class AuthClient { } awsIamAuth = { - login: async (options: AwsAuthLoginOptions) => { - const identityId = options.identityId || process.env[MACHINE_IDENTITY_ID_ENV_NAME]; + login: async (options?: AwsAuthLoginOptions) => { + const identityId = options?.identityId || process.env[MACHINE_IDENTITY_ID_ENV_NAME]; if (!identityId) { throw new Error("Identity ID is required for AWS IAM authentication"); diff --git a/test/index.ts b/test/index.ts index bc883b6..b44059f 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1,17 +1,14 @@ -import { AxiosError } from "axios"; import { InfisicalSDK } from "../src"; -const PROJECT_ID = "PROJECT_ID"; +const PROJECT_ID = "65a02bdfa77d9b8197956da1"; (async () => { const client = new InfisicalSDK({ siteUrl: "http://localhost:8080" // Optional, defaults to https://app.infisical.com }); - await client.auth().universalAuth.login({ - // For localhost - clientId: "CLIENT_ID", - clientSecret: "CLIENT_SECRET" + await client.auth().awsIamAuth.login({ + identityId: "84b548bf-6556-40f6-9ef9-838708fae049" }); const allSecrets = await client.secrets().listSecrets({