Skip to main content

Extension to allow dataset restriction via CKAN API.

Project description

CKAN Restricted API

Extension to allow dataset restriction via CKAN 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

  1. Users can request access to a dataset by calling an API endpoint from a frontend.
  2. The package owner is emailed and can allow individual users to access the resource.
  3. 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext-restricted-api-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

ckanext_restricted_api-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-restricted-api-0.1.0.tar.gz.

File metadata

File hashes

Hashes for ckanext-restricted-api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36a6d365fa7e6e3aa5fc17927ccacfd5a975d97b0a9b9747ed35b5be7c03b138
MD5 3eca62a7e205441e21feb2a54df1d4ab
BLAKE2b-256 cad212e6e5ef00fc352f616e656a6383c5c5a5ecd7ddfa09ece2d49770deab5d

See more details on using hashes here.

File details

Details for the file ckanext_restricted_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_restricted_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e17fc30375c53df5a1c842393fbd5e385649500a92eea5d7fda872655f8def41
MD5 cdb37bf39df551ec8ff00cc06ec091a4
BLAKE2b-256 acfbe62896408df0ff5a20da75d40eb30ab45fac4d71c15b2e6f80d51b159fc5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page