|
1 | 1 | import { memoize } from "@aws-sdk/property-provider";
|
2 | 2 | import { SignatureV4, SignatureV4CryptoInit, SignatureV4Init } from "@aws-sdk/signature-v4";
|
3 | 3 | import { Credentials, HashConstructor, Provider, RegionInfo, RegionInfoProvider, RequestSigner } from "@aws-sdk/types";
|
| 4 | +import { options } from "yargs"; |
4 | 5 |
|
5 | 6 | // 5 minutes buffer time the refresh the credential before it really expires
|
6 | 7 | const CREDENTIAL_EXPIRE_WINDOW = 300000;
|
@@ -73,6 +74,8 @@ interface PreviouslyResolved {
|
73 | 74 | signingName?: string;
|
74 | 75 | serviceId: string;
|
75 | 76 | sha256: HashConstructor;
|
| 77 | + useFipsEndpoint: Provider<boolean>; |
| 78 | + useDualstackEndpoint: Provider<boolean>; |
76 | 79 | }
|
77 | 80 |
|
78 | 81 | interface SigV4PreviouslyResolved {
|
@@ -118,7 +121,16 @@ export const resolveAwsAuthConfig = <T>(
|
118 | 121 | //construct a provider inferring signing from region.
|
119 | 122 | signer = () =>
|
120 | 123 | normalizeProvider(input.region)()
|
121 |
| - .then(async (region) => [(await input.regionInfoProvider(region)) || {}, region] as [RegionInfo, string]) |
| 124 | + .then( |
| 125 | + async (region) => |
| 126 | + [ |
| 127 | + (await input.regionInfoProvider(region, { |
| 128 | + useFipsEndpoint: await input.useFipsEndpoint(), |
| 129 | + useDualstackEndpoint: await input.useDualstackEndpoint(), |
| 130 | + })) || {}, |
| 131 | + region, |
| 132 | + ] as [RegionInfo, string] |
| 133 | + ) |
122 | 134 | .then(([regionInfo, region]) => {
|
123 | 135 | const { signingRegion, signingService } = regionInfo;
|
124 | 136 | //update client's singing region and signing service config if they are resolved.
|
|
0 commit comments