mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* test: move compatibility tests into this repo * fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler * fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest * test: add sdk tests for multipart S3 copy coverage * fix: cover and fix smithy cbor and multipart s3 copy regressions * test: migrate more test coverage to new folder * test: add missing ec2 expectation in healthcheck test * docs: update READMEs in `./compatibility-tests`
32 lines
848 B
TypeScript
32 lines
848 B
TypeScript
/**
|
|
* STS integration tests.
|
|
*/
|
|
|
|
import { describe, it, expect, beforeAll } from 'vitest';
|
|
import { STSClient, GetCallerIdentityCommand, AssumeRoleCommand } from '@aws-sdk/client-sts';
|
|
import { makeClient, ACCOUNT } from './setup';
|
|
|
|
describe('STS', () => {
|
|
let sts: STSClient;
|
|
|
|
beforeAll(() => {
|
|
sts = makeClient(STSClient);
|
|
});
|
|
|
|
it('should get caller identity', async () => {
|
|
const response = await sts.send(new GetCallerIdentityCommand({}));
|
|
expect(response.Account).toBeTruthy();
|
|
expect(response.UserId).toBeTruthy();
|
|
});
|
|
|
|
it('should assume role', async () => {
|
|
const response = await sts.send(
|
|
new AssumeRoleCommand({
|
|
RoleArn: `arn:aws:iam::${ACCOUNT}:role/test-role`,
|
|
RoleSessionName: 'test-session',
|
|
})
|
|
);
|
|
expect(response.Credentials?.AccessKeyId).toBeTruthy();
|
|
});
|
|
});
|