@aws-sdk/credential-provider-http
Advanced tools
Comparing version 3.502.0 to 3.503.1
@@ -17,3 +17,3 @@ "use strict"; | ||
const fromHttp = (options) => { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
(_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug("@aws-sdk/credential-provider-http", "fromHttp"); | ||
@@ -40,7 +40,11 @@ let host; | ||
else { | ||
throw new property_provider_1.CredentialsProviderError("No HTTP credential provider host provided."); | ||
throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. | ||
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`); | ||
} | ||
const url = new URL(host); | ||
(0, checkUrl_1.checkUrl)(url); | ||
const requestHandler = new node_http_handler_1.NodeHttpHandler(); | ||
const requestHandler = new node_http_handler_1.NodeHttpHandler({ | ||
requestTimeout: (_f = options.timeout) !== null && _f !== void 0 ? _f : 1000, | ||
connectionTimeout: (_g = options.timeout) !== null && _g !== void 0 ? _g : 1000, | ||
}); | ||
return (0, retry_wrapper_1.retryWrapper)(async () => { | ||
@@ -54,6 +58,11 @@ const request = (0, requestHelpers_1.createGetRequest)(url); | ||
} | ||
const result = await requestHandler.handle(request); | ||
return (0, requestHelpers_1.getCredentials)(result.response); | ||
}, (_f = options.maxRetries) !== null && _f !== void 0 ? _f : 3, (_g = options.timeout) !== null && _g !== void 0 ? _g : 1000); | ||
try { | ||
const result = await requestHandler.handle(request); | ||
return (0, requestHelpers_1.getCredentials)(result.response); | ||
} | ||
catch (e) { | ||
throw new property_provider_1.CredentialsProviderError(String(e)); | ||
} | ||
}, (_h = options.maxRetries) !== null && _h !== void 0 ? _h : 3, (_j = options.timeout) !== null && _j !== void 0 ? _j : 1000); | ||
}; | ||
exports.fromHttp = fromHttp; |
@@ -34,7 +34,11 @@ import { NodeHttpHandler } from "@smithy/node-http-handler"; | ||
else { | ||
throw new CredentialsProviderError("No HTTP credential provider host provided."); | ||
throw new CredentialsProviderError(`No HTTP credential provider host provided. | ||
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`); | ||
} | ||
const url = new URL(host); | ||
checkUrl(url); | ||
const requestHandler = new NodeHttpHandler(); | ||
const requestHandler = new NodeHttpHandler({ | ||
requestTimeout: options.timeout ?? 1000, | ||
connectionTimeout: options.timeout ?? 1000, | ||
}); | ||
return retryWrapper(async () => { | ||
@@ -48,5 +52,10 @@ const request = createGetRequest(url); | ||
} | ||
const result = await requestHandler.handle(request); | ||
return getCredentials(result.response); | ||
try { | ||
const result = await requestHandler.handle(request); | ||
return getCredentials(result.response); | ||
} | ||
catch (e) { | ||
throw new CredentialsProviderError(String(e)); | ||
} | ||
}, options.maxRetries ?? 3, options.timeout ?? 1000); | ||
}; |
{ | ||
"name": "@aws-sdk/credential-provider-http", | ||
"version": "3.502.0", | ||
"version": "3.503.1", | ||
"description": "AWS credential provider for containers and HTTP sources", | ||
@@ -5,0 +5,0 @@ "main": "./dist-cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27082
595