Code Monkey home page Code Monkey logo

verdaccio-activedirectory's Introduction

verdaccio-activedirectory

Active Directory authentication plugin for verdaccio

Installation

$ npm install verdaccio-activedirectory

Config

Add to your config.yaml:

auth:
  activedirectory:
    url: "ldap://10.0.100.1"
    baseDN: 'dc=sample,dc=local'
    domainSuffix: 'sample.local'
    groupName: 'npmWriters' # optional

Alternatively, if your config.yaml uses multiple security groups, you can provide a yaml sequence:

auth:
  activedirectory:
    url: "ldap://10.0.100.1"
    baseDN: 'dc=sample,dc=local'
    domainSuffix: 'sample.local'
    groupName:
      - 'npmWriters'
      - 'npmAdministrators'

Note that when using the groupName parameter, the plugin will require at least one security group to exist on the user in order to successfully authenticate.

Examples

Restricting a specific scope

Groups(s) defined in the groupName secion of the activedirectory configuration become available to the packages block of config.yaml. This can be used to restrict certain actions. Below, the scope @internal-scope is only accessable to users belowing to npmUsers:

auth:
  activedirectory:
    url: "ldap://10.0.100.1"
    baseDN: 'dc=sample,dc=local'
    domainSuffix: 'sample.local'
    groupName: 'npmUsers' 

packages:
  '@internal-scope/*':
    access: npmUsers
    publish: npmUsers
    unpublish: npmUsers

  '**':
    access: $all
    proxy: npmjs

Using multiple groups for access control

By providing multple groups in the groupName section, we can restrict actions to individual classes of users. In this example we:

  • allow anyone to view and install packages within @internal-scope
  • have restricted publishing to users who belong to npmWriters or npmAdmins
  • only allow npmAdmins to unpublish packages
auth:
  activedirectory:
    url: "ldap://10.0.100.1"
    baseDN: 'dc=sample,dc=local'
    domainSuffix: 'sample.local'
    groupName: 
      - npmWriters
      - npmAdmins

packages:
  '@internal-scope/*':
    access: $all
    publish: npmUsers npmAdmins
    unpublish: npmAdmins

  '**':
    access: $all
    proxy: npmjs

verdaccio-activedirectory's People

Contributors

jsikorski avatar juanpicado avatar nowhammies avatar theundefined avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.