通过AAF快速连接进行身份验证
ckanext-aaf的Python项目详细描述
ckanext aaf
允许AAF(澳大利亚访问联合会)身份验证登录到CKAN安装。
要求
测试与ckan 2.5.1,应该是相当容易跨版本的端口,因为代码库是相当小-公关的欢迎! 需要设置AAF“快速连接”应用程序(请参见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例如,如果您在Ubuntu上使用Apache部署了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 virtualenv并 做:
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
要运行测试并生成覆盖率报告,首先确保 在virtualenv(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在PyPI上可用作https://pypi.python.org/pypi/ckanext-aaf。 要将新版本发布到pypi,请执行以下步骤:
更新setup.py文件中的版本号。 见PEP 440 如何选择版本号。
创建新版本的源发行版:
python setup.py sdist
将源分发上载到pypi:
python setup.py sdist upload
在github上标记项目的新版本,版本号为 setup.py文件。例如,setup.py中的版本号是 0.0.2然后:
git tag -a 0.0.2 git push --tags