Skip to content

Commit 7ceaf96

Browse files
authored
fix: correct outputs for role chaining (#1633)
re-instantiate stsClient when roleChaining technically a breaking change
1 parent a7a2c11 commit 7ceaf96

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

dist/index.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CredentialsClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ export interface CredentialsClientProps {
1212
region?: string;
1313
proxyServer?: string;
1414
noProxy?: string;
15+
roleChaining: boolean;
1516
}
1617

1718
export class CredentialsClient {
1819
public region?: string;
1920
private _stsClient?: STSClient;
2021
private readonly requestHandler?: NodeHttpHandler;
22+
private roleChaining?: boolean;
2123

2224
constructor(props: CredentialsClientProps) {
2325
if (props.region !== undefined) {
@@ -39,10 +41,11 @@ export class CredentialsClient {
3941
httpAgent: handler,
4042
});
4143
}
44+
this.roleChaining = props.roleChaining;
4245
}
4346

4447
public get stsClient(): STSClient {
45-
if (!this._stsClient) {
48+
if (!this._stsClient || this.roleChaining) {
4649
const config = { customUserAgent: USER_AGENT } as {
4750
customUserAgent: string;
4851
region?: string;

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ export async function run() {
121121
exportRegion(region, outputEnvCredentials);
122122

123123
// Instantiate credentials client
124-
const clientProps: { region: string; proxyServer?: string; noProxy?: string } = { region };
124+
const clientProps: { region: string; proxyServer?: string; noProxy?: string; roleChaining: boolean } = {
125+
region,
126+
roleChaining,
127+
};
125128
if (proxyServer) clientProps.proxyServer = proxyServer;
126129
if (noProxy) clientProps.noProxy = noProxy;
127130
const credentialsClient = new CredentialsClient(clientProps);

0 commit comments

Comments
 (0)