Apologies, due to changes in my work environment, I no longer use Verdaccio and GitLab. Consequently, I am unable to continue maintaining this package. Please feel free to fork and maintain it on your own.
Verdaccio authentication plugin by gitlab personal access token or oauth token or ci job token.
npm install --global verdaccio-auth-gitlabconfig.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# Use full group path (default: false)fullGroupPath: false# Use full project path with namespace (default: false)fullProjectPath: false# Any group list api options (default: null)extendGroupOptions: null# Any project list api options (default: null)extendProjectOptions: null# Check gitlab Rolerole:
# 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 tokenuser: true# Gitlab group owner role (default: false)# Warning: Set to true will cause performance degradationgroupOwner: false# Gitlab group member role (default: false)# Warning: Set to true will cause performance degradationgroupMember: false# Gitlab group minimal access level (default: [])# Warning: Set to non-empty array will cause performance degradation# Supported by gitlab 11.2groupMinAccessLevel: [] # access level array e.g. [30, 40]# Gitlab project owner role (default: false)# Warning: Set to true will cause performance degradationprojectOwner: false# Gitlab project member role (default: false)# Warning: Set to true will cause performance degradationprojectMember: false# Gitlab project minimal access level (default: [])# Warning: Set to non-empty array will cause performance degradation# Supported by gitlab 11.2projectMinAccessLevel: [] # access level array e.g. [30, 40]# Cache gitlab usercache:
# Max cache count (default: 1000)# Warning: Set to 0 will cause performance degradationmaxCount: 1000# Max cache second (default: 300)# Warning: Set to 0 will cause performance degradationmaxSecond: 300# Limit the scope of the all functionpage:
# Number of items to list per page (default: 100)# Warning: The maximum value is 100perPage: 100# Max page number (default: 0)# Warning: Set to 0 will get all datamaxPages: 0config.yaml
packages:
'@scope/*':
access: $gitlab:userpublish: $gitlab:user:xxx$gitlab:user All users$gitlab:user:xxx The user whose username is encodeURIComponent(xxx)$gitlab:group:xxx:owner Owner of the group which path is encodeURIComponent(xxx)$gitlab:group:xxx:member Member of the group which path is encodeURIComponent(xxx)$gitlab:group:xxx:level:40 Maintainer(Master) or owner of the group which path is encodeURIComponent(xxx)$gitlab:project:xxx:owner Owner of the project which path is encodeURIComponent(xxx)$gitlab:project:xxx:member Member of the project which path is encodeURIComponent(xxx)$gitlab:project:xxx:level:30 Developer or maintainer(master) or owner of the project which path is encodeURIComponent(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
npm login --registry=http://xxx
Username: gitlab username
Password: gitlab personal/oauth/job tokenThis project is licensed under MIT.