@aws-sdk/credential-provider-http 3.568.0 → 3.575.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,8 +7,7 @@ const checkUrl_1 = require("./checkUrl");
|
|
|
7
7
|
const requestHelpers_1 = require("./requestHelpers");
|
|
8
8
|
const retry_wrapper_1 = require("./retry-wrapper");
|
|
9
9
|
const fromHttp = (options) => {
|
|
10
|
-
|
|
11
|
-
(_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug("@aws-sdk/credential-provider-http", "fromHttp");
|
|
10
|
+
options.logger?.debug("@aws-sdk/credential-provider-http", "fromHttp");
|
|
12
11
|
let host;
|
|
13
12
|
const full = options.credentialsFullUri;
|
|
14
13
|
if (full) {
|
|
@@ -27,6 +26,6 @@ const fromHttp = (options) => {
|
|
|
27
26
|
}
|
|
28
27
|
const result = await requestHandler.handle(request);
|
|
29
28
|
return (0, requestHelpers_1.getCredentials)(result.response);
|
|
30
|
-
},
|
|
29
|
+
}, options.maxRetries ?? 3, options.timeout ?? 1000);
|
|
31
30
|
};
|
|
32
31
|
exports.fromHttp = fromHttp;
|
|
@@ -14,13 +14,12 @@ const AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
|
|
|
14
14
|
const AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
|
|
15
15
|
const AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
|
|
16
16
|
const fromHttp = (options) => {
|
|
17
|
-
|
|
18
|
-
(_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug("@aws-sdk/credential-provider-http", "fromHttp");
|
|
17
|
+
options.logger?.debug("@aws-sdk/credential-provider-http", "fromHttp");
|
|
19
18
|
let host;
|
|
20
|
-
const relative =
|
|
21
|
-
const full =
|
|
22
|
-
const token =
|
|
23
|
-
const tokenFile =
|
|
19
|
+
const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
|
|
20
|
+
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
|
|
21
|
+
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
|
|
22
|
+
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
|
|
24
23
|
if (relative && full) {
|
|
25
24
|
console.warn("AWS SDK HTTP credentials provider:", "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
26
25
|
console.warn("awsContainerCredentialsFullUri will take precedence.");
|
|
@@ -42,8 +41,8 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
42
41
|
const url = new URL(host);
|
|
43
42
|
(0, checkUrl_1.checkUrl)(url);
|
|
44
43
|
const requestHandler = new node_http_handler_1.NodeHttpHandler({
|
|
45
|
-
requestTimeout:
|
|
46
|
-
connectionTimeout:
|
|
44
|
+
requestTimeout: options.timeout ?? 1000,
|
|
45
|
+
connectionTimeout: options.timeout ?? 1000,
|
|
47
46
|
});
|
|
48
47
|
return (0, retry_wrapper_1.retryWrapper)(async () => {
|
|
49
48
|
const request = (0, requestHelpers_1.createGetRequest)(url);
|
|
@@ -60,6 +59,6 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
60
59
|
catch (e) {
|
|
61
60
|
throw new property_provider_1.CredentialsProviderError(String(e));
|
|
62
61
|
}
|
|
63
|
-
},
|
|
62
|
+
}, options.maxRetries ?? 3, options.timeout ?? 1000);
|
|
64
63
|
};
|
|
65
64
|
exports.fromHttp = fromHttp;
|
|
@@ -20,8 +20,7 @@ function createGetRequest(url) {
|
|
|
20
20
|
}
|
|
21
21
|
exports.createGetRequest = createGetRequest;
|
|
22
22
|
async function getCredentials(response) {
|
|
23
|
-
|
|
24
|
-
const contentType = (_b = (_a = response === null || response === void 0 ? void 0 : response.headers["content-type"]) !== null && _a !== void 0 ? _a : response === null || response === void 0 ? void 0 : response.headers["Content-Type"]) !== null && _b !== void 0 ? _b : "";
|
|
23
|
+
const contentType = response?.headers["content-type"] ?? response?.headers["Content-Type"] ?? "";
|
|
25
24
|
if (!contentType.includes("json")) {
|
|
26
25
|
console.warn("HTTP credential provider response header content-type was not application/json. Observed: " + contentType + ".");
|
|
27
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-http",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.575.0",
|
|
4
4
|
"description": "AWS credential provider for containers and HTTP sources",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aws-sdk/types": "3.
|
|
30
|
-
"@smithy/fetch-http-handler": "^
|
|
31
|
-
"@smithy/node-http-handler": "^
|
|
32
|
-
"@smithy/property-provider": "^
|
|
33
|
-
"@smithy/protocol-http": "^
|
|
34
|
-
"@smithy/smithy-client": "^
|
|
35
|
-
"@smithy/types": "^
|
|
36
|
-
"@smithy/util-stream": "^
|
|
29
|
+
"@aws-sdk/types": "3.575.0",
|
|
30
|
+
"@smithy/fetch-http-handler": "^3.0.0",
|
|
31
|
+
"@smithy/node-http-handler": "^3.0.0",
|
|
32
|
+
"@smithy/property-provider": "^3.0.0",
|
|
33
|
+
"@smithy/protocol-http": "^4.0.0",
|
|
34
|
+
"@smithy/smithy-client": "^3.0.0",
|
|
35
|
+
"@smithy/types": "^3.0.0",
|
|
36
|
+
"@smithy/util-stream": "^3.0.0",
|
|
37
37
|
"tslib": "^2.6.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|