通过AAF Rapid Connect进行身份验证
项目描述
ckanext-aaf
允许通过AAF(澳大利亚访问联盟)进行身份验证以登录CKAN安装。
需求
在CKAN 2.5.1上进行了测试,应该很容易在不同版本之间移植,因为代码库相当小 - 欢迎PR!需要一个已设置的AAF‘Rapid Conect’应用程序(请参阅https://rapid.aaf.edu.au/或https://rapid.test.aaf.edu.au/)对于现场安装,需要SSL(因为AAF不允许回调到非SSL URL)
安装
要安装ckanext-aaf
激活您的CKAN虚拟环境,例如
. /usr/lib/ckan/default/bin/activate
将ckanext-aaf Python包安装到您的虚拟环境中
pip install ckanext-aaf
将aaf添加到您的CKAN配置文件中的ckan.plugins设置(默认情况下,配置文件位于/etc/ckan/default/production.ini)。
设置配置设置(以下将描述),这些设置是解码AAF返回的JWT令牌所必需的。
重启CKAN。例如,如果您已使用Apache在Ubuntu上部署CKAN
sudo service apache2 reload
配置设置
以下设置是必需的(以下设置将无法正常工作,请注册您自己的应用程序!)
# The unique URL given by AAF Rapid Connect (get one from rapid.aaf.edu.au or rapid.test.aaf.edu.au) ckanext.aaf.url = https://rapid.aaf.edu.au/jwt/authnrequest/research/xxxxyyyzzzz # The secret used to set up the above URL ckanext.aaf.secret = asdfasdf#$#$#$asdfasdf # The URL of your application, as provided to Rapid Connect (doesn't have to match the callback URL) # Note this must match *exactly* what was provided to Rapid Connect - check the trailing slash! ckanext.aaf.aud = http://myappurl.edu.au
以下设置是可选的
# Enables use of aaf's test rapid connect service https://rapid.test.aaf.edu.au # (defaults to using the live one https://rapid.aaf.edu.au ) ckanext.aaf.debug = False # Allows overriding of 'ckan.auth.create_user_via_web' so that AAF users can be # created even if normal registrations are disabled. Defaults to False ckanext.aaf.allow_creation_always = False
开发安装
要开发安装ckanext-aaf,激活您的CKAN虚拟环境并执行以下操作
git clone https://github.com/Psykar/ckanext-aaf.git cd ckanext-aaf pip install -e . pip install -r dev-requirements.txt
运行测试
要运行测试,请执行以下操作
nosetests --nologcapture --with-pylons=test.ini
要运行测试并生成覆盖率报告,首先请确保您在虚拟环境中安装了覆盖率(pip install coverage),然后运行
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.aaf --cover-inclusive --cover-erase --cover-tests
发布 ckanext-aaf 的新版本
ckanext-aaf 作为 https://pypi.python.org/pypi/ckanext-aaf 在 PyPI 上可用。要将新版本发布到 PyPI,请按照以下步骤操作
在 setup.py 文件中更新版本号。有关如何选择版本号的说明,请参阅 PEP 440。
创建新版本的源分布
python setup.py sdist
将源分布上传到 PyPI
python setup.py sdist upload
使用 setup.py 文件中的版本号在 GitHub 上标记项目的最新发布。例如,如果 setup.py 中的版本号为 0.0.2,则执行以下操作
git tag -a 0.0.2 git push --tags
项目详情
ckanext-aaf-0.0.8.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0bb45e60375b4745c93d6813bc9085dc423eedd70d5e49e13e6bfbac76ba3da5 |
|
MD5 | 5eaffa2d6e2a3f1592d66d8966ae4bfe |
|
BLAKE2b-256 | f18f19570113021da01720a63817551c649d909e40d47227ca02f7f4262539b0 |