Skip to content

Commit

Permalink
Merge branch 'main' into epolon/wait-for-function-perms
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 27, 2024
2 parents 0c7146b + 6c0f74e commit 54efe09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { existsSync, promises as fs } from 'fs';
import * as querystring from 'node:querystring';
import * as os from 'os';
import * as path from 'path';
import {
Expand All @@ -23,6 +24,7 @@ import { PutObjectLockConfigurationCommand } from '@aws-sdk/client-s3';
import { CreateTopicCommand, DeleteTopicCommand } from '@aws-sdk/client-sns';
import { AssumeRoleCommand, GetCallerIdentityCommand } from '@aws-sdk/client-sts';
import * as mockttp from 'mockttp';
import { CompletedRequest } from 'mockttp';
import {
cloneDirectory,
integTest,
Expand Down Expand Up @@ -2846,10 +2848,19 @@ integTest('requests go through a proxy when configured',
});
} finally {
await fs.rm(certDir, { recursive: true, force: true });
await proxyServer.stop();
}

// Checking that there was some interaction with the proxy
const requests = await endpoint.getSeenRequests();
expect(requests.length).toBeGreaterThan(0);
const actionsUsed = actions(await endpoint.getSeenRequests());
expect(actionsUsed).toContain('AssumeRole');
expect(actionsUsed).toContain('CreateChangeSet');
}),
);

function actions(requests: CompletedRequest[]): string[] {
return [...new Set(requests
.map(req => req.body.buffer.toString('utf-8'))
.map(body => querystring.decode(body))
.map(x => x.Action as string)
.filter(action => action != null))];
}
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export class SdkProvider {
},
clientConfig: {
region,
...this.requestHandler,
requestHandler: this.requestHandler,
},
})();

Expand Down

0 comments on commit 54efe09

Please sign in to comment.