Git Product home page Git Product logo

pfdgithub4's Introduction

verdaccio-auth-gitlab

Verdaccio authentication plugin by gitlab personal access tokens.

Installation

npm install --global verdaccio-auth-gitlab

Configure

config.yaml

auth:
  auth-gitlab:
    # Gitlab server (default: https://gitlab.com)
    url: https://gitlab.com

    # Gitlab token type (default: personal)
    tokenType: personal # options: personal/oauth/job

    # Check gitlab Role
    role:
      # Gitlab user role (default: true)
      # Warning: Set to false will disable all role
      #          Disable user role will make it impossible to check the relevance between username and token
      user: true

      # Gitlab group owner role (default: false)
      # Warning: Set to true will cause performance degradation
      groupOwner: false

      # Gitlab group member role (default: false)
      # Warning: Set to true will cause performance degradation
      groupMember: false

      # Gitlab group minimal access level (default: [])
      # Warning: Set to non-empty array will cause performance degradation
      #          Supported by gitlab 11.2
      groupMinAccessLevel: [] # access level array e.g. [30, 40]

      # Gitlab project owner role (default: false)
      # Warning: Set to true will cause performance degradation
      projectOwner: false

      # Gitlab project member role (default: false)
      # Warning: Set to true will cause performance degradation
      projectMember: false

      # Gitlab project minimal access level (default: [])
      # Warning: Set to non-empty array will cause performance degradation
      #          Supported by gitlab 11.2
      projectMinAccessLevel: [] # access level array e.g. [30, 40]

    # Cache gitlab user
    cache:
      # Max cache count (default: 1000)
      # Warning: Set to 0 will cause performance degradation
      maxCount: 1000

      # Max cache second (default: 300)
      # Warning: Set to 0 will cause performance degradation
      maxSecond: 300

    # Limit the scope of the all function
    page:
      # Number of items to list per page (default: 100)
      # Warning: The maximum value is 100
      perPage: 100
      # Max page number (default: 0)
      # Warning: Set to 0 will get all data
      maxPages: 0

Role

config.yaml

packages:
  '@scope/*':
    access: $gitlab:user
    publish: $gitlab:user:xxx

$gitlab:user All users
$gitlab:user:xxx The user whose username is xxx
$gitlab:group:xxx:owner Owner of the group which path is xxx
$gitlab:group:xxx:member Member of the group which path is xxx
$gitlab:group:xxx:level:40 Maintainer(Master) or owner of the group which path is xxx
$gitlab:project:xxx:owner Owner of the project which path is xxx
$gitlab:project:xxx:member Member of the project which path is xxx
$gitlab:project:xxx:level:30 Developer or maintainer(master) or owner of the project which path is xxx

The following placeholder is allowed in xxx
[pkgScope] package scope
[pkgName] package name (without scope)

e.g.
Access or publish a package @scope/name:
$gitlab:group:[pkgScope]:owner Owner of the group which path is scope
$gitlab:project:[pkgName]:owner Owner of the project which path is name

The access levels are defined in the Gitlab::Access module. Currently, these levels are recognized:

10 => Guest access
20 => Reporter access
30 => Developer access
40 => Maintainer access
50 => Owner access # Only valid for groups

Use

npm login --registry=http://xxx

Username: gitlab username
Password: gitlab personal access tokens

License

This project is licensed under MIT.

pfdgithub4's People

Contributors

eloraibyx avatar

Watchers

 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.