@aws-sdk/rds-signer 3.1068.0 → 3.1069.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/dist-cjs/index.js CHANGED
@@ -1,9 +1,7 @@
1
- 'use strict';
2
-
3
- var util = require('@aws-sdk/core/util');
4
- var protocols = require('@smithy/core/protocols');
5
- var signatureV4 = require('@smithy/signature-v4');
6
- var runtimeConfig = require('./runtimeConfig');
1
+ const { formatUrl } = require("@aws-sdk/core/util");
2
+ const { HttpRequest } = require("@smithy/core/protocols");
3
+ const { SignatureV4 } = require("@smithy/signature-v4");
4
+ const { getRuntimeConfig } = require("./runtimeConfig");
7
5
 
8
6
  const MINUTE_MS = 60_000;
9
7
  class Signer {
@@ -16,7 +14,7 @@ class Signer {
16
14
  sha256;
17
15
  username;
18
16
  constructor(configuration) {
19
- const runtimeConfiguration = runtimeConfig.getRuntimeConfig(configuration);
17
+ const runtimeConfiguration = getRuntimeConfig(configuration);
20
18
  const creds = runtimeConfiguration.credentials;
21
19
  this.credentials = typeof creds === "function" ? this.createCredentialsWrapper(creds) : creds;
22
20
  this.hostname = runtimeConfiguration.hostname;
@@ -26,13 +24,13 @@ class Signer {
26
24
  this.username = runtimeConfiguration.username;
27
25
  }
28
26
  async getAuthToken() {
29
- const signer = new signatureV4.SignatureV4({
27
+ const signer = new SignatureV4({
30
28
  service: this.service,
31
29
  region: this.region,
32
30
  credentials: this.credentials,
33
31
  sha256: this.sha256,
34
32
  });
35
- const request = new protocols.HttpRequest({
33
+ const request = new HttpRequest({
36
34
  method: "GET",
37
35
  protocol: this.protocol,
38
36
  hostname: this.hostname,
@@ -48,7 +46,7 @@ class Signer {
48
46
  const presigned = await signer.presign(request, {
49
47
  expiresIn: 900,
50
48
  });
51
- return util.formatUrl(presigned).replace(`${this.protocol}//`, "");
49
+ return formatUrl(presigned).replace(`${this.protocol}//`, "");
52
50
  }
53
51
  createCredentialsWrapper(provider) {
54
52
  return async (identityProperties) => {
@@ -1,15 +1,11 @@
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 client_1 = require("@smithy/core/client");
6
- const getRuntimeConfig = (config) => {
1
+ const { Sha256 } = require("@aws-crypto/sha256-browser");
2
+ const { invalidProvider } = require("@smithy/core/client");
3
+ exports.getRuntimeConfig = (config) => {
7
4
  return {
8
5
  runtime: "browser",
9
6
  ...config,
10
- sha256: config?.sha256 ?? sha256_browser_1.Sha256,
11
- credentials: config?.credentials ?? (0, client_1.invalidProvider)("Credential is missing"),
12
- region: config?.region ?? (0, client_1.invalidProvider)("Region is missing"),
7
+ sha256: config?.sha256 ?? Sha256,
8
+ credentials: config?.credentials ?? invalidProvider("Credential is missing"),
9
+ region: config?.region ?? invalidProvider("Region is missing"),
13
10
  };
14
11
  };
15
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,23 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntimeConfig = void 0;
4
- const credential_providers_1 = require("@aws-sdk/credential-providers");
5
- const config_1 = require("@smithy/core/config");
6
- const serde_1 = require("@smithy/core/serde");
7
- const getRuntimeConfig = (config) => {
1
+ const { fromNodeProviderChain } = require("@aws-sdk/credential-providers");
2
+ const { loadConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } = require("@smithy/core/config");
3
+ const { Hash } = require("@smithy/core/serde");
4
+ exports.getRuntimeConfig = (config) => {
8
5
  return {
9
6
  runtime: "node",
10
7
  ...config,
11
- sha256: config?.sha256 ?? serde_1.Hash.bind(null, "sha256"),
8
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
12
9
  credentials: config?.credentials ??
13
- (0, credential_providers_1.fromNodeProviderChain)({
10
+ fromNodeProviderChain({
14
11
  profile: config.profile,
15
12
  }),
16
13
  region: config?.region ??
17
- (0, config_1.loadConfig)(config_1.NODE_REGION_CONFIG_OPTIONS, {
18
- ...config_1.NODE_REGION_CONFIG_FILE_OPTIONS,
14
+ loadConfig(NODE_REGION_CONFIG_OPTIONS, {
15
+ ...NODE_REGION_CONFIG_FILE_OPTIONS,
19
16
  profile: config.profile,
20
17
  }),
21
18
  };
22
19
  };
23
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntimeConfig = void 0;
4
- const sha256_js_1 = require("@aws-crypto/sha256-js");
5
- const client_1 = require("@smithy/core/client");
6
- const getRuntimeConfig = (config) => {
1
+ const { Sha256 } = require("@aws-crypto/sha256-js");
2
+ const { invalidProvider } = require("@smithy/core/client");
3
+ exports.getRuntimeConfig = (config) => {
7
4
  return {
8
5
  runtime: "react-native",
9
6
  ...config,
10
- sha256: config?.sha256 ?? sha256_js_1.Sha256,
11
- credentials: config?.credentials ?? (0, client_1.invalidProvider)("Credential is missing"),
12
- region: config?.region ?? (0, client_1.invalidProvider)("Region is missing"),
7
+ sha256: config?.sha256 ?? Sha256,
8
+ credentials: config?.credentials ?? invalidProvider("Credential is missing"),
9
+ region: config?.region ?? invalidProvider("Region is missing"),
13
10
  };
14
11
  };
15
- exports.getRuntimeConfig = getRuntimeConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/rds-signer",
3
- "version": "3.1068.0",
3
+ "version": "3.1069.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",
@@ -8,11 +8,11 @@
8
8
  "scripts": {
9
9
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
10
10
  "build:cjs": "node ../../scripts/compilation/inline",
11
- "build:es": "tsc -p tsconfig.es.json",
11
+ "build:es": "premove dist-es && tsc -p tsconfig.es.json",
12
12
  "build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
13
- "build:types": "tsc -p tsconfig.types.json",
13
+ "build:types": "premove dist-types && tsc -p tsconfig.types.json",
14
14
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
15
- "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
15
+ "clean": "premove dist-cjs dist-es dist-types",
16
16
  "extract:docs": "api-extractor run --local",
17
17
  "test": "yarn g:vitest run",
18
18
  "test:watch": "yarn g:vitest watch",
@@ -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/core": "^3.974.20",
35
- "@aws-sdk/credential-providers": "3.1068.0",
34
+ "@aws-sdk/core": "^3.974.21",
35
+ "@aws-sdk/credential-providers": "3.1069.0",
36
36
  "@smithy/core": "^3.24.6",
37
37
  "@smithy/signature-v4": "^5.4.6",
38
38
  "@smithy/types": "^4.14.3",
39
39
  "tslib": "^2.6.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@aws-sdk/types": "^3.973.12",
42
+ "@aws-sdk/types": "^3.973.13",
43
43
  "@types/node": "^20.14.8",
44
44
  "concurrently": "7.0.0",
45
45
  "downlevel-dts": "0.10.1",