{ "info": { "author": "CDH @ Princeton", "author_email": "digitalhumanities@princeton.edu", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: System :: Systems Administration :: Authentication/Directory", "Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP" ], "description": "django-pucas\n============\n\n.. image:: https://travis-ci.org/Princeton-CDH/django-pucas.svg?branch=master\n :target: https://travis-ci.org/Princeton-CDH/django-pucas\n :alt: Build status\n\n.. image:: https://codecov.io/gh/Princeton-CDH/django-pucas/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/Princeton-CDH/django-pucas\n :alt: Code Coverage\n\n.. image:: https://www.codefactor.io/repository/github/princeton-cdh/django-pucas/badge\n :target: https://www.codefactor.io/repository/github/princeton-cdh/django-pucas\n :alt: CodeFactor\n\n.. image:: https://requires.io/github/Princeton-CDH/django-pucas/requirements.svg?branch=master\n :target: https://requires.io/github/Princeton-CDH/django-pucas/requirements/?branch=master\n :alt: Requirements Status\n\n**django-pucas** is a reusable `Django`_ application to simplify logging\ninto a Django application with CAS using `django-cas-ng`_. Login and\ncreation of user accounts is handled by django-cas-ng; pucas adds\nsupport for prepopulating user account data based on an LDAP search.\n\n*pucas* should be pronounced like *pookas* for the Celtic spirit creature.\n\n.. _Django: https://www.djangoproject.com/\n.. _django-cas-ng: https://github.com/mingchen/django-cas-ng\n\n**django-pucas** is tested under:\n\n* Django ``1.8-2.2``\n* Python ``2.7, 3.5-3.7`` (excluding ``2.7`` for Django ``2+``)\n\n**django-pucas** requires **django-cas-ng** 3.6 or greater.\n\nInstallation\n------------\n\nUse pip to install::\n\n pip install pucas\n\nYou can also install from Github. Use ``@master`` or ``@0.5`` to install a\nspecific tagged release or branch (e.g., for the lastest code on ``develop``)::\n\n pip install git+https://github.com/Princeton-CDH/django-pucas.git@develop#egg=pucas\n\nConfiguration\n-------------\n\nAdd both django-cas-ng and pucas to installed apps; enable authentication\nmiddleware and django-cas-ng authentication backend::\n\n INSTALLED_APPS = (\n ...\n 'django_cas_ng',\n 'pucas',\n ...\n )\n\n MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n ...\n )\n\n AUTHENTICATION_BACKENDS = (\n 'django.contrib.auth.backends.ModelBackend',\n 'django_cas_ng.backends.CASBackend',\n )\n\n\nInclude the default django-cas-ng login and logout urls provided with pucas,\nor configure them as needed based on the documentation::\n\n\n urlpatterns = [\n ...\n url(r'^accounts/', include('pucas.cas_urls')),\n ...\n ]\n\nAdd required configurations to ``settings.py``:\n\n* **CAS_SERVER_URL** - Base URL of your CAS source\n\n* Configure LDAP settings as needed to populate user attributes::\n\n PUCAS_LDAP = {\n 'SERVERS': ['ldap1', 'ldap2'],\n 'SEARCH_BASE': 'ou=users,dc=example,dc=com',\n 'SEARCH_FILTER': \"(uid=%(user)s)\",\n # attributes to request from the LDAP server\n 'ATTRIBUTES': ['givenName', 'sn', 'mail'],\n # mapping of User attributes to LDAP attributes\n # if passed list for the value, the first attribute to return a\n # value will be used\n 'ATTRIBUTE_MAP': {\n 'first_name': 'givenName',\n 'last_name': 'sn',\n 'email': ['mail', 'eduPersonPrincipalName']\n },\n # Optional local method to do additional user initialization\n # not handled by attribute map. Method should take a user\n # object and ldap search result.\n 'EXTRA_USER_INIT': 'myproj.myapp.models.init_profile_from_ldap'\n 'BASE_DN': 'uid=username,o=your org,c=country_code',\n 'BASE_PASSWORD': 'secreupasswordforyourldap',\n }\n\n* Note: ``BASE_DN`` and ``BASE_PASSWORD`` are optional if you want\n to bind anonymously. Add them if they are required by your LDAP.\n This supports user/pass authentication.\n\nRun migrations to create database tables required by django-cas-ng::\n\n python manage.py migrate\n\nTo make CAS login available on the Django admin login form, extend the\ndefault admin login form and include or adapt the provided CAS login\ntemplate snippet. An example admin login form is included at\n``pucas/templates/pucas/sample-admin-login.html``; copy this to\n``admin/login.html`` within a valid template directory and modify\nas needed.\n\nAn example of a login template with local branding is provided at\n``pucas/templates/pucas/sample-pu-login.html`` using re-usable template\nsnippets that can be adapted or re-used as appropriate.\n\nFor Django 1.8, you will need to override ``admin/login.html`` as a whole, as\nextending the login template with itself causes a recursion error.\n\nUsage\n-----\n\nUsers can login with CAS and have a Django user account automatically\ncreated and populated with LDAP data based on the settings.\n\nTwo manage commands are provided, for convenience.\n\n* Use ``python manage.py ldapsearch netid1 netid2 netid3`` for testing\n your LDAP configuration and attributes.\n* Use ``python manage.py createcasuser netid`` to initialize a new\n CAS account and populate data from LDAP without requiring the user\n to login first, as an aid to managing accounts and permissions.\n The optional flag ``--admin`` will give the new account superuser\n permissions\n\nDevelopment instructions\n------------------------\n\nThis git repository uses git flow branching conventions.\n\nInitial setup and installation:\n\n- recommended: create and activate a python 3.5 virtualenv::\n\n virtualenv pucas -p python3.5\n source pucas/bin/activate\n\n- pip install the package with its python dependencies::\n\n pip install -e .\n\n\nUnit Testing\n^^^^^^^^^^^^^\n\nUnit tests are written with [py.test](http://doc.pytest.org/) but use some\nDjango test classes for compatibility with django test suites. Running\nthe tests requires a minimal settings file for Django required configurations.\n\n- Copy sample test settings and add a secret key::\n\n cp ci/testsettings.py.sample testsettings.py\n\n- To run the tests, either use the configured setup.py test command::\n\n python setup.py test\n\n- Or install test requirements and use py.test directly::\n\n pip install -e '.[test]'\n py.test\n\n\nLicense\n-------\n\n**django-pucas** is distributed under the Apache 2.0 License.\n\n\n\u00a92016 Trustees of Princeton University. Permission granted via\nPrinceton Docket #18-3398-1 for distribution online under a standard Open Source\nlicense. Ownership rights transferred to Rebecca Koeser provided software\nis distributed online via open source.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Princeton-CDH/django-pucas", "keywords": "", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "pucas", "package_url": "https://pypi.org/project/pucas/", "platform": "", "project_url": "https://pypi.org/project/pucas/", "project_urls": { "Homepage": "https://github.com/Princeton-CDH/django-pucas" }, "release_url": "https://pypi.org/project/pucas/0.6.0/", "requires_dist": [ "django (>=1.8)", "django-cas-ng (>=3.6)", "ldap3", "pytest ; extra == 'test'", "pytest-django ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": "", "summary": "Django app to login with CAS and populate user accounts with LDAP.", "version": "0.6.0" }, "last_serial": 5820266, "releases": { "0.5.1": [ { "comment_text": "", "digests": { "md5": "9427cf87fd2fc0a2b6fe1803b49674ae", "sha256": "c5ccec24c0d8070b84be2dd4664363f70def14d9872a908626d672fc504f6a5e" }, "downloads": -1, "filename": "pucas-0.5.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9427cf87fd2fc0a2b6fe1803b49674ae", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17197, "upload_time": "2017-07-27T20:52:14", "url": "https://files.pythonhosted.org/packages/9c/01/4234ca69b17e8425c05f6d386bdd7f199da13f1775f45f699c270943406a/pucas-0.5.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc5775d57a677298c2f148f3dc841b28", "sha256": "c792857bf3a3e318d04bd947911d70522d6198c2ed043c6d49ef468e671d4c3d" }, "downloads": -1, "filename": "pucas-0.5.1.tar.gz", "has_sig": false, "md5_digest": "bc5775d57a677298c2f148f3dc841b28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17057, "upload_time": "2017-07-27T20:52:10", "url": "https://files.pythonhosted.org/packages/38/22/41ec4c20943cf2a6594afe90f2d75a9acf52f026370a09071d63e01feb78/pucas-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "f6acc08f2bb03f8fef63adedb1ad195e", "sha256": "737c0fd05b76e46a9c0a88ed072393f40fe65a2df544b694cf80de557f946578" }, "downloads": -1, "filename": "pucas-0.5.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f6acc08f2bb03f8fef63adedb1ad195e", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17550, "upload_time": "2018-03-08T22:33:39", "url": "https://files.pythonhosted.org/packages/09/37/56ac83d5fe453c369d0d5f71a7a4fb47e5d6cec0dff8dc02fcddebb450a2/pucas-0.5.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a14918aa2b00d8373ed9da80b049309", "sha256": "eb8e0bafb5bef9276b7be83f1c6bdbeaad45212ed19920de4263c2ec02bcef04" }, "downloads": -1, "filename": "pucas-0.5.2.tar.gz", "has_sig": false, "md5_digest": "7a14918aa2b00d8373ed9da80b049309", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17429, "upload_time": "2018-03-08T22:33:36", "url": "https://files.pythonhosted.org/packages/db/d6/6f44604df7d25f93e6e48ad3e68f09361372d856216f4334ac88e90ec8c0/pucas-0.5.2.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "7ef9c1a556e59a92ba666514a204fe12", "sha256": "f3bf170ce387bf934d8b74da46e59db4baee6d6622ec28cc4eaecfac79ebf6fc" }, "downloads": -1, "filename": "pucas-0.6.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7ef9c1a556e59a92ba666514a204fe12", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19106, "upload_time": "2019-08-06T13:42:44", "url": "https://files.pythonhosted.org/packages/4d/3f/59b40bae23de10b88b3af48b232710ad72d72b93b923c57a91fa259454be/pucas-0.6.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cfa2a8acd1b539fb3f6d43ab69370890", "sha256": "fc52fe57893a2b8a366d08a955f887d3fbe9f593c6dd655551af49173218fe31" }, "downloads": -1, "filename": "pucas-0.6.0.tar.gz", "has_sig": false, "md5_digest": "cfa2a8acd1b539fb3f6d43ab69370890", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15962, "upload_time": "2019-08-06T13:42:46", "url": "https://files.pythonhosted.org/packages/eb/39/2249b0a33688365a3f8034c6e73ba4aaaf1888cf8fef280754284f490f53/pucas-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ef9c1a556e59a92ba666514a204fe12", "sha256": "f3bf170ce387bf934d8b74da46e59db4baee6d6622ec28cc4eaecfac79ebf6fc" }, "downloads": -1, "filename": "pucas-0.6.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7ef9c1a556e59a92ba666514a204fe12", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19106, "upload_time": "2019-08-06T13:42:44", "url": "https://files.pythonhosted.org/packages/4d/3f/59b40bae23de10b88b3af48b232710ad72d72b93b923c57a91fa259454be/pucas-0.6.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cfa2a8acd1b539fb3f6d43ab69370890", "sha256": "fc52fe57893a2b8a366d08a955f887d3fbe9f593c6dd655551af49173218fe31" }, "downloads": -1, "filename": "pucas-0.6.0.tar.gz", "has_sig": false, "md5_digest": "cfa2a8acd1b539fb3f6d43ab69370890", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15962, "upload_time": "2019-08-06T13:42:46", "url": "https://files.pythonhosted.org/packages/eb/39/2249b0a33688365a3f8034c6e73ba4aaaf1888cf8fef280754284f490f53/pucas-0.6.0.tar.gz" } ] }