Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/github-workflows",
"version": "7.3.4",
"version": "7.4.0",
"private": true,
"engines": {
"node": ">=24.0"
Expand Down
598 changes: 319 additions & 279 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/monorepo",
"version": "7.3.4",
"version": "7.4.0",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda",
"private": true,
"type": "module",
Expand Down Expand Up @@ -80,7 +80,6 @@
"@sveltejs/kit": {
"cookie": "^0.7.2"
},
"fast-xml-parser": ">=5.7.2",
"mathjs": ">=15.2.0"
},
"devEngines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/appconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/appconfig",
"version": "7.3.4",
"version": "7.4.0",
"description": "AppConfig middleware for the middy framework",
"type": "module",
"engines": {
Expand Down Expand Up @@ -68,11 +68,11 @@
}
},
"dependencies": {
"@middy/util": "7.3.4"
"@middy/util": "7.4.0"
},
"devDependencies": {
"@aws-sdk/client-appconfigdata": "^3.0.0",
"@middy/core": "7.3.4",
"@middy/core": "7.4.0",
"@types/aws-lambda": "^8.0.0",
"@types/node": "^22.0.0",
"aws-xray-sdk": "^3.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudformation-response/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/cloudformation-response",
"version": "7.3.4",
"version": "7.4.0",
"description": "CloudFormation Custom Response event response handling for the middy framework",
"type": "module",
"engines": {
Expand Down Expand Up @@ -61,7 +61,7 @@
"url": "https://github.com/sponsors/willfarrell"
},
"devDependencies": {
"@middy/core": "7.3.4",
"@middy/core": "7.4.0",
"@types/aws-lambda": "^8.0.0",
"@types/node": "^22.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudformation-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/cloudformation-router",
"version": "7.3.4",
"version": "7.4.0",
"description": "CloudFormation Custom Response event router for the middy framework",
"type": "module",
"engines": {
Expand Down Expand Up @@ -62,7 +62,7 @@
"url": "https://github.com/sponsors/willfarrell"
},
"devDependencies": {
"@middy/core": "7.3.4",
"@middy/core": "7.4.0",
"@types/aws-lambda": "^8.0.0",
"@types/node": "^22.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudwatch-metrics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/cloudwatch-metrics",
"version": "7.3.4",
"version": "7.4.0",
"description": "Embedded CloudWatch metrics middleware for the middy framework",
"type": "module",
"engines": {
Expand Down Expand Up @@ -68,7 +68,7 @@
"aws-embedded-metrics": "4.2.1"
},
"devDependencies": {
"@middy/core": "7.3.4",
"@middy/core": "7.4.0",
"@types/aws-lambda": "^8.0.0",
"@types/node": "^22.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/core",
"version": "7.3.4",
"version": "7.4.0",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (core package)",
"type": "module",
"engines": {
Expand Down Expand Up @@ -103,7 +103,7 @@
"url": "https://github.com/sponsors/willfarrell"
},
"dependencies": {
"@middy/util": "7.3.4"
"@middy/util": "7.4.0"
},
"peerDependencies": {
"@aws/durable-execution-sdk-js": "^1.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/do-not-wait-for-empty-event-loop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/do-not-wait-for-empty-event-loop",
"version": "7.3.4",
"version": "7.4.0",
"description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function",
"type": "module",
"engines": {
Expand Down Expand Up @@ -60,10 +60,10 @@
"url": "https://github.com/sponsors/willfarrell"
},
"dependencies": {
"@middy/util": "7.3.4"
"@middy/util": "7.4.0"
},
"devDependencies": {
"@middy/core": "7.3.4",
"@middy/core": "7.4.0",
"@types/aws-lambda": "^8.0.0",
"@types/node": "^22.0.0"
}
Expand Down
50 changes: 50 additions & 0 deletions packages/dsql-signer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<div align="center">
<h1>Middy `dsql-signer` middleware</h1>
<img alt="Middy logo" src="https://raw.githubusercontent.com/middyjs/middy/main/docs/img/middy-logo.svg"/>
<p><strong>Aurora DSQL Signer middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda</strong></p>
<p>
<a href="https://github.com/middyjs/middy/actions/workflows/test-unit.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-unit.yml/badge.svg" alt="GitHub Actions unit test status"></a>
<a href="https://github.com/middyjs/middy/actions/workflows/test-dast.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-dast.yml/badge.svg" alt="GitHub Actions dast test status"></a>
<a href="https://github.com/middyjs/middy/actions/workflows/test-perf.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-perf.yml/badge.svg" alt="GitHub Actions perf test status"></a>
<a href="https://github.com/middyjs/middy/actions/workflows/test-sast.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-sast.yml/badge.svg" alt="GitHub Actions sast test status"></a>
<a href="https://github.com/middyjs/middy/actions/workflows/test-lint.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-lint.yml/badge.svg" alt="GitHub Actions lint test status"></a>
<br/>
<a href="https://www.npmjs.com/package/@middy/dsql-signer"><img alt="npm version" src="https://img.shields.io/npm/v/@middy/dsql-signer.svg"></a>
<a href="https://packagephobia.com/result?p=@middy/dsql-signer"><img src="https://packagephobia.com/badge?p=@middy/dsql-signer" alt="npm install size"></a>
<a href="https://www.npmjs.com/package/@middy/dsql-signer">
<img alt="npm weekly downloads" src="https://img.shields.io/npm/dw/@middy/dsql-signer.svg"></a>
<a href="https://www.npmjs.com/package/@middy/dsql-signer#provenance">
<img alt="npm provenance" src="https://img.shields.io/badge/provenance-Yes-brightgreen"></a>
<br/>
<a href="https://scorecard.dev/viewer/?uri=github.com/middyjs/middy"><img src="https://api.scorecard.dev/projects/github.com/middyjs/middy/badge" alt="Open Source Security Foundation (OpenSSF) Scorecard"></a>
<a href="https://slsa.dev"><img src="https://slsa.dev/images/gh-badge-level3.svg" alt="SLSA 3"></a>
<a href="https://github.com/middyjs/middy/blob/main/docs/CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg"></a>
<a href="https://biomejs.dev"><img alt="Checked with Biome" src="https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome"></a>
<a href="https://conventionalcommits.org"><img alt="Conventional Commits" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white"></a>
<a href="https://github.com/middyjs/middy/blob/main/package.json#L32">
<img alt="code coverage" src="https://img.shields.io/badge/code%20coverage-95%25-brightgreen"></a>
<br/>
</p>
<p>You can read the documentation at: <a href="https://middy.js.org/docs/middlewares/dsql-signer">https://middy.js.org/docs/middlewares/dsql-signer</a></p>
</div>

## Install

```bash
npm install --save @middy/dsql-signer @aws-sdk/dsql-signer
```


## Documentation and examples

For documentation and examples, refer to the main [Middy monorepo on GitHub](https://github.com/middyjs/middy) or [Middy official website](https://middy.js.org/docs/middlewares/dsql-signer).


## Contributing

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).


## License

Licensed under [MIT License](https://github.com/middyjs/middy/blob/main/LICENSE). Copyright (c) 2017-2026 [will Farrell](https://github.com/willfarrell), [Luciano Mammino](https://github.com/lmammino), and [Middy contributors](https://github.com/middyjs/middy/graphs/contributors).
54 changes: 54 additions & 0 deletions packages/dsql-signer/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
// SPDX-License-Identifier: MIT
import type { DsqlSigner, DsqlSignerConfig } from "@aws-sdk/dsql-signer";
import type middy from "@middy/core";
import type { Options as MiddyOptions } from "@middy/util";
import type { Context as LambdaContext } from "aws-lambda";

export type ParamType<T> = string & { __returnType?: T };
export declare function dsqlSignerParam<T>(name: string): ParamType<T>;

export type DsqlSignerFetchConfig = DsqlSignerConfig & { username?: string };

export type DsqlSignerOptions<AwsSigner = DsqlSigner> = Omit<
MiddyOptions<AwsSigner, DsqlSignerFetchConfig>,
"fetchData"
> & {
fetchData?: {
[key: string]: DsqlSignerFetchConfig;
};
};

export type Context<TOptions extends DsqlSignerOptions | undefined> =
TOptions extends { setToContext: true }
? TOptions extends { fetchData: infer TFetchData }
? LambdaContext & {
[Key in keyof TFetchData]: string;
}
: never
: LambdaContext;

export type Internal<TOptions extends DsqlSignerOptions | undefined> =
TOptions extends DsqlSignerOptions
? TOptions extends { fetchData: infer TFetchData }
? {
[Key in keyof TFetchData]: string;
}
: {}
: {};

declare function dsqlSigner<TOptions extends DsqlSignerOptions | undefined>(
options?: TOptions,
): middy.MiddlewareObj<
unknown,
unknown,
Error,
Context<TOptions>,
Internal<TOptions>
>;

export declare function dsqlSignerValidateOptions(
options?: Record<string, unknown>,
): void;

export default dsqlSigner;
22 changes: 22 additions & 0 deletions packages/dsql-signer/index.fuzz.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { test } from "node:test";
import fc from "fast-check";
import middy from "../core/index.js";
import middleware from "./index.js";

const handler = middy((event) => event).use(middleware());
const defaultContext = {
getRemainingTimeInMillis: () => 1000,
};

test("fuzz `event` w/ `object`", async () => {
await fc.assert(
fc.asyncProperty(fc.object(), async (event) => {
await handler(event, defaultContext);
}),
{
numRuns: 100_000,

examples: [],
},
);
});
Loading
Loading