mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-03 06:05:04 +09:00
fix: correct outputs for role chaining (#1633)
re-instantiate stsClient when roleChaining technically a breaking change
This commit is contained in:
+6
-2
@@ -36,9 +36,10 @@ class CredentialsClient {
|
|||||||
httpAgent: handler,
|
httpAgent: handler,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.roleChaining = props.roleChaining;
|
||||||
}
|
}
|
||||||
get stsClient() {
|
get stsClient() {
|
||||||
if (!this._stsClient) {
|
if (!this._stsClient || this.roleChaining) {
|
||||||
const config = { customUserAgent: USER_AGENT };
|
const config = { customUserAgent: USER_AGENT };
|
||||||
if (this.region !== undefined)
|
if (this.region !== undefined)
|
||||||
config.region = this.region;
|
config.region = this.region;
|
||||||
@@ -756,7 +757,10 @@ async function run() {
|
|||||||
}
|
}
|
||||||
(0, helpers_1.exportRegion)(region, outputEnvCredentials);
|
(0, helpers_1.exportRegion)(region, outputEnvCredentials);
|
||||||
// Instantiate credentials client
|
// Instantiate credentials client
|
||||||
const clientProps = { region };
|
const clientProps = {
|
||||||
|
region,
|
||||||
|
roleChaining,
|
||||||
|
};
|
||||||
if (proxyServer)
|
if (proxyServer)
|
||||||
clientProps.proxyServer = proxyServer;
|
clientProps.proxyServer = proxyServer;
|
||||||
if (noProxy)
|
if (noProxy)
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ export interface CredentialsClientProps {
|
|||||||
region?: string;
|
region?: string;
|
||||||
proxyServer?: string;
|
proxyServer?: string;
|
||||||
noProxy?: string;
|
noProxy?: string;
|
||||||
|
roleChaining: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CredentialsClient {
|
export class CredentialsClient {
|
||||||
public region?: string;
|
public region?: string;
|
||||||
private _stsClient?: STSClient;
|
private _stsClient?: STSClient;
|
||||||
private readonly requestHandler?: NodeHttpHandler;
|
private readonly requestHandler?: NodeHttpHandler;
|
||||||
|
private roleChaining?: boolean;
|
||||||
|
|
||||||
constructor(props: CredentialsClientProps) {
|
constructor(props: CredentialsClientProps) {
|
||||||
if (props.region !== undefined) {
|
if (props.region !== undefined) {
|
||||||
@@ -39,10 +41,11 @@ export class CredentialsClient {
|
|||||||
httpAgent: handler,
|
httpAgent: handler,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.roleChaining = props.roleChaining;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get stsClient(): STSClient {
|
public get stsClient(): STSClient {
|
||||||
if (!this._stsClient) {
|
if (!this._stsClient || this.roleChaining) {
|
||||||
const config = { customUserAgent: USER_AGENT } as {
|
const config = { customUserAgent: USER_AGENT } as {
|
||||||
customUserAgent: string;
|
customUserAgent: string;
|
||||||
region?: string;
|
region?: string;
|
||||||
|
|||||||
+4
-1
@@ -121,7 +121,10 @@ export async function run() {
|
|||||||
exportRegion(region, outputEnvCredentials);
|
exportRegion(region, outputEnvCredentials);
|
||||||
|
|
||||||
// Instantiate credentials client
|
// Instantiate credentials client
|
||||||
const clientProps: { region: string; proxyServer?: string; noProxy?: string } = { region };
|
const clientProps: { region: string; proxyServer?: string; noProxy?: string; roleChaining: boolean } = {
|
||||||
|
region,
|
||||||
|
roleChaining,
|
||||||
|
};
|
||||||
if (proxyServer) clientProps.proxyServer = proxyServer;
|
if (proxyServer) clientProps.proxyServer = proxyServer;
|
||||||
if (noProxy) clientProps.noProxy = noProxy;
|
if (noProxy) clientProps.noProxy = noProxy;
|
||||||
const credentialsClient = new CredentialsClient(clientProps);
|
const credentialsClient = new CredentialsClient(clientProps);
|
||||||
|
|||||||
Reference in New Issue
Block a user