@middy/rds-signer 4.0.0 → 4.0.2

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/README.md +0 -63
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -36,69 +36,6 @@
36
36
  <p>You can read the documentation at: <a href="https://middy.js.org/docs/middlewares/rds-signer">https://middy.js.org/docs/middlewares/rds-signer</a></p>
37
37
  </div>
38
38
 
39
- Fetches RDS credentials to be used when connecting to RDS with IAM roles.
40
-
41
- ## Install
42
-
43
- To install this middleware you can use NPM:
44
-
45
- ```bash
46
- npm install --save @middy/rds-signer
47
- ```
48
-
49
- ## Options
50
-
51
- - `AwsClient` (object) (default `Signer`): Signer class constructor (e.g. that has been instrumented with AWS XRay). Must be from `@aws-sdk/rds-signer`.
52
- - `awsClientOptions` (object) (default `undefined`): Options to pass to Signer class constructor.
53
- - `fetchData` (object `{ contextKey: {region, hostname, username, database, port} }`) (required): Mapping of internal key name to API request parameters.
54
- - `disablePrefetch` (boolean) (default `false`): On cold start requests will trigger early if they can. Setting `awsClientAssumeRole` disables prefetch.
55
- - `cacheKey` (string) (default `rds-signer`): Cache key for the fetched data responses. Must be unique across all middleware.
56
- - `cacheExpiry` (number) (default `-1`): How long fetch data responses should be cached for. `-1`: cache forever, `0`: never cache, `n`: cache for n ms.
57
- - `setToContext` (boolean) (default `false`): Store role tokens to `request.context`.
58
-
59
- NOTES:
60
-
61
- - Lambda is required to have IAM permission for `rds-db:connect` with a resource like `arn:aws:rds-db:#{AWS::Region}:#{AWS::AccountId}:dbuser:${database_resource}/${iam_role}`
62
-
63
- ## Sample usage
64
-
65
- ```javascript
66
- import middy from '@middy/core'
67
- import rdsSigner from '@middy/rds-signer'
68
-
69
- const handler = middy((event, context) => {
70
- const response = {
71
- statusCode: 200,
72
- headers: {},
73
- body: JSON.stringify({ message: 'hello world' })
74
- }
75
-
76
- return response
77
- })
78
-
79
- handler.use(
80
- rdsSigner({
81
- fetchData: {
82
- rdsToken: {
83
- region: 'ca-central-1',
84
- hostname: '***.rds.amazonaws.com',
85
- username: 'iam_role',
86
- database: 'postgres',
87
- port: 5432
88
- }
89
- }
90
- })
91
- )
92
- ```
93
-
94
- ## Middy documentation and examples
95
-
96
- For more documentation and examples, refers to the main [Middy monorepo on GitHub](https://github.com/middyjs/middy) or [Middy official website](https://middy.js.org).
97
-
98
- ## Contributing
99
-
100
- Everyone is very welcome to contribute to this repository. Feel free to [raise issues](https://github.com/middyjs/middy/issues) or to [submit Pull Requests](https://github.com/middyjs/middy/pulls).
101
-
102
39
  ## License
103
40
 
104
41
  Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/rds-signer",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "RDS (Relational Database Service) credentials middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -62,13 +62,13 @@
62
62
  },
63
63
  "homepage": "https://middy.js.org",
64
64
  "dependencies": {
65
- "@middy/util": "4.0.0"
65
+ "@middy/util": "4.0.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@aws-sdk/rds-signer": "^3.186.0",
69
- "@middy/core": "4.0.0",
69
+ "@middy/core": "4.0.2",
70
70
  "@types/node": "^18.0.0",
71
71
  "aws-xray-sdk": "^3.3.3"
72
72
  },
73
- "gitHead": "582286144bcd79968a8c7c2f8867a23c80079a47"
73
+ "gitHead": "c77c9413ecb80999a71b67ff97edac1fed2ca754"
74
74
  }