ckanext-drupal-idp
When Drupal's session cookie is available use it for user authentication. Create missing users, using data from Drupal's DB and synchronize(conditionally) fields when user details changed on Drupal's side.
Requirements
- python >= 3.6
- CKAN >= 2.9
Installation
To install ckanext-drupal-idp:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate -
Clone the source and install it on the virtualenv
git clone https://github.com/DataShades/ckanext-drupal-idp.git cd ckanext-drupal-idp pip install -e . -
Add
drupal-idpto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
Configure Drupal's DB:
ckanext.drupal_idp.db_url = <URL> -
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config settings
# ckanext-drupal-idp
# Defines database used by the Drupal application
# (mandatory).
ckanext.drupal_idp.db_url = mysql://drupal_user:drupal_pass@127.0.0.1:3306/db_name
# Whether to make an attempt to synchronize user's details everytime
# session is used. This may result in unauthenticated session if new name or email
# already present in CKAN database
# (optional, default: false).
ckanext.drupal_idp.synchronization.enabled = true
# Configure hostname of the drupal instance statically. Usefull for local testing with
# manually added cookie from any accessible drupal instance
# (optional)
ckanext.drupal_idp.host = my.site.com
# Whether to set sysadmin flag on the user who has Drupal's admin role
# (optional, default: false)
ckanext.drupal_idp.admin_role.inherit = true
# Name of the role that grants sysadmin status
# (optional, default: administrator)
ckanext.drupal_idp.admin_role.name = administrator
# When user created, set his ID to the same value as DrupalID
# (optional, default: false)
ckanext.drupal_idp.same_id = true
# Custom Drupal fields that shold be synchronized as well
# (optional, default: [])
ckanext.drupal_idp.extra_fields = field_age field_xxx
# Skip user identification during static requests(css/js)
# (optional, default: false)
ckanext.drupal_idp.skip_static = yes
API actions
drupal_idp_user_show
Parameters:
id: (mandatory) DrupalID of the user
Details:
Accepts mandatory id(DrupalID). The rest of parameters will be
passed to underlying user_show.
Auth functions
drupal_idp_user_show
Details:
Checks whether user is allowed to get user details by DrupalID. At the moment only sysadmin can pass this check.
CLI
* drupal-idp - ckanext-drupal-idp CLI
* user - User management
* list - List all users with DrupalID
Developer installation
To install ckanext-drupal-idp for development, activate your CKAN virtualenv and do:
git clone https://github.com/DataShades/ckanext-drupal-idp.git
cd ckanext-drupal-idp
python setup.py develop
pip install -r dev-requirements.txt
Tests
To run the tests, do:
pytest --ckan-ini=test.ini ckanext/drupal_idp
Metadata
Release files for ckanext-drupal-idp 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ckanext_drupal_idp-0.5.2.tar.gz | 16.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ckanext_drupal_idp-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / ckanext_drupal_idp-0.5.2.tar.gz
| Download URL | ckanext_drupal_idp-0.5.2.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b51d24e4c8cc7e28bdfe00e822cf3f7608c157298b49af9a2dec183405d02d0
|
|
BLAKE2b-256 checksum How to use checksums |
84720baa7de758bd9c1a41231f3a7070440f707cca363cf7664bed26f37ce008
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / ckanext_drupal_idp-0.5.2-py3-none-any.whl
| Download URL | ckanext_drupal_idp-0.5.2-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18f0bed7a3a6dab816022a2c1602a721860f6b930af93fc4618613a85e0efcc5
|
|
BLAKE2b-256 checksum How to use checksums |
a2a2e72a302d03c1bf1a380d86670de0e06110b8d3ed98f05d5140c4c6aa7968
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for ckanext-drupal-idp 0.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.