Skip to content

Commit 2ce384f

Browse files
committed
fix bug: AWSInstanceProfileCredentials.profile() returns a promise not a string
1 parent a4957eb commit 2ce384f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

frontend/server/aws-helper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class AWSInstanceProfileCredentials {
8282

8383
async _fetchCredentials(): Promise<IAWSMetadataCredentials | undefined> {
8484
try {
85-
const resp = await fetch(`${metadataUrl}/iam/security-credentials/${this.profile()}`);
85+
const resp = await fetch(`${metadataUrl}/iam/security-credentials/${await this.profile()}`);
8686
return resp.json();
8787
} catch (error) {
8888
console.error(`Unable to fetch credentials from AWS metadata store: ${error}`);

frontend/server/minio-helper.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jest.mock('./aws-helper');
2020
const MockedMinioClient: jest.Mock = MinioClient as any;
2121

2222
describe('createMinioClient', () => {
23-
afterEach(() => {
24-
MockedMinioClient.mockClear();
23+
beforeEach(() => {
24+
(MinioClient as any).mockClear();
2525
(awsInstanceProfileCredentials.getCredentials as jest.Mock).mockClear();
2626
(awsInstanceProfileCredentials.ok as jest.Mock).mockClear();
2727
});

0 commit comments

Comments
 (0)