A LDAP authentication plugin for Conan.io
- Authenticate to Conan server, through your LDAP server
- Customize host address, port and DN
$ pip install conan_ldap_authentication
Or you can clone this repository and store its location in PYTHONPATH.
The plugin uses HOME directory as reference to be installed.
Keep in mind if you are running as root or admin when install the plugin.
If you are root, the file is available there /root/.conan_server
The motivation is because Conan server could be executed by any user on your system.
Each user have it own .conan_server directory.
To configure the LDAP authentication in Conan, you need follow two steps:
- Add custom authenticator in ~/.conan_server/server.conf
[server]
jwt_secret: ****
jwt_expire_minutes: 120
ssl_enabled: False
port: 9300
public_port:
host_name: localhost
# Check docs.conan.io to implement a different authenticator plugin for conan_server
# if custom_authenticator is not specified, [users] section will be used to authenticate
# the users.
#
custom_authenticator: ldap_authentication
[write_permissions]
# "opencv/2.3.4@lasote/testing": default_user,default_user2
[read_permissions]
# opencv/1.2.3@lasote/testing: default_user default_user2
# By default all users can read all blocks
*/*@*/*: *
[users]
demo: demo
- Configure you LDAP server information in ~/.conan_server/ldap_authentication.conf
[ldap]
# LDAP server address
host: ldap://ldap.company.org
# Distinguished name (DN) of the entry
distinguished_name: cn=$username,ou=Users,dc=company,dc=org
You could customize ldap_authentication.conf path, by CONAN_LDAP_AUTHENTICATION_CONFIG_FILE
$ export CONAN_LDAP_AUTHENTICATION_CONFIG_FILE=/etc/conan/cofig/ldap_authentication.conf
To obtain more information, how to use a custom authentication in Conan.io, read the Authentication section
Just call conan authentication, as before
$ conan user -p my_ldap_password my_ldap_username
Conan will use your username and password to authenticate to registered LDAP server.
To run all unit tests:
$ nosetests -v --with-coverage --cover-package=conan .
The package pyLDAP needs a bunch of packages installed, without these packages, the installation will fail.
- python-dev
- libldap2-dev
- libsasl2-dev
- libssl-dev
If you want to run Conan server with LDAP support on Docker, you can try to Docker recipe on this repository:
docker build -t conanio/conan_server_ldap .
docker run conanio/conan_server_ldap