feat: support custom STS endpoints (#1762)

Closes #1067. This is a advanced option
and is not needed for most deployments.
This commit is contained in:
Tom Keller
2026-05-07 14:50:17 -07:00
committed by GitHub
parent 681892c11b
commit 8d52d05d7a
6 changed files with 201 additions and 117 deletions
+7
View File
@@ -12,6 +12,7 @@ export interface CredentialsClientProps {
region?: string;
proxyServer?: string;
noProxy?: string;
stsEndpoint?: string;
roleChaining: boolean;
}
@@ -19,6 +20,7 @@ export class CredentialsClient {
public region?: string;
private _stsClient?: STSClient;
private readonly requestHandler?: NodeHttpHandler;
private readonly stsEndpoint?: string;
private roleChaining?: boolean;
constructor(props: CredentialsClientProps) {
@@ -41,6 +43,9 @@ export class CredentialsClient {
httpAgent: handler,
});
}
if (props.stsEndpoint) {
this.stsEndpoint = props.stsEndpoint;
}
this.roleChaining = props.roleChaining;
}
@@ -49,9 +54,11 @@ export class CredentialsClient {
const config = { customUserAgent: USER_AGENT } as {
customUserAgent: string;
region?: string;
endpoint?: string;
requestHandler?: NodeHttpHandler;
};
if (this.region !== undefined) config.region = this.region;
if (this.stsEndpoint !== undefined) config.endpoint = this.stsEndpoint;
if (this.requestHandler !== undefined) config.requestHandler = this.requestHandler;
this._stsClient = new STSClient(config);
}