This plugin enables login into CKAN through GitLab. It was developed in the context of CoyPu.
- CKAN 2.9
To install ckanext-logingitlab:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-logingitlab Python package into your virtual environment:
pip install ckanext-logingitlab
Add
logingitlabto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini).Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
logingitlab.consumer_key: The consumer key, requiredlogingitlab.consumer_secret: The consumer's secret, requiredlogingitlab.base_url: The base URL for the log in, optional, default:https://gitlab.com/api/v4/logingitlab.access_token_url: The URL for retrieving access tokens, optional, default:https://gitlab.com/oauth/tokenlogingitlab.authorize_url: The URL for authorizing the user, optional, default:https://gitlab.com/oauth/authorizelogingitlab.scope: The OAuth2 scope, optional, default:read_user
To install ckanext-logingitlab for development, activate your CKAN virtualenv and do:
git clone https://github.com/SDM-TIB/ckanext-logingitlab.git cd ckanext-logingitlab pip install -e . pip install -r dev-requirements.txt
To run the tests, do:
pytest --ckan-ini=test.ini
To run the tests and produce a coverage report, first make sure you have
pytest-cov installed in your virtualenv (pip install pytest-cov) then run:
pytest --ckan-ini=test.ini --cov=ckanext.logingitlab