
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@keboola/middy-event-validator
Advanced tools
Joi powered event validation middleware for Middy.
The middleware integrates Joi validation library to validate AWS Lambda events triggered by API Gateway.
Failed validations throw error of http-errors instance with status code 422.
import middy from 'middy';
import eventValidator from '@keboola/middy-event-validator';
export const handler = middy(() => {
// ...
});
handler
.use(eventValidator({
path: {
id: Joi.string().required()
},
body: {
size: Joi.number().integer()
},
pagination: true
}));
The configuration accepts following options:
headers - validation of HTTP headersbody - validation of HTTP body in JSON formatpath - validation of path parameters (shortcut for API Gateway's pathParameters)query - validation of query string (shortcut for API Gateway's queryStringParameters)pagination: true - shortcut for two query string parameters offset and limit validated as numbers.
limit is 1000. It can be changed by a definition: pagination: { max: 10 }The module also offers a set of validation shortcuts using class Validation:
import middy from 'middy';
import eventValidator, { Validation } from '@keboola/middy-event-validator';
handler
.use(eventValidator({
path: {
id: Validation.string('id').required()
}
}));
List of available shortcuts:
getJoi() - returns Joi instance for custom validationforbidden(param) - setting of the parameter is forbiddenboolean(param) - boolean valuestring(param) - string. All string shortcuts promote trimming of trailing white spacesstringMaxLength(param, length) - string with maximal lengthinteger(param)object(param)enum(param, values)array(param)arrayOfStrings(param)All shortcuts create optional parameters, for required parameters add .required().
FAQs
Event validation middleware for Middy
The npm package @keboola/middy-event-validator receives a total of 1 weekly downloads. As such, @keboola/middy-event-validator popularity was classified as not popular.
We found that @keboola/middy-event-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.