Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
alexa-ability-stash
Advanced tools
An alexa-ability middleware for persistent user storage.
Warning: Still in development. Not suitable for use in production yet.
import { Ability } from 'alexa-ability';
import { handleAbility } from 'alexa-ability-lambda-handler';
import createStash from 'alexa-ability-stash';
import createRedisStore from 'connect-redis'; // or any compatible express-session store
const RedisStore = createRedisStore(createStash);
const store = new RedisStore(options);
const app = new Ability();
app.use(createStash({ store }));
app.on('LuckyNumberIntent', function(req, next) {
if (!req.stash.luckyNumber) {
// persisted "forever"
req.stash.luckyNumber = Math.floor(Math.random() * 100 + 1);
}
req.say(`Your lucky number is ${req.stash.luckyNumber}!`).end();
});
export const handler = handleAbility(app);
createStash(options) -> middleware
Creates a middleware function to handle the stash.
Takes the following options:
store
- one of the stores defined belowgenid
- a function that takes a request object and returns a string. Returns <appId>:<userId>
by default.unset
- Behavior when req.stash
is deleted. destroy
or keep
. Defaults to keep
.
keep
The stash will be kept, but modifications made during the request are ignored and not saved.destroy
: The stash will be destroyed (deleted) when the response ends.resave
Forces the stash to be saved, even if the stash was never modified. Defaults to true
.Attaches two properties to the request object:
stash
an object you can read and modify. Changes will be saved across requests.stashId
the id generated by genid
.Theoretically all the store supported by express-session should work. In practice, only connect-redis has been tested.
If a store doesn't work for you raise an issue!
FAQs
An alexa-ability middleware for persistent user storage.
The npm package alexa-ability-stash receives a total of 1 weekly downloads. As such, alexa-ability-stash popularity was classified as not popular.
We found that alexa-ability-stash 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.