@aws-sdk/rds-signer 3.183.0 → 3.186.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.
- package/CHANGELOG.md +16 -0
- package/dist-es/Signer.js +41 -28
- package/dist-es/runtimeConfig.browser.js +4 -8
- package/dist-es/runtimeConfig.js +4 -8
- package/dist-es/runtimeConfig.native.js +4 -8
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/rds-signer
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.185.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.184.0...v3.185.0) (2022-10-05)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/rds-signer
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @aws-sdk/rds-signer
|
package/dist-es/Signer.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { SignatureV4 } from "@aws-sdk/signature-v4";
|
|
3
4
|
import { formatUrl } from "@aws-sdk/util-format-url";
|
|
4
5
|
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
var Signer = (function () {
|
|
7
|
+
function Signer(configuration) {
|
|
7
8
|
this.protocol = "https:";
|
|
8
9
|
this.service = "rds-db";
|
|
9
|
-
|
|
10
|
+
var runtimeConfiguration = __getRuntimeConfig(configuration);
|
|
10
11
|
this.credentials = runtimeConfiguration.credentials;
|
|
11
12
|
this.hostname = runtimeConfiguration.hostname;
|
|
12
13
|
this.port = runtimeConfiguration.port;
|
|
@@ -14,29 +15,41 @@ export class Signer {
|
|
|
14
15
|
this.sha256 = runtimeConfiguration.sha256;
|
|
15
16
|
this.username = runtimeConfiguration.username;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
Signer.prototype.getAuthToken = function () {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20
|
+
var signer, request, presigned;
|
|
21
|
+
return __generator(this, function (_a) {
|
|
22
|
+
switch (_a.label) {
|
|
23
|
+
case 0:
|
|
24
|
+
signer = new SignatureV4({
|
|
25
|
+
service: this.service,
|
|
26
|
+
region: this.region,
|
|
27
|
+
credentials: this.credentials,
|
|
28
|
+
sha256: this.sha256,
|
|
29
|
+
});
|
|
30
|
+
request = new HttpRequest({
|
|
31
|
+
method: "GET",
|
|
32
|
+
protocol: this.protocol,
|
|
33
|
+
hostname: this.hostname,
|
|
34
|
+
port: this.port,
|
|
35
|
+
query: {
|
|
36
|
+
Action: "connect",
|
|
37
|
+
DBUser: this.username,
|
|
38
|
+
},
|
|
39
|
+
headers: {
|
|
40
|
+
host: "".concat(this.hostname, ":").concat(this.port),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return [4, signer.presign(request, {
|
|
44
|
+
expiresIn: 900,
|
|
45
|
+
})];
|
|
46
|
+
case 1:
|
|
47
|
+
presigned = _a.sent();
|
|
48
|
+
return [2, formatUrl(presigned).replace("".concat(this.protocol, "//"), "")];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
23
51
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
port: this.port,
|
|
29
|
-
query: {
|
|
30
|
-
Action: "connect",
|
|
31
|
-
DBUser: this.username,
|
|
32
|
-
},
|
|
33
|
-
headers: {
|
|
34
|
-
host: `${this.hostname}:${this.port}`,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
const presigned = await signer.presign(request, {
|
|
38
|
-
expiresIn: 900,
|
|
39
|
-
});
|
|
40
|
-
return formatUrl(presigned).replace(`${this.protocol}//`, "");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
52
|
+
};
|
|
53
|
+
return Signer;
|
|
54
|
+
}());
|
|
55
|
+
export { Signer };
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
2
3
|
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
sha256: config?.sha256 ?? Sha256,
|
|
7
|
-
credentials: invalidProvider("Credential is missing"),
|
|
8
|
-
region: invalidProvider("Region is missing"),
|
|
9
|
-
...config,
|
|
10
|
-
};
|
|
4
|
+
export var getRuntimeConfig = function (config) {
|
|
5
|
+
var _a;
|
|
6
|
+
return __assign({ runtime: "browser", sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : Sha256, credentials: invalidProvider("Credential is missing"), region: invalidProvider("Region is missing") }, config);
|
|
11
7
|
};
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
|
|
2
3
|
import { fromNodeProviderChain } from "@aws-sdk/credential-providers";
|
|
3
4
|
import { Hash } from "@aws-sdk/hash-node";
|
|
4
5
|
import { loadConfig } from "@aws-sdk/node-config-provider";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
9
|
-
credentials: config?.credentials ?? fromNodeProviderChain(),
|
|
10
|
-
region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
11
|
-
...config,
|
|
12
|
-
};
|
|
6
|
+
export var getRuntimeConfig = function (config) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
return __assign({ runtime: "node", sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : Hash.bind(null, "sha256"), credentials: (_b = config === null || config === void 0 ? void 0 : config.credentials) !== null && _b !== void 0 ? _b : fromNodeProviderChain(), region: (_c = config === null || config === void 0 ? void 0 : config.region) !== null && _c !== void 0 ? _c : loadConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS) }, config);
|
|
13
9
|
};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
3
|
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
sha256: config?.sha256 ?? Sha256,
|
|
7
|
-
credentials: invalidProvider("Credential is missing"),
|
|
8
|
-
region: invalidProvider("Region is missing"),
|
|
9
|
-
...config,
|
|
10
|
-
};
|
|
4
|
+
export var getRuntimeConfig = function (config) {
|
|
5
|
+
var _a;
|
|
6
|
+
return __assign({ runtime: "react-native", sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : Sha256, credentials: invalidProvider("Credential is missing"), region: invalidProvider("Region is missing") }, config);
|
|
11
7
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/rds-signer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.186.0",
|
|
4
4
|
"description": "RDS utility for generating a password that can be used for IAM authentication to an RDS DB.",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@aws-crypto/sha256-browser": "2.0.0",
|
|
28
28
|
"@aws-crypto/sha256-js": "2.0.0",
|
|
29
|
-
"@aws-sdk/config-resolver": "3.
|
|
30
|
-
"@aws-sdk/credential-providers": "3.
|
|
31
|
-
"@aws-sdk/hash-node": "3.
|
|
32
|
-
"@aws-sdk/invalid-dependency": "3.
|
|
33
|
-
"@aws-sdk/node-config-provider": "3.
|
|
34
|
-
"@aws-sdk/protocol-http": "3.
|
|
35
|
-
"@aws-sdk/signature-v4": "3.
|
|
36
|
-
"@aws-sdk/util-format-url": "3.
|
|
29
|
+
"@aws-sdk/config-resolver": "3.186.0",
|
|
30
|
+
"@aws-sdk/credential-providers": "3.186.0",
|
|
31
|
+
"@aws-sdk/hash-node": "3.186.0",
|
|
32
|
+
"@aws-sdk/invalid-dependency": "3.186.0",
|
|
33
|
+
"@aws-sdk/node-config-provider": "3.186.0",
|
|
34
|
+
"@aws-sdk/protocol-http": "3.186.0",
|
|
35
|
+
"@aws-sdk/signature-v4": "3.186.0",
|
|
36
|
+
"@aws-sdk/util-format-url": "3.186.0",
|
|
37
37
|
"tslib": "^2.3.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@aws-sdk/types": "3.
|
|
40
|
+
"@aws-sdk/types": "3.186.0",
|
|
41
41
|
"@types/node": "^10.0.0",
|
|
42
42
|
"concurrently": "7.0.0",
|
|
43
43
|
"downlevel-dts": "0.10.1",
|