![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@compassdigital/provider
Advanced tools
An easy way to get started building data providers for Compass Digital. Provides an easy interface for creating methods that will be called via JSON-RPC 2.0.
An easy way to get started building data providers for Compass Digital. Provides an easy interface for creating methods that will be called via JSON-RPC 2.0.
Includes a built-in HTTP server and AWS Lambda handler.
npm install @compassdigital/provider --save
var Provider = require("@compassdigital/provider");
var provider = new Provider({type: "menu"});
// Handle the 'get_menu' method
provider.on("get_menu", function(req, callback)
{
// Do something to get the result
your_function(req, function(err, res)
{
callback(err, res);
});
});
// Convenience method: respond to several methods using the same handler
provider.on(["get_menu", "get_menu_today"], () => {...});
Sometimes your handler needs to know the context of the method call e.g. the user's id, location, etc. This is accessible via promises from this.context().
For example:
provider.on('get_menu', function (req, callback) {
// Get the user's id
this.context()
.user()
.then(function (user_data) {
var user_id = user_data.id;
callback(err, { message: 'Your user id was ' + user_id });
});
});
// Start on port 3000
provider.start(3000);
// Stop server
provider.stop();
Create lambda.js ending with:
var provider = (module.exports = provider.lambda); //...
Configure a Lambda function with the setting Handler:
lambda.handler
KEY_ARN="SOME PRIVATE AWS KMS KEY ARN" node test
FAQs
An easy way to get started building data providers for Compass Digital. Provides an easy interface for creating methods that will be called via JSON-RPC 2.0.
The npm package @compassdigital/provider receives a total of 47 weekly downloads. As such, @compassdigital/provider popularity was classified as not popular.
We found that @compassdigital/provider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 54 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.