ckanext-drupal-idp


Nameckanext-drupal-idp JSON
Version 0.4.5 PyPI version JSON
download
home_pagehttps://github.com/DataShades/ckanext-drupal-idp
SummaryLogin to CKAN using Drupal session cookie
upload_time2023-01-26 09:32:56
maintainer
docs_urlNone
authorMotornyuk Sergey
requires_python
licenseAGPL
keywords ckan
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            [![Tests](https://github.com/DataShades/ckanext-drupal-idp/workflows/Tests/badge.svg?branch=main)](https://github.com/DataShades/ckanext-drupal-idp/actions)

# 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:

1. Activate your CKAN virtual environment, for example:

		. /usr/lib/ckan/default/bin/activate

2. 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 .

3. Add `drupal-idp` to the `ckan.plugins` setting in your CKAN
   config file (by default the config file is located at
   `/etc/ckan/default/ckan.ini`).

4. Configure Drupal's DB:

		ckanext.drupal_idp.db_url = <URL>

4. 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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DataShades/ckanext-drupal-idp",
    "name": "ckanext-drupal-idp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "CKAN",
    "author": "Motornyuk Sergey",
    "author_email": "sergey.motornyuk@linkdigital.com.au",
    "download_url": "https://files.pythonhosted.org/packages/c7/6a/62708c3b7ec5c4df86e2721abc0796dfbc47fa4e8a4d85edc69e811a6b31/ckanext-drupal-idp-0.4.5.tar.gz",
    "platform": null,
    "description": "[![Tests](https://github.com/DataShades/ckanext-drupal-idp/workflows/Tests/badge.svg?branch=main)](https://github.com/DataShades/ckanext-drupal-idp/actions)\n\n# ckanext-drupal-idp\n\nWhen 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.\n\n\n## Requirements\n\n* python >= 3.6\n* CKAN >= 2.9\n\n\n## Installation\n\nTo install ckanext-drupal-idp:\n\n1. Activate your CKAN virtual environment, for example:\n\n\t\t. /usr/lib/ckan/default/bin/activate\n\n2. Clone the source and install it on the virtualenv\n\n\t\tgit clone https://github.com/DataShades/ckanext-drupal-idp.git\n\t\tcd ckanext-drupal-idp\n\t\tpip install -e .\n\n3. Add `drupal-idp` to the `ckan.plugins` setting in your CKAN\n   config file (by default the config file is located at\n   `/etc/ckan/default/ckan.ini`).\n\n4. Configure Drupal's DB:\n\n\t\tckanext.drupal_idp.db_url = <URL>\n\n4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:\n\n\t\tsudo service apache2 reload\n\n\n## Config settings\n\n\t# ckanext-drupal-idp\n\t# Defines database used by the Drupal application\n\t# (mandatory).\n\tckanext.drupal_idp.db_url = mysql://drupal_user:drupal_pass@127.0.0.1:3306/db_name\n\n\t# Whether to make an attempt to synchronize user's details everytime\n\t# session is used. This may result in unauthenticated session if new name or email\n\t# already present in CKAN database\n\t# (optional, default: false).\n\tckanext.drupal_idp.synchronization.enabled = true\n\n\t# Configure hostname of the drupal instance statically. Usefull for local testing with\n\t# manually added cookie from any accessible drupal instance\n\t# (optional)\n\tckanext.drupal_idp.host = my.site.com\n\n\t# Whether to set sysadmin flag on the user who has Drupal's admin role\n\t# (optional, default: false)\n\tckanext.drupal_idp.admin_role.inherit = true\n\n\t# Name of the role that grants sysadmin status\n\t# (optional, default: administrator)\n\tckanext.drupal_idp.admin_role.name = administrator\n\n\t# When user created, set his ID to the same value as DrupalID\n\t# (optional, default: false)\n\tckanext.drupal_idp.same_id = true\n\n\t# Custom Drupal fields that shold be synchronized as well\n\t# (optional, default: [])\n    ckanext.drupal_idp.extra_fields = field_age field_xxx\n\n\t# Skip user identification during static requests(css/js)\n\t# (optional, default: false)\n    ckanext.drupal_idp.skip_static = yes\n\n## API actions\n\n#### `drupal_idp_user_show`\n\n##### Parameters:\n\n    id: (mandatory) DrupalID of the user\n\n##### Details:\n\nAccepts mandatory `id`(DrupalID). The rest of parameters will be\npassed to underlying `user_show`.\n\n---\n\n## Auth functions\n\n#### `drupal_idp_user_show`\n\n##### Details:\n\nChecks whether user is allowed to get user details by DrupalID. At the\nmoment only sysadmin can pass this check.\n\n---\n\n## CLI\n\n    * drupal-idp - ckanext-drupal-idp CLI\n      * user - User management\n        * list - List all users with DrupalID\n\n---\n\n## Developer installation\n\nTo install ckanext-drupal-idp for development, activate your CKAN virtualenv and\ndo:\n\n    git clone https://github.com/DataShades/ckanext-drupal-idp.git\n    cd ckanext-drupal-idp\n    python setup.py develop\n    pip install -r dev-requirements.txt\n\n\n## Tests\n\nTo run the tests, do:\n\n    pytest --ckan-ini=test.ini ckanext/drupal_idp\n",
    "bugtrack_url": null,
    "license": "AGPL",
    "summary": "Login to CKAN using Drupal session cookie",
    "version": "0.4.5",
    "split_keywords": [
        "ckan"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "336f6acd644056c9a36c88d6a57b3148ddc6c43ff86852207cc8d9debb200c23",
                "md5": "9c3fd4a879bcbb536cd61e4c27f1f5a0",
                "sha256": "556b51531c6a911f971e4b5b15dcf4bbac09a87e99570b73d2e06bc4abaa84fa"
            },
            "downloads": -1,
            "filename": "ckanext_drupal_idp-0.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c3fd4a879bcbb536cd61e4c27f1f5a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 28094,
            "upload_time": "2023-01-26T09:32:54",
            "upload_time_iso_8601": "2023-01-26T09:32:54.464351Z",
            "url": "https://files.pythonhosted.org/packages/33/6f/6acd644056c9a36c88d6a57b3148ddc6c43ff86852207cc8d9debb200c23/ckanext_drupal_idp-0.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c76a62708c3b7ec5c4df86e2721abc0796dfbc47fa4e8a4d85edc69e811a6b31",
                "md5": "1cdce6ed52a78563f02aca6c46c483dc",
                "sha256": "61d3bbfde8adc9cdef83365db1641f012741d4e72a8bc5020b4ae749eea3bb8c"
            },
            "downloads": -1,
            "filename": "ckanext-drupal-idp-0.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "1cdce6ed52a78563f02aca6c46c483dc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25689,
            "upload_time": "2023-01-26T09:32:56",
            "upload_time_iso_8601": "2023-01-26T09:32:56.571037Z",
            "url": "https://files.pythonhosted.org/packages/c7/6a/62708c3b7ec5c4df86e2721abc0796dfbc47fa4e8a4d85edc69e811a6b31/ckanext-drupal-idp-0.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-26 09:32:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "DataShades",
    "github_project": "ckanext-drupal-idp",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "ckanext-drupal-idp"
}
        
Elapsed time: 0.03360s