@aws-sdk/rds-signer 3.899.0 → 3.906.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +50 -82
  2. package/package.json +11 -11
package/dist-cjs/index.js CHANGED
@@ -1,85 +1,53 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
20
2
 
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- Signer: () => Signer
25
- });
26
- module.exports = __toCommonJS(index_exports);
3
+ var utilFormatUrl = require('@aws-sdk/util-format-url');
4
+ var protocolHttp = require('@smithy/protocol-http');
5
+ var signatureV4 = require('@smithy/signature-v4');
6
+ var runtimeConfig = require('./runtimeConfig');
27
7
 
28
- // src/Signer.ts
29
- var import_util_format_url = require("@aws-sdk/util-format-url");
30
- var import_protocol_http = require("@smithy/protocol-http");
31
- var import_signature_v4 = require("@smithy/signature-v4");
32
- var import_runtimeConfig = require("././runtimeConfig");
33
- var Signer = class {
34
- static {
35
- __name(this, "Signer");
36
- }
37
- credentials;
38
- hostname;
39
- port;
40
- protocol = "https:";
41
- region;
42
- service = "rds-db";
43
- sha256;
44
- username;
45
- constructor(configuration) {
46
- const runtimeConfiguration = (0, import_runtimeConfig.getRuntimeConfig)(configuration);
47
- this.credentials = runtimeConfiguration.credentials;
48
- this.hostname = runtimeConfiguration.hostname;
49
- this.port = runtimeConfiguration.port;
50
- this.region = runtimeConfiguration.region;
51
- this.sha256 = runtimeConfiguration.sha256;
52
- this.username = runtimeConfiguration.username;
53
- }
54
- async getAuthToken() {
55
- const signer = new import_signature_v4.SignatureV4({
56
- service: this.service,
57
- region: this.region,
58
- credentials: this.credentials,
59
- sha256: this.sha256
60
- });
61
- const request = new import_protocol_http.HttpRequest({
62
- method: "GET",
63
- protocol: this.protocol,
64
- hostname: this.hostname,
65
- port: this.port,
66
- query: {
67
- Action: "connect",
68
- DBUser: this.username
69
- },
70
- headers: {
71
- host: `${this.hostname}:${this.port}`
72
- }
73
- });
74
- const presigned = await signer.presign(request, {
75
- expiresIn: 900
76
- });
77
- return (0, import_util_format_url.formatUrl)(presigned).replace(`${this.protocol}//`, "");
78
- }
79
- };
80
- // Annotate the CommonJS export names for ESM import in node:
81
-
82
- 0 && (module.exports = {
83
- Signer
84
- });
8
+ class Signer {
9
+ credentials;
10
+ hostname;
11
+ port;
12
+ protocol = "https:";
13
+ region;
14
+ service = "rds-db";
15
+ sha256;
16
+ username;
17
+ constructor(configuration) {
18
+ const runtimeConfiguration = runtimeConfig.getRuntimeConfig(configuration);
19
+ this.credentials = runtimeConfiguration.credentials;
20
+ this.hostname = runtimeConfiguration.hostname;
21
+ this.port = runtimeConfiguration.port;
22
+ this.region = runtimeConfiguration.region;
23
+ this.sha256 = runtimeConfiguration.sha256;
24
+ this.username = runtimeConfiguration.username;
25
+ }
26
+ async getAuthToken() {
27
+ const signer = new signatureV4.SignatureV4({
28
+ service: this.service,
29
+ region: this.region,
30
+ credentials: this.credentials,
31
+ sha256: this.sha256,
32
+ });
33
+ const request = new protocolHttp.HttpRequest({
34
+ method: "GET",
35
+ protocol: this.protocol,
36
+ hostname: this.hostname,
37
+ port: this.port,
38
+ query: {
39
+ Action: "connect",
40
+ DBUser: this.username,
41
+ },
42
+ headers: {
43
+ host: `${this.hostname}:${this.port}`,
44
+ },
45
+ });
46
+ const presigned = await signer.presign(request, {
47
+ expiresIn: 900,
48
+ });
49
+ return utilFormatUrl.formatUrl(presigned).replace(`${this.protocol}//`, "");
50
+ }
51
+ }
85
52
 
53
+ exports.Signer = Signer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/rds-signer",
3
- "version": "3.899.0",
3
+ "version": "3.906.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",
@@ -31,19 +31,19 @@
31
31
  "dependencies": {
32
32
  "@aws-crypto/sha256-browser": "5.2.0",
33
33
  "@aws-crypto/sha256-js": "5.2.0",
34
- "@aws-sdk/credential-providers": "3.899.0",
35
- "@aws-sdk/util-format-url": "3.893.0",
36
- "@smithy/config-resolver": "^4.2.2",
37
- "@smithy/hash-node": "^4.1.1",
38
- "@smithy/invalid-dependency": "^4.1.1",
39
- "@smithy/node-config-provider": "^4.2.2",
40
- "@smithy/protocol-http": "^5.2.1",
41
- "@smithy/signature-v4": "^5.2.1",
42
- "@smithy/types": "^4.5.0",
34
+ "@aws-sdk/credential-providers": "3.906.0",
35
+ "@aws-sdk/util-format-url": "3.901.0",
36
+ "@smithy/config-resolver": "^4.3.0",
37
+ "@smithy/hash-node": "^4.2.0",
38
+ "@smithy/invalid-dependency": "^4.2.0",
39
+ "@smithy/node-config-provider": "^4.3.0",
40
+ "@smithy/protocol-http": "^5.3.0",
41
+ "@smithy/signature-v4": "^5.3.0",
42
+ "@smithy/types": "^4.6.0",
43
43
  "tslib": "^2.6.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@aws-sdk/types": "3.893.0",
46
+ "@aws-sdk/types": "3.901.0",
47
47
  "@types/node": "^18.19.69",
48
48
  "concurrently": "7.0.0",
49
49
  "downlevel-dts": "0.10.1",