@aws-sdk/dsql-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 +52 -84
  2. package/package.json +10 -10
package/dist-cjs/index.js CHANGED
@@ -1,87 +1,55 @@
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
- DsqlSigner: () => DsqlSigner
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 DsqlSigner = class {
34
- static {
35
- __name(this, "DsqlSigner");
36
- }
37
- credentials;
38
- hostname;
39
- protocol = "https:";
40
- region;
41
- service = "dsql";
42
- sha256;
43
- expiresIn;
44
- constructor(configuration) {
45
- const runtimeConfiguration = (0, import_runtimeConfig.getRuntimeConfig)(configuration);
46
- this.credentials = runtimeConfiguration.credentials;
47
- this.hostname = runtimeConfiguration.hostname;
48
- this.region = runtimeConfiguration.region;
49
- this.sha256 = runtimeConfiguration.sha256;
50
- this.expiresIn = runtimeConfiguration.expiresIn ?? 900;
51
- }
52
- async _getAuthToken(action) {
53
- const signer = new import_signature_v4.SignatureV4({
54
- service: this.service,
55
- region: this.region,
56
- credentials: this.credentials,
57
- sha256: this.sha256
58
- });
59
- const request = new import_protocol_http.HttpRequest({
60
- method: "GET",
61
- protocol: this.protocol,
62
- hostname: this.hostname,
63
- query: {
64
- Action: action
65
- },
66
- headers: {
67
- host: `${this.hostname}`
68
- }
69
- });
70
- const presigned = await signer.presign(request, {
71
- expiresIn: this.expiresIn
72
- });
73
- return (0, import_util_format_url.formatUrl)(presigned).replace(`${this.protocol}//`, "");
74
- }
75
- async getDbConnectAuthToken() {
76
- return this._getAuthToken("DbConnect");
77
- }
78
- async getDbConnectAdminAuthToken() {
79
- return this._getAuthToken("DbConnectAdmin");
80
- }
81
- };
82
- // Annotate the CommonJS export names for ESM import in node:
83
-
84
- 0 && (module.exports = {
85
- DsqlSigner
86
- });
8
+ class DsqlSigner {
9
+ credentials;
10
+ hostname;
11
+ protocol = "https:";
12
+ region;
13
+ service = "dsql";
14
+ sha256;
15
+ expiresIn;
16
+ constructor(configuration) {
17
+ const runtimeConfiguration = runtimeConfig.getRuntimeConfig(configuration);
18
+ this.credentials = runtimeConfiguration.credentials;
19
+ this.hostname = runtimeConfiguration.hostname;
20
+ this.region = runtimeConfiguration.region;
21
+ this.sha256 = runtimeConfiguration.sha256;
22
+ this.expiresIn = runtimeConfiguration.expiresIn ?? 900;
23
+ }
24
+ async _getAuthToken(action) {
25
+ const signer = new signatureV4.SignatureV4({
26
+ service: this.service,
27
+ region: this.region,
28
+ credentials: this.credentials,
29
+ sha256: this.sha256,
30
+ });
31
+ const request = new protocolHttp.HttpRequest({
32
+ method: "GET",
33
+ protocol: this.protocol,
34
+ hostname: this.hostname,
35
+ query: {
36
+ Action: action,
37
+ },
38
+ headers: {
39
+ host: `${this.hostname}`,
40
+ },
41
+ });
42
+ const presigned = await signer.presign(request, {
43
+ expiresIn: this.expiresIn,
44
+ });
45
+ return utilFormatUrl.formatUrl(presigned).replace(`${this.protocol}//`, "");
46
+ }
47
+ async getDbConnectAuthToken() {
48
+ return this._getAuthToken("DbConnect");
49
+ }
50
+ async getDbConnectAdminAuthToken() {
51
+ return this._getAuthToken("DbConnectAdmin");
52
+ }
53
+ }
87
54
 
55
+ exports.DsqlSigner = DsqlSigner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/dsql-signer",
3
- "version": "3.899.0",
3
+ "version": "3.906.0",
4
4
  "description": "Dsql utility for generating a password token that can be used for IAM authentication to a Dsql Database.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -31,15 +31,15 @@
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": {