Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@voilab/vmol-auth

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voilab/vmol-auth

Authentication and Authorization framework for Moleculer

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57
decreased by-14.93%
Maintainers
2
Weekly downloads
 
Created
Source

vmol-users

Components

Auhentication

Expect a JWT in ctx.meta.token. Will parse and check the JWT and then put the resulting token in ctx.locals.token. If the token is invalid, expired or malformed, a MoleculerClientError exception will be thrown. If no token is provided, no exception is thrown and ctx.locals.token is undefined.

Authorization

Expects an array role inside ctx.locals.token. Will request Casl abilites definition from the abilities service and match the requested action against the abilities. If the user doesn't have access to that action, a MoleculerClientError exception will be thrown.

Usage

To enable, add the middleware to your services.

module.exports = {
    name: 'myservice',

    /**
     * Mixins
     */
    mixins: [ AuthorizationMixin, AuthenticationMixin ],
};

When usign both AuthorizationMixin and AuthenticationMixin, authentication must be set after authorization.

Automatic ACL validation

Manual ACL validation

Keywords

FAQs

Package last updated on 25 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc