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.
@apollo/server-plugin-operation-registry
Advanced tools
The operation registry plugin is the interface into the Apollo Platform's operation registry and enables operation safelisting, which allows selective execution based on the operation. Safelisting eliminates the risk of unexpected operations that could cause downtime from being run against a graph.
In order to enable safelisting, follow the step by step guide in the Apollo docs. These steps describe how to extract and upload operations defined within client applications to Apollo Studio using the Apollo CLI. Once operations have been registered, this plugin for Apollo Server fetches the manifest of these operations from Apollo Studio and forbids the execution of any operations that are not in that manifest.
The following example shows basic usage of the plugin with Apollo Server. First, add the plugin to your project's package.json
:
npm install @apollo/server-plugin-operation-registry
Then, ensure Apollo Server has access to an API key, for example as the APOLLO_KEY
environment variable:
APOLLO_KEY=<API_KEY> npm start
Next, enable the plugin by adding it to the plugins
parameter to the Apollo Server options:
const server = new ApolloServer({
typeDefs,
resolvers,
subscriptions: false,
plugins: [
require("@apollo/server-plugin-operation-registry")({
forbidUnregisteredOperations: true
})
]
});
const { ApolloServer } = require("apollo-server");
const { ApolloGateway } = require("@apollo/gateway");
const gateway = new ApolloGateway({
serviceList: [ /* services */ ],
});
const server = new ApolloServer({
gateway,
subscriptions: false,
plugins: [
require("@apollo/server-plugin-operation-registry")({
forbidUnregisteredOperations: true
})
]
});
server.listen().then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
});
Clients can register their operations to a specific variant, so the plugin contains the graphVariant
field to specify which variant to pull operation manifests from.
const server = new ApolloServer({
plugins: [
require("@apollo/server-plugin-operation-registry")({
graphVariant: "production"
})
]
});
The plugin will transmit metrics regarding unregistered operations which can be viewed within Apollo Studio. The following example shows the unregistered operations sent by a particular client:
FAQs
Apollo Server operation registry plugin
The npm package @apollo/server-plugin-operation-registry receives a total of 968 weekly downloads. As such, @apollo/server-plugin-operation-registry popularity was classified as not popular.
We found that @apollo/server-plugin-operation-registry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
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.