Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@startupjs/server-aggregate
Advanced tools
Racer server aggregate plugin. It allows only server-defined aggregate queries.
yarn add @startupjs/server-aggregate
In our client code:
require('@startupjs/server-aggregate/client')
On the server:
const serverAggregate = require('@startupjs/server-aggregate')
serverAggregate(backend, customCheck)
Here:
- `backend` - your backend
- `customCheck` - your personal check function. It should return an error message if there is an error. **IMPORTANT** The message must be of type `string`.
// function addAggregate accept
// 'collection' - collection name
// 'queryName' - name of query
// 'cb' - function that accepts 'params' and 'shareRequest'
// and returns a query-object or error-string
backend.addAggregate('items', 'main', async (params, shareRequest) => {
// ...
// access control or whatever
// ...
return [
{$match: {type: 'wooden'}}
]
})
Using queries (on the client):
// function aggregateQuery accepts 3 arguments:
// 'collection' - collection name (should match one from addServerQuery)
// 'queryName' - name of query (should match one from addServerQuery)
// 'params' - object with query-params
const query = model.aggregateQuery('items', 'main', {
type: 'global'
})
model.subscribe(query, function(){
// ...
})
Alternative approach (using regular model.query)
const query = model.query('items', {
$aggregationName: 'main',
$params: {
type: 'global'
}
})
model.subscribe(query, function(){
// ...
})
Copyright (c) 2018 by Artur Zayats
FAQs
Module for describing aggregations on the server
The npm package @startupjs/server-aggregate receives a total of 59 weekly downloads. As such, @startupjs/server-aggregate popularity was classified as not popular.
We found that @startupjs/server-aggregate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.