@aws-sdk/config-resolver
Advanced tools
Comparing version 1.0.0-gamma.4 to 1.0.0-gamma.5
@@ -6,2 +6,19 @@ # Change Log | ||
# [1.0.0-gamma.5](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/config-resolver@1.0.0-gamma.4...@aws-sdk/config-resolver@1.0.0-gamma.5) (2020-08-04) | ||
### Bug Fixes | ||
* add region validation using DNS Host label regex ([#1402](https://github.com/aws/aws-sdk-js-v3/issues/1402)) ([88e96e6](https://github.com/aws/aws-sdk-js-v3/commit/88e96e621cbcdca3498d98526974154436bd5f58)) | ||
### Features | ||
* build command ([#1407](https://github.com/aws/aws-sdk-js-v3/issues/1407)) ([81b2e87](https://github.com/aws/aws-sdk-js-v3/commit/81b2e87067642a8cea8649cbdb2c342ca9fb6ac6)) | ||
* simplify and add extensive tests got config-resolver ([#1401](https://github.com/aws/aws-sdk-js-v3/issues/1401)) ([e03c974](https://github.com/aws/aws-sdk-js-v3/commit/e03c974c8f4d083c47b429625958a196ae16d4af)) | ||
# [1.0.0-gamma.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/config-resolver@1.0.0-gamma.3...@aws-sdk/config-resolver@1.0.0-gamma.4) (2020-07-21) | ||
@@ -8,0 +25,0 @@ |
import { Endpoint, Provider, RegionInfoProvider, UrlParser } from "@aws-sdk/types"; | ||
export declare function normalizeEndpoint(endpoint?: string | Endpoint | Provider<Endpoint>, urlParser?: UrlParser): Provider<Endpoint>; | ||
export interface EndpointsInputConfig { | ||
@@ -21,3 +20,3 @@ /** | ||
} | ||
export declare function resolveEndpointsConfig<T>(input: T & EndpointsInputConfig & PreviouslyResolved): T & EndpointsResolvedConfig; | ||
export declare const resolveEndpointsConfig: <T>(input: T & EndpointsInputConfig & PreviouslyResolved) => T & EndpointsResolvedConfig; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveEndpointsConfig = exports.normalizeEndpoint = void 0; | ||
exports.resolveEndpointsConfig = void 0; | ||
var tslib_1 = require("tslib"); | ||
function normalizeEndpoint(endpoint, urlParser) { | ||
exports.resolveEndpointsConfig = function (input) { | ||
var _a; | ||
return (tslib_1.__assign(tslib_1.__assign({}, input), { tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, endpoint: input.endpoint ? normalizeEndpoint(input) : function () { return getEndPointFromRegion(input); } })); | ||
}; | ||
var normalizeEndpoint = function (input) { | ||
var endpoint = input.endpoint, urlParser = input.urlParser; | ||
if (typeof endpoint === "string") { | ||
@@ -15,30 +20,27 @@ var promisified_1 = Promise.resolve(urlParser(endpoint)); | ||
return endpoint; | ||
} | ||
exports.normalizeEndpoint = normalizeEndpoint; | ||
function resolveEndpointsConfig(input) { | ||
var _this = this; | ||
var tls = input.tls === undefined ? true : input.tls; | ||
var endpoint = input.endpoint | ||
? normalizeEndpoint(input.endpoint, input.urlParser) | ||
: function () { | ||
return input.region().then(function (region) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var hostname, endpoint; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, input.regionInfoProvider(region)]; | ||
case 1: | ||
hostname = ((_a.sent()) || {}).hostname; | ||
if (!hostname) { | ||
throw new Error("Cannot resolve hostname from client config"); | ||
} | ||
endpoint = input.urlParser((tls ? "https:" : "http:") + "//" + hostname); | ||
return [2 /*return*/, endpoint]; | ||
} | ||
}); | ||
}); }); | ||
}; | ||
return tslib_1.__assign(tslib_1.__assign({}, input), { endpoint: endpoint, | ||
tls: tls }); | ||
} | ||
exports.resolveEndpointsConfig = resolveEndpointsConfig; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRW5kcG9pbnRzQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL0VuZHBvaW50c0NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBRUEs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wb2ludHNSZXNvbHZlZENvbmZpZyB7XG4gIGNvbnN0IHRscyA9IGlucHV0LnRscyA9PT0gdW5kZWZpbmVkID8gdHJ1ZSA6IGlucHV0LnRscztcbiAgY29uc3QgZW5kcG9pbnQ6IFByb3ZpZGVyPEVuZHBvaW50PiA9IGlucHV0LmVuZHBvaW50XG4gICAgPyBub3JtYWxpemVFbmRwb2ludChpbnB1dC5lbmRwb2ludCwgaW5wdXQudXJsUGFyc2VyKVxuICAgIDogKCkgPT5cbiAgICAgICAgaW5wdXQucmVnaW9uKCkudGhlbihhc3luYyAocmVnaW9uKSA9PiB7XG4gICAgICAgICAgY29uc3QgaG9zdG5hbWUgPSAoKGF3YWl0IGlucHV0LnJlZ2lvbkluZm9Qcm92aWRlcihyZWdpb24pKSB8fCAoe30gYXMgUmVnaW9uSW5mbykpLmhvc3RuYW1lO1xuICAgICAgICAgIGlmICghaG9zdG5hbWUpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkNhbm5vdCByZXNvbHZlIGhvc3RuYW1lIGZyb20gY2xpZW50IGNvbmZpZ1wiKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY29uc3QgZW5kcG9pbnQgPSBpbnB1dC51cmxQYXJzZXIoYCR7dGxzID8gXCJodHRwczpcIiA6IFwiaHR0cDpcIn0vLyR7aG9zdG5hbWV9YCk7XG4gICAgICAgICAgcmV0dXJuIGVuZHBvaW50O1xuICAgICAgICB9KTtcbiAgcmV0dXJuIHtcbiAgICAuLi5pbnB1dCxcbiAgICBlbmRwb2ludCxcbiAgICB0bHMsXG4gIH07XG59XG4iXX0= | ||
}; | ||
var getEndPointFromRegion = function (input) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
var _a, tls, region, dnsHostRegex, hostname; | ||
var _b; | ||
return tslib_1.__generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_a = input.tls, tls = _a === void 0 ? true : _a; | ||
return [4 /*yield*/, input.region()]; | ||
case 1: | ||
region = _c.sent(); | ||
dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); | ||
if (!dnsHostRegex.test(region)) { | ||
throw new Error("Invalid region in client config"); | ||
} | ||
return [4 /*yield*/, input.regionInfoProvider(region)]; | ||
case 2: | ||
hostname = ((_b = (_c.sent())) !== null && _b !== void 0 ? _b : {}).hostname; | ||
if (!hostname) { | ||
throw new Error("Cannot resolve hostname from client config"); | ||
} | ||
return [2 /*return*/, input.urlParser((tls ? "https:" : "http:") + "//" + hostname)]; | ||
} | ||
}); | ||
}); }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRW5kcG9pbnRzQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL0VuZHBvaW50c0NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBd0JhLFFBQUEsc0JBQXNCLEdBQUcsVUFDcEMsS0FBb0Q7O0lBQ3BCLE9BQUEsdUNBQzdCLEtBQUssS0FDUixHQUFHLFFBQUUsS0FBSyxDQUFDLEdBQUcsbUNBQUksSUFBSSxFQUN0QixRQUFRLEVBQUUsS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsaUJBQWlCLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQU0sT0FBQSxxQkFBcUIsQ0FBQyxLQUFLLENBQUMsRUFBNUIsQ0FBNEIsSUFDeEYsQ0FBQTtDQUFBLENBQUM7QUFFSCxJQUFNLGlCQUFpQixHQUFHLFVBQUMsS0FBZ0Q7SUFDakUsSUFBQSxRQUFRLEdBQWdCLEtBQUssU0FBckIsRUFBRSxTQUFTLEdBQUssS0FBSyxVQUFWLENBQVc7SUFDdEMsSUFBSSxPQUFPLFFBQVEsS0FBSyxRQUFRLEVBQUU7UUFDaEMsS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bHZlZCkgPT4ge1xuICBjb25zdCB7IHRscyA9IHRydWUgfSA9IGlucHV0O1xuICBjb25zdCByZWdpb24gPSBhd2FpdCBpbnB1dC5yZWdpb24oKTtcblxuICBjb25zdCBkbnNIb3N0UmVnZXggPSBuZXcgUmVnRXhwKC9eKFthLXpBLVowLTldfFthLXpBLVowLTldW2EtekEtWjAtOS1dezAsNjF9W2EtekEtWjAtOV0pJC8pO1xuICBpZiAoIWRuc0hvc3RSZWdleC50ZXN0KHJlZ2lvbikpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJJbnZhbGlkIHJlZ2lvbiBpbiBjbGllbnQgY29uZmlnXCIpO1xuICB9XG5cbiAgY29uc3QgeyBob3N0bmFtZSB9ID0gKGF3YWl0IGlucHV0LnJlZ2lvbkluZm9Qcm92aWRlcihyZWdpb24pKSA/PyB7fTtcbiAgaWYgKCFob3N0bmFtZSkge1xuICAgIHRocm93IG5ldyBFcnJvcihcIkNhbm5vdCByZXNvbHZlIGhvc3RuYW1lIGZyb20gY2xpZW50IGNvbmZpZ1wiKTtcbiAgfVxuXG4gIHJldHVybiBpbnB1dC51cmxQYXJzZXIoYCR7dGxzID8gXCJodHRwczpcIiA6IFwiaHR0cDpcIn0vLyR7aG9zdG5hbWV9YCk7XG59O1xuIl19 |
@@ -14,3 +14,3 @@ import { Provider } from "@aws-sdk/types"; | ||
} | ||
export declare function resolveRegionConfig<T>(input: T & RegionInputConfig & PreviouslyResolved): T & RegionResolvedConfig; | ||
export declare const resolveRegionConfig: <T>(input: T & RegionInputConfig & PreviouslyResolved) => T & RegionResolvedConfig; | ||
export {}; |
@@ -5,8 +5,7 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
function resolveRegionConfig(input) { | ||
exports.resolveRegionConfig = function (input) { | ||
var region = input.region || input.regionDefaultProvider(input); | ||
return tslib_1.__assign(tslib_1.__assign({}, input), { region: normalizeRegion(region) }); | ||
} | ||
exports.resolveRegionConfig = resolveRegionConfig; | ||
function normalizeRegion(region) { | ||
}; | ||
var normalizeRegion = function (region) { | ||
if (typeof region === "string") { | ||
@@ -17,3 +16,3 @@ var promisified_1 = Promise.resolve(region); | ||
return region; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaW9uQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL1JlZ2lvbkNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBY0EsU0FBZ0IsbUJBQW1CLENBQUksS0FBaUQ7SUFDdEYsSUFBTSxNQUFNLEdBQUcsS0FBSyxDQUFDLE1BQU0sSUFBSSxLQUFLLENBQUMscUJBQXFCLENBQUMsS0FBWSxDQUFDLENBQUM7SUFDekUsNkNBQ0ssS0FBSyxLQUNSLE1BQU0sRUFBRSxlQUFlLENBQUMsTUFBTSxDQUFDLElBQy9CO0FBQ0osQ0FBQztBQU5ELGtEQU1DO0FBRUQsU0FBUyxlQUFlLENBQUMsTUFBaUM7SUFDeEQsSUFBSSxPQUFPLE1BQU0sS0FBSyxRQUFRLEVBQUU7UUFDOUIsSUFBTSxhQUFXLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUM1QyxPQUFPLGNBQU0sT0FBQSxhQUFXLEVBQVgsQ0FBVyxDQUFDO0tBQzFCO0lBQ0QsT0FBTyxNQUEwQixDQUFDO0FBQ3BDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm92aWRlciB9IGZyb20gXCJAYXdzLXNkay90eXBlc1wiO1xuXG5leHBvcnQgaW50ZXJmYWNlIFJlZ2lvbklucHV0Q29uZmlnIHtcbiAgLyoqXG4gICAqIFRoZSBBV1MgcmVnaW9uIHRvIHdoaWNoIHRoaXMgY2xpZW50IHdpbGwgc2VuZCByZXF1ZXN0c1xuICAgKi9cbiAgcmVnaW9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UmVzb2x2ZWRDb25maWcge1xuICByZWdpb246IFByb3ZpZGVyPHN0cmluZz47XG59XG5cbmV4cG9ydCBjb25zdCByZXNvbHZlUmVnaW9uQ29uZmlnID0gPFQ+KGlucHV0OiBUICYgUmVnaW9uSW5wdXRDb25maWcgJiBQcmV2aW91c2x5UmVzb2x2ZWQpOiBUICYgUmVnaW9uUmVzb2x2ZWRDb25maWcgPT4ge1xuICBjb25zdCByZWdpb24gPSBpbnB1dC5yZWdpb24gfHwgaW5wdXQucmVnaW9uRGVmYXVsdFByb3ZpZGVyKGlucHV0IGFzIGFueSk7XG4gIHJldHVybiB7XG4gICAgLi4uaW5wdXQsXG4gICAgcmVnaW9uOiBub3JtYWxpemVSZWdpb24ocmVnaW9uKSxcbiAgfTtcbn07XG5cbmNvbnN0IG5vcm1hbGl6ZVJlZ2lvbiA9IChyZWdpb246IHN0cmluZyB8IFByb3ZpZGVyPHN0cmluZz4pOiBQcm92aWRlcjxzdHJpbmc+ID0+IHtcbiAgaWYgKHR5cGVvZiByZWdpb24gPT09IFwic3RyaW5nXCIpIHtcbiAgICBjb25zdCBwcm9taXNpZmllZCA9IFByb21pc2UucmVzb2x2ZShyZWdpb24pO1xuICAgIHJldHVybiAoKSA9PiBwcm9taXNpZmllZDtcbiAgfVxuICByZXR1cm4gcmVnaW9uIGFzIFByb3ZpZGVyPHN0cmluZz47XG59O1xuIl19 |
{ | ||
"name": "@aws-sdk/config-resolver", | ||
"version": "1.0.0-gamma.4", | ||
"version": "1.0.0-gamma.5", | ||
"scripts": { | ||
@@ -9,2 +9,3 @@ "prepublishOnly": "yarn build:cjs && yarn build:es", | ||
"build:es": "tsc -p tsconfig.es.json", | ||
"build": "yarn build:es && yarn build:cjs", | ||
"test": "jest" | ||
@@ -27,6 +28,6 @@ }, | ||
"dependencies": { | ||
"@aws-sdk/signature-v4": "1.0.0-gamma.4", | ||
"@aws-sdk/types": "1.0.0-gamma.3", | ||
"@aws-sdk/signature-v4": "1.0.0-gamma.5", | ||
"@aws-sdk/types": "1.0.0-gamma.4", | ||
"tslib": "^1.8.0" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
85832
19
235
1
+ Added@aws-sdk/is-array-buffer@1.0.0-gamma.5(transitive)
+ Added@aws-sdk/signature-v4@1.0.0-gamma.5(transitive)
+ Added@aws-sdk/types@1.0.0-gamma.4(transitive)
+ Added@aws-sdk/util-hex-encoding@1.0.0-gamma.5(transitive)
+ Added@aws-sdk/util-uri-escape@1.0.0-gamma.5(transitive)
- Removed@aws-sdk/is-array-buffer@1.0.0-gamma.4(transitive)
- Removed@aws-sdk/signature-v4@1.0.0-gamma.4(transitive)
- Removed@aws-sdk/types@1.0.0-gamma.3(transitive)
- Removed@aws-sdk/util-hex-encoding@1.0.0-gamma.4(transitive)
- Removed@aws-sdk/util-uri-escape@1.0.0-gamma.4(transitive)
Updated@aws-sdk/types@1.0.0-gamma.4