{"id":13441840,"url":"https://github.com/Alexandre-io/verdaccio-ldap","last_synced_at":"2025-03-20T13:31:05.755Z","repository":{"id":18175905,"uuid":"83668109","full_name":"Alexandre-io/verdaccio-ldap","owner":"Alexandre-io","description":"LDAP auth plugin for verdaccio","archived":false,"fork":false,"pushed_at":"2024-06-16T09:54:14.000Z","size":421,"stargazers_count":50,"open_issues_count":12,"forks_count":27,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-02T08:48:39.704Z","etag":null,"topics":["active-directory","ldap","npm","private-npm","registry","sinopia","verdaccio"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alexandre-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-03-02T10:59:51.000Z","updated_at":"2024-05-28T08:22:03.000Z","dependencies_parsed_at":"2024-02-26T19:57:53.081Z","dependency_job_id":null,"html_url":"https://github.com/Alexandre-io/verdaccio-ldap","commit_stats":{"total_commits":98,"total_committers":17,"mean_commits":5.764705882352941,"dds":0.6224489795918368,"last_synced_commit":"77f96196fbea9add16011cdc18f2db9c6835b2e4"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexandre-io%2Fverdaccio-ldap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexandre-io%2Fverdaccio-ldap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexandre-io%2Fverdaccio-ldap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexandre-io%2Fverdaccio-ldap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alexandre-io","download_url":"https://codeload.github.com/Alexandre-io/verdaccio-ldap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221768356,"owners_count":16877628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-directory","ldap","npm","private-npm","registry","sinopia","verdaccio"],"created_at":"2024-07-31T03:01:38.697Z","updated_at":"2024-10-28T02:30:18.698Z","avatar_url":"https://github.com/Alexandre-io.png","language":"JavaScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# verdaccio-ldap [![Codacy Badge](https://app.codacy.com/project/badge/Grade/ada514a3f0af469882e0493c11a41e90)](https://www.codacy.com/gh/Alexandre-io/verdaccio-ldap/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Alexandre-io/verdaccio-ldap\u0026amp;utm_campaign=Badge_Grade) [![Known Vulnerabilities](https://snyk.io/test/github/Alexandre-io/verdaccio-ldap/badge.svg)](https://snyk.io/test/github/Alexandre-io/verdaccio-ldap)\n\n`verdaccio-ldap` is a fork of `sinopia-ldap`. It aims to keep backwards compatibility with `sinopia`, while keeping up with npm changes.\n\n## Installation\n\n```sh\n$ npm install verdaccio\n$ npm install verdaccio-ldap\n```\n\n\u003e A detailed example of the verdaccio-ldap plugin + OpenLDAP server packed in Docker for v3 is available [here](https://github.com/verdaccio/docker-examples/tree/master/ldap-verdaccio) and for v4 [here](https://github.com/verdaccio/docker-examples/tree/master/ldap-verdaccio-v4).\n\n[Read a guide how to migrate from Verdaccio v3 to v4 using LDAP plugin](https://verdaccio.org/blog/2019/10/05/verdaccio-4-with-ldap-and-docker).\n\n## Config\n\nAdd to your `config.yaml`:\n\n```yaml\nauth:\n  ldap:\n    type: ldap\n    # Only required if you are fetching groups that do not have a \"cn\" property. defaults to \"cn\"\n    groupNameAttribute: \"ou\"\n    # Optional, default false.\n    cache:\n      # max credentials to cache (default to 100 if cache is enabled)\n      size: 100\n      # cache expiration in seconds (default to 300 if cache is enabled)\n      expire: 300\n    client_options:\n      url: \"ldap://ldap.example.com\"\n      # Only required if you need auth to bind\n      adminDn: \"cn=admin,dc=example,dc=com\"\n      adminPassword: \"admin\"\n      # Search base for users\n      searchBase: \"ou=People,dc=example,dc=com\"\n      searchFilter: \"(uid={{username}})\"\n      # If you are using groups, this is also needed\n      groupDnProperty: 'cn'\n      groupSearchBase: 'ou=groups,dc=myorg,dc=com'\n      # If you have memberOf support on your ldap\n      searchAttributes: ['*', 'memberOf']\n      # Else, if you don't (use one or the other):\n      # groupSearchFilter: '(memberUid={{dn}})'\n      # Optional\n      reconnect: true\n```\n\n### LDAP Admin Password\nIf you run this plugin in k8s, you may want to set password by env with secretRef.\nYou can use `LDAP_ADMIN_PASS` to set ldap admin password, it will override the one in `config.yaml`.\n\n## For plugin writers\n\nIt's called as:\n\n```js\nrequire('verdaccio-ldap')(config, stuff)\n```\n\nWhere:\n\n - config - module's own config\n - stuff - collection of different internal verdaccio objects\n   - stuff.config - main config\n   - stuff.logger - logger\n\nThis should export two functions:\n\n - `adduser(user, password, cb)`\n\n   It should respond with:\n    - `cb(err)` in case of an error (error will be returned to user)\n    - `cb(null, false)` in case registration is disabled (next auth plugin will be executed)\n    - `cb(null, true)` in case user registered successfully\n\n   It's useful to set `err.status` property to set http status code (e.g. `err.status = 403`).\n\n - `authenticate(user, password, cb)`\n\n   It should respond with:\n    - `cb(err)` in case of a fatal error (error will be returned to user, keep those rare)\n    - `cb(null, false)` in case user not authenticated (next auth plugin will be executed)\n    - `cb(null, [groups])` in case user is authenticated\n\n   Groups is an array of all users/usergroups this user has access to. You should probably include username itself here.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexandre-io%2Fverdaccio-ldap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlexandre-io%2Fverdaccio-ldap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexandre-io%2Fverdaccio-ldap/lists"}