@aws-sdk/rds-signer 3.490.0 → 3.495.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.
@@ -1,46 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Signer = void 0;
4
- const util_format_url_1 = require("@aws-sdk/util-format-url");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const signature_v4_1 = require("@smithy/signature-v4");
7
- const runtimeConfig_1 = require("./runtimeConfig");
8
- class Signer {
9
- constructor(configuration) {
10
- this.protocol = "https:";
11
- this.service = "rds-db";
12
- const runtimeConfiguration = (0, runtimeConfig_1.getRuntimeConfig)(configuration);
13
- this.credentials = runtimeConfiguration.credentials;
14
- this.hostname = runtimeConfiguration.hostname;
15
- this.port = runtimeConfiguration.port;
16
- this.region = runtimeConfiguration.region;
17
- this.sha256 = runtimeConfiguration.sha256;
18
- this.username = runtimeConfiguration.username;
19
- }
20
- async getAuthToken() {
21
- const signer = new signature_v4_1.SignatureV4({
22
- service: this.service,
23
- region: this.region,
24
- credentials: this.credentials,
25
- sha256: this.sha256,
26
- });
27
- const request = new protocol_http_1.HttpRequest({
28
- method: "GET",
29
- protocol: this.protocol,
30
- hostname: this.hostname,
31
- port: this.port,
32
- query: {
33
- Action: "connect",
34
- DBUser: this.username,
35
- },
36
- headers: {
37
- host: `${this.hostname}:${this.port}`,
38
- },
39
- });
40
- const presigned = await signer.presign(request, {
41
- expiresIn: 900,
42
- });
43
- return (0, util_format_url_1.formatUrl)(presigned).replace(`${this.protocol}//`, "");
44
- }
45
- }
46
- exports.Signer = Signer;
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,4 +1,75 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./Signer"), exports);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ Signer: () => Signer
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // src/Signer.ts
28
+ var import_util_format_url = require("@aws-sdk/util-format-url");
29
+ var import_protocol_http = require("@smithy/protocol-http");
30
+ var import_signature_v4 = require("@smithy/signature-v4");
31
+ var import_runtimeConfig = require("././runtimeConfig");
32
+ var _Signer = class _Signer {
33
+ constructor(configuration) {
34
+ this.protocol = "https:";
35
+ this.service = "rds-db";
36
+ const runtimeConfiguration = (0, import_runtimeConfig.getRuntimeConfig)(configuration);
37
+ this.credentials = runtimeConfiguration.credentials;
38
+ this.hostname = runtimeConfiguration.hostname;
39
+ this.port = runtimeConfiguration.port;
40
+ this.region = runtimeConfiguration.region;
41
+ this.sha256 = runtimeConfiguration.sha256;
42
+ this.username = runtimeConfiguration.username;
43
+ }
44
+ async getAuthToken() {
45
+ const signer = new import_signature_v4.SignatureV4({
46
+ service: this.service,
47
+ region: this.region,
48
+ credentials: this.credentials,
49
+ sha256: this.sha256
50
+ });
51
+ const request = new import_protocol_http.HttpRequest({
52
+ method: "GET",
53
+ protocol: this.protocol,
54
+ hostname: this.hostname,
55
+ port: this.port,
56
+ query: {
57
+ Action: "connect",
58
+ DBUser: this.username
59
+ },
60
+ headers: {
61
+ host: `${this.hostname}:${this.port}`
62
+ }
63
+ });
64
+ const presigned = await signer.presign(request, {
65
+ expiresIn: 900
66
+ });
67
+ return (0, import_util_format_url.formatUrl)(presigned).replace(`${this.protocol}//`, "");
68
+ }
69
+ };
70
+ __name(_Signer, "Signer");
71
+ var Signer = _Signer;
72
+ // Annotate the CommonJS export names for ESM import in node:
73
+ 0 && (module.exports = {
74
+ Signer
75
+ });
@@ -1,16 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntimeConfig = void 0;
4
- const sha256_browser_1 = require("@aws-crypto/sha256-browser");
5
- const invalid_dependency_1 = require("@smithy/invalid-dependency");
6
- const getRuntimeConfig = (config) => {
7
- var _a;
8
- return {
9
- runtime: "browser",
10
- sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : sha256_browser_1.Sha256,
11
- credentials: (0, invalid_dependency_1.invalidProvider)("Credential is missing"),
12
- region: (0, invalid_dependency_1.invalidProvider)("Region is missing"),
13
- ...config,
14
- };
15
- };
16
- exports.getRuntimeConfig = getRuntimeConfig;
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@aws-sdk/rds-signer",
3
- "version": "3.490.0",
3
+ "version": "3.495.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",
7
7
  "types": "./dist-types/index.d.ts",
8
8
  "scripts": {
9
9
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
10
- "build:cjs": "tsc -p tsconfig.cjs.json",
10
+ "build:cjs": "node ../../scripts/compilation/inline rds-signer",
11
11
  "build:es": "tsc -p tsconfig.es.json",
12
12
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
13
13
  "build:types": "tsc -p tsconfig.types.json",
@@ -27,19 +27,19 @@
27
27
  "dependencies": {
28
28
  "@aws-crypto/sha256-browser": "3.0.0",
29
29
  "@aws-crypto/sha256-js": "3.0.0",
30
- "@aws-sdk/credential-providers": "3.490.0",
31
- "@aws-sdk/util-format-url": "3.489.0",
32
- "@smithy/config-resolver": "^2.0.23",
33
- "@smithy/hash-node": "^2.0.18",
34
- "@smithy/invalid-dependency": "^2.0.16",
35
- "@smithy/node-config-provider": "^2.1.9",
36
- "@smithy/protocol-http": "^3.0.12",
37
- "@smithy/signature-v4": "^2.0.0",
38
- "@smithy/types": "^2.8.0",
30
+ "@aws-sdk/credential-providers": "3.495.0",
31
+ "@aws-sdk/util-format-url": "3.495.0",
32
+ "@smithy/config-resolver": "^2.1.0",
33
+ "@smithy/hash-node": "^2.1.0",
34
+ "@smithy/invalid-dependency": "^2.1.0",
35
+ "@smithy/node-config-provider": "^2.2.0",
36
+ "@smithy/protocol-http": "^3.1.0",
37
+ "@smithy/signature-v4": "^2.1.0",
38
+ "@smithy/types": "^2.9.0",
39
39
  "tslib": "^2.5.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@aws-sdk/types": "3.489.0",
42
+ "@aws-sdk/types": "3.495.0",
43
43
  "@types/node": "^14.14.31",
44
44
  "concurrently": "7.0.0",
45
45
  "downlevel-dts": "0.10.1",