Skip to content
GRPC ACL microservice in node. Built on top of condor-framework and acl modules.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec/support
.editorconfig
.eslintignore
.eslintrc.json
.gitignore
.istanbul.yml
.travis.yml
LICENSE
README.md
acl.proto
index.integration.spec.js
index.js
index.spec.js
package.json

README.md

grpc-acl

GRPC ACL microservice in node. Built on top of condor-framework and acl.

Build Status Coverage Status

Status

Unmaintained.

Installation

npm i --save grpc-acl
npm i --save condor-framework
npm i --save acl

Usage

  • Copy the acl.proto file.
  • Create your server with the following code:
const acl = require('acl');
const AclServer = require('grpc-acl').AclServer;

// Using memory backend. redis, mongo and others available (See acl module documentation)
const backend = new acl.memoryBackend();

const options = {
  'host': 'localhost',
  'port': 3000,
};

const server = new AclServer(backend, options);
// you can add here your own middleware. (See condor-framework documentation)
server.start();

To call the service:

const caller = require('grpc-caller');
const client = caller('localhost:3000', './acl.proto', 'AclService');
client.addUserRoles({'user': 'joed', 'roles': ['guest']}).then(() => {
  console.log('done!');
});

To find which methods are implemented take a look at the acl.proto file. They are pretty similar to the ones found in the documentation of the acl module.

You can take the integration test as an example too.

Arguments

  • backend. Check ACL documentation.
  • options.

Options

You can pass any condor options, and also the following:

Option Description Default
aclProtoFilePath Path to the acl.proto file ./acl.proto
aclServiceName Service name of the AclService (must match to the one in the proto file) AclService

License and Credits

MIT License. Copyright 2017

Built by the GRPC experts at Devsu.

You can’t perform that action at this time.