mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-02 05:55:10 +09:00
chore: unstage devel changes (#1786)
* Revert "chore: Update dist" This reverts commite8614cfbf0. * Revert "chore(deps): bump @aws-sdk/client-sts from 3.1045.0 to 3.1049.0 (#1782)" This reverts commit4684f47f89. * Revert "chore: Update dist" This reverts commit48b8685c96. * Revert "chore(deps-dev): bump @smithy/property-provider from 4.3.1 to 4.3.3 (#1783)" This reverts commitfe6ad3af19. * Revert "chore: Update dist" This reverts commit2520c5e921. * Revert "chore(deps-dev): bump @aws-sdk/credential-provider-env (#1784)" This reverts commitbc1093db1d. * Revert "chore(deps-dev): bump @types/node from 25.7.0 to 25.9.0 (#1785)" This reverts commitffde832a1d. * Revert "chore: Update dist" This reverts commit707acd96f6. * Revert "chore(deps): bump @smithy/node-http-handler from 4.7.1 to 4.7.3 (#1781)" This reverts commita7c33ae483. * Revert "chore: update README for additional claim support (#1779)" This reverts commit713aaabfec. * Revert "chore: Update dist" This reverts commite6e8eba750. * Revert "fix: skip credential check on output-env-credentials: false (#1778)" This reverts commit58e7c47adf. * Revert "chore: document forgejo compatibility (#1776)" This reverts commitf35a7d7d7e. * Revert "chore: Update dist" This reverts commit3884f59ecd. * Revert "feat: add additional session tags by default (#1775)" This reverts commite0ba768507. * Revert "chore: Update dist" This reverts commit6795889618. * Revert "feat: expose run id in STS client user-agent (#1774)" This reverts commit29d1be3027. * Revert "chore(deps-dev): bump @types/node from 25.6.0 to 25.7.0 (#1773)" This reverts commitef734cca81. * Revert "chore(deps-dev): bump @biomejs/biome from 2.4.14 to 2.4.15 (#1772)" This reverts commit7521c55910. * Revert "chore: Update dist" This reverts commitc0e2737f14. * Revert "chore(deps): bump @smithy/node-http-handler from 4.6.1 to 4.7.1 (#1770)" This reverts commitdbd503f368. * Revert "chore: Update dist" This reverts commit18a236fbd1. * Revert "chore(deps-dev): bump @smithy/property-provider from 4.2.14 to 4.3.1 (#1771)" This reverts commit1ab31502aa. * Revert "chore(deps-dev): bump @vitest/coverage-v8 from 4.1.5 to 4.1.6 (#1768)" This reverts commit1fb495c4b2. * Revert "chore: Update dist" This reverts commit1e8fec8ea1. * Revert "chore(deps): bump @aws-sdk/client-sts from 3.1044.0 to 3.1045.0 (#1767)" This reverts commita388f23f7d. * Revert "chore: update documentation for environment workflows (#1766)" This reverts commit3f7e1b63d7. * Revert "feat: add regex validation to role-session-name (#1765)" This reverts commite35449909c. * Revert "chore: Update dist" This reverts commit958a80fc34. * Revert "feat: add more retry logic and better logging (#1764)" This reverts commit540d0c13ae. * Revert "chore: automate README version bumping (#1763)" This reverts commit07ada0fe07. * Revert "chore: Update dist" This reverts commitf8d4eb68a9. * Revert "feat: support custom STS endpoints (#1762)" This reverts commit8d52d05d7a. * Revert "chore: Update dist" This reverts commit681892c11b. * Revert "chore: configure codeql to ignore generated code (#1760)" This reverts commitdc2353e57a. * Revert "feat: Allow custom session tags to be passed when assuming a role (#1759)" This reverts commit61f50f630f. * Revert "chore: automatic major version tagging (#1565)" This reverts commitc36525a567. * Revert "chore: bump unit test node version (#1758)" This reverts commit39d1702721. * Revert "chore(deps): bump @aws-sdk/client-sts from 3.1043.0 to 3.1044.0 (#1754)" This reverts commit4cfda40a13. * Revert "chore(deps-dev): bump @biomejs/biome from 2.4.13 to 2.4.14 (#1756)" This reverts commit8856e12f3a. * Revert "chore(deps): bump @actions/core from 2.0.3 to 3.0.1 (#1746)" This reverts commit64d8e82527. * Revert "chore(deps-dev): bump vitest from 3.2.4 to 4.1.5 (#1748)" This reverts commit78f374f6d1.
This commit is contained in:
+10
-15
@@ -3,18 +3,15 @@ import { STSClient } from '@aws-sdk/client-sts';
|
||||
import type { AwsCredentialIdentity } from '@aws-sdk/types';
|
||||
import { NodeHttpHandler } from '@smithy/node-http-handler';
|
||||
import { ProxyAgent } from 'proxy-agent';
|
||||
import { buildCustomUserAgent, errorMessage, getCallerIdentity } from './helpers';
|
||||
import { errorMessage, getCallerIdentity } from './helpers';
|
||||
import { ProxyResolver } from './ProxyResolver';
|
||||
|
||||
if (!process.env.AWS_EXECUTION_ENV) {
|
||||
process.env.AWS_EXECUTION_ENV = 'GitHubActions';
|
||||
}
|
||||
const USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
||||
|
||||
export interface CredentialsClientProps {
|
||||
region?: string;
|
||||
proxyServer?: string;
|
||||
noProxy?: string;
|
||||
stsEndpoint?: string;
|
||||
roleChaining: boolean;
|
||||
}
|
||||
|
||||
@@ -22,7 +19,6 @@ export class CredentialsClient {
|
||||
public region?: string;
|
||||
private _stsClient?: STSClient;
|
||||
private readonly requestHandler?: NodeHttpHandler;
|
||||
private readonly stsEndpoint?: string;
|
||||
private roleChaining?: boolean;
|
||||
|
||||
constructor(props: CredentialsClientProps) {
|
||||
@@ -45,20 +41,19 @@ export class CredentialsClient {
|
||||
httpAgent: handler,
|
||||
});
|
||||
}
|
||||
if (props.stsEndpoint) {
|
||||
this.stsEndpoint = props.stsEndpoint;
|
||||
}
|
||||
this.roleChaining = props.roleChaining;
|
||||
}
|
||||
|
||||
public get stsClient(): STSClient {
|
||||
if (!this._stsClient || this.roleChaining) {
|
||||
this._stsClient = new STSClient({
|
||||
customUserAgent: buildCustomUserAgent(),
|
||||
...(this.region !== undefined && { region: this.region }),
|
||||
...(this.stsEndpoint !== undefined && { endpoint: this.stsEndpoint }),
|
||||
...(this.requestHandler !== undefined && { requestHandler: this.requestHandler }),
|
||||
});
|
||||
const config = { customUserAgent: USER_AGENT } as {
|
||||
customUserAgent: string;
|
||||
region?: string;
|
||||
requestHandler?: NodeHttpHandler;
|
||||
};
|
||||
if (this.region !== undefined) config.region = this.region;
|
||||
if (this.requestHandler !== undefined) config.requestHandler = this.requestHandler;
|
||||
this._stsClient = new STSClient(config);
|
||||
}
|
||||
return this._stsClient;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user