
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Environment variable middleware for the middy framework
npm install middy-env
The specified environment variables will be parsed and passed into the handler.
cache
(boolean) (optional): Set it to true
to skip further lookups of environment variables. Defaults to false
.cacheExpiryInMillis
(int) (optional): Time in milliseconds for values to remain cached. Defaults to undefined
.setToContext
(boolean) (optional): This will assign the parsed values to the context
object
of the function handler rather than to process.env
. Defaults to true
.names
(object) (required): Map of environment variables to parse, where the key is the destination.['KEY', 'string', 'fallbackValue']
.By default parameters are assigned to the function handler's context
object. They can instead be assigned to the Node.js process.env
object by setting the setToContext
flag to false
.
If no fallback value is provided a ReferenceError will be thrown if an environment variable is undefined.
string
int
float
bool
const middy = require('middy');
const env = require('middy-env');
const handler = (event, context, callback) => {
callback(null, `Hello ${context.firstName} ${context.lastName}`);
};
module.exports = middy(handler)
.use(env({
names: {
firstName: ['FIRST_NAME', 'string', 'World'],
lastName: 'LAST_NAME'
},
cache: true,
cacheExpiryInMillis: 3600000
}));
2.0.0 (2021-09-09)
FAQs
Environment variable middleware for the middy framework
The npm package middy-env receives a total of 903 weekly downloads. As such, middy-env popularity was classified as not popular.
We found that middy-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.