
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
loopback-cache
Advanced tools
Cache solutions for Loopback.
npm install loopback-cache --save
To load the mixins.
# model-config.json
{
"_meta": {
...
"mixins": [
...
"loopback-cache/mixins",
...
]
},
...
}
To use the redis
backend, setup a model using the redis connector or the ioredis connector and use the mixin CacheModel
with the model. The TTL is in seconds, see http://redis.io/commands/expire.
# The model JSON
{
...
"mixins": {
"CacheModel": {
"backend": "redis",
"ttl": 3600
}
},
...
}
To use the couchbase
backend, setup a model using the couchbase3 connector and use the mixin CacheModel
with the model. The TTL is in seconds, for value larger than 30 * 24 * 60 * 60 seconds (30 days), it would be converted to absolute times (from the epoch) in seconds, see http://docs.couchbase.com/sdk-api/couchbase-node-client-2.1.2/Bucket.html#touch.
# The model JSON
{
...
"mixins": {
"CacheModel": {
"backend": "couchbase",
"ttl": 3600
}
},
...
}
Note: This module doesn't do anything on the DB or table level. For example MongoDB would require a special index that matches the field, which should be prepared before you start the application.
To add the support for a specific connector (it's a model mixin so we are talking connectors not DB directly), extend this module in a place that will be executed (for example boot
).
var loopbackCache = require('loopback-cache');
And add a new backend (you can also override backends). See https://github.com/Wiredcraft/loopback-cache/tree/master/backends for examples.
loopbackCache.backends.something = function(Model, options) {};
Now you can use it in the model JSON, same as any other backend.
{
"mixins": {
"CacheModel": {
"backend": "something",
"ttl": 3600
}
}
}
If you want to add a new backend to the module, just drop the file in the backends
directory, and send us a PR.
project : loopback-cache
repo age : 11 months
active : 16 days
commits : 46
files : 18
authors :
22 CCharlieLi 47.8%
22 Makara Wang 47.8%
2 fraserxu 4.3%
FAQs
Cache solutions for Loopback
We found that loopback-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.