Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@graphile/pg-pubsub
Advanced tools
Subscriptions plugin for PostGraphile using PostgreSQL's LISTEN/NOTIFY
This PostGraphile server
plugin provides a pubsub
instance to schema
plugins that uses
PostgreSQL LISTEN
/NOTIFY
to provide realtime features.
Also adds support for @pgSubscriptions
directive to easily define your own
subscriptions using LISTEN/NOTIFY with makeExtendSchemaPlugin
; and adds the
--simple-subscriptions
feature which, when enabled, adds a simple listen
subscription field to your GraphQL API.
It's intended that you use this plugin as a provider of realtime data to other plugins which can use it to add subscription fields to your API.
For full documentation, see: https://www.graphile.org/postgraphile/subscriptions/
To help us develop this software sustainably under the MIT license, we ask all individuals and businesses that use it to help support its ongoing maintenance and development via sponsorship.
And please give some love to our featured sponsors 🤩:
Surge * | Netflix * | Qwick * | The Guild * |
Chad Furman * | Fanatics * | Dovetail * | Enzuzo * |
Stellate * |
* Sponsors the entire Graphile suite
CLI:
yarn add @graphile/pg-pubsub
postgraphile \
--plugins @graphile/pg-pubsub \
--subscriptions \
--simple-subscriptions \
-c postgres:///mydb
Library:
const express = require("express");
const { postgraphile, makePluginHook } = require("postgraphile");
const { default: PgPubsub } = require("@graphile/pg-pubsub");
const pluginHook = makePluginHook([PgPubsub]);
const postgraphileOptions = {
pluginHook,
subscriptions: true, // Enable PostGraphile websocket capabilities
simpleSubscriptions: true, // Add the `listen` subscription field
subscriptionEventEmitterMaxListeners: 20, // Set max listeners on eventEmitter, 0 unlimited, 10 default
websocketMiddlewares: [
// Add whatever middlewares you need here, note that they should only
// manipulate properties on req/res, they must not sent response data. e.g.:
//
// require('express-session')(),
// require('passport').initialize(),
// require('passport').session(),
],
};
const app = express();
app.use(postgraphile(databaseUrl, "app_public", postgraphileOptions));
app.listen(parseInt(process.env.PORT, 10) || 3000);
FAQs
Subscriptions plugin for PostGraphile using PostgreSQL's LISTEN/NOTIFY
We found that @graphile/pg-pubsub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.