跳转到主要内容

未提供项目描述

项目描述

Tests

ckanext-vip-portal

为匿名用户提供通用访问限制。

配置匿名用户可访问的集合或端点/URL,如果尝试访问未经白名单的页面,则重定向到登录页面。

需求

与核心CKAN版本的兼容性

CKAN版本 兼容?
2.9
2.10
2.11(master)

安装

要安装 ckanext-vip-portal

  1. 使用pip进行安装

    pip install ckanext-vip-portal
    
  2. vip_portal 添加到您的CKAN配置文件中的 ckan.plugins 设置。

配置设置

# Configure endpoint that handles unauthorized page access
# (optional, default: user.login)
ckanext.vip_portal.login_endpoint = auth_ext.login

# Allow anonymous access to all the pages. It basically disables current
# extensions
# (optional, default: false)
ckanext.vip_portal.free_anonymous_access = true

# Allow any authenticated user to visit pages normally
# (optional, default: true)
ckanext.vip_portal.free_authenticated_access = false

# Unless endpoint is blocked by one of IVipAccess implementations, it can be
# accessed by anyone. Use it in combination with IVipPortal interface if you
# want to leave the portal generally open and block only certain endpoints
# (optional, default: false)
ckanext.vip_portal.free_access_by_default = true

# Allow anonymous access to login pages
# (optional, default: true)
ckanext.vip_portal.allow_login = false

# Allow anonymous access to password reset page
# (optional, default: true)
ckanext.vip_portal.allow_password_reset = false

# Allow anonymous access to registration pages
# (optional, default: true)
ckanext.vip_portal.allow_registration = false

# Allow anonymous access to API endpoints
# (optional, default: true)
ckanext.vip_portal.allow_api = false

# Additional endpoints that are accessible by anonymous user
# (optional, default: )
ckanext.vip_portal.extra_allowed_endpoints = home.index home.about dataset.search

# Additional paths(URLs) that are accessible by anonymous user
# (optional, default: )
ckanext.vip_portal.extra_allowed_paths = / /about /dataset

# Allow anonymous user to access any path that starts with the following
# prefixes
# (optional, default: )
ckanext.vip_portal.extra_allowed_prefixes = /dataset /organization /group /static

# Allow anonymous user to access any path that ends with the following
# suffixes
# (optional, default: )
ckanext.vip_portal.extra_allowed_suffixes = .svg .html .css

# Allows to customize the route that the user will get redirected to
# after a successful login. Empty value allow user to be redirected to the page 
# requested before displaying login page
# (optional, default: )
ckan.auth.route_after_login = dataset.search

开发者安装

要为开发安装 ckanext-vip-portal,请激活您的CKAN虚拟环境并执行以下操作:

git clone https://github.com/DataShades/ckanext-vip-portal.git
cd ckanext-vip-portal
pip install -e '.[dev]'

许可协议

AGPL

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分发

ckanext-vip-portal-0.2.4.tar.gz (20.7 kB 查看哈希值)

上传时间: 源代码

构建分发版

ckanext_vip_portal-0.2.4-py3-none-any.whl (21.4 kB 查看哈希值)

上传时间: Python 3

支持者