Extension to allow dataset restriction via CKAN API.
Project description
CKAN Restricted API
Documentation: https://envidat.gitlab-pages.wsl.ch/ckanext-restricted_api/
Source Code: https://gitlabext.wsl.ch/EnviDat/ckanext-restricted_api
This plugin is primarily intended for custom frontends built on the CKAN API.
- Restrict the accessibility to the resources of a dataset.
- This way the package metadata is accesible but not the data itself (resource).
- The resource access restriction level can be individualy defined for every package.
Based on work by @espona (Lucia Espona Pernas) for ckanext-restricted (https://github.com/EnviDat/ckanext-restricted).
Granting Access
- Users can request access to a dataset by calling an API endpoint from a frontend.
- The package owner is emailed and can allow individual users to access the resource.
- If access is granted, the user will be notified by email.
Install
pip install ckanext-restricted-api
Config
Optional variables can be set in your ckan.ini:
TBC
- restricted_api.access_request_template
- Description: Path to access request template to render as html email.
- Default: uses default template.
- restricted_api.access_granted_template
- Description: Path to access granted template to render as html email.
- Default: uses default template.
Endpoints
TBC
POST
GET
Notes
All information inside the restricted fields (except 'level') is hidden for users other than the ones who can edit the dataset.
We used this to keep a shared-secret key field for accessing remotely hosted resources (https://github.com/EnviDat/ckanext-envidat_theme/blob/4265ecfe90e10eb1f095e8e8d19fe43554ab6799/ckanext/envidat_theme/helpers.py#L28).
The allowed usernames are hidden partially to the non-editors, in our case was critical because they were very similar to the user emails.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ckanext-restricted-api-0.0.0.tar.gz
.
File metadata
- Download URL: ckanext-restricted-api-0.0.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.8.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4273c81f79b3a5796640b0951aea467f57f41d811922248fae00cd71ddb0f35 |
|
MD5 | 2d93517e23dedb40c9f07f4dbe2f5197 |
|
BLAKE2b-256 | aefc265d981bd72d6f7f5154b907aa6a4eb5735364dbabfaadb5353d1767073d |
File details
Details for the file ckanext_restricted_api-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: ckanext_restricted_api-0.0.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.8.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f5cb2d145375d8da99e560af5d93bbd211dd8e18f44d27cacd2000a8e9da3ae |
|
MD5 | cb9aae6be50f82f71bb684838346e9e0 |
|
BLAKE2b-256 | 5cde6617848458656d4bd0119c91b82e5c6db8215447e91f7d6f01512af3b879 |