https://github.com/wwoods/lamegame_cherrypy_authority
Authentication and authorization framework for CherryPy
https://github.com/wwoods/lamegame_cherrypy_authority
Last synced: 3 months ago
JSON representation
Authentication and authorization framework for CherryPy
- Host: GitHub
- URL: https://github.com/wwoods/lamegame_cherrypy_authority
- Owner: wwoods
- Created: 2010-10-25T19:28:11.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2012-08-03T17:04:58.000Z (about 13 years ago)
- Last Synced: 2024-04-14T14:59:00.294Z (over 1 year ago)
- Language: Python
- Homepage: http://tools.cherrypy.org/wiki/LgAuthority
- Size: 354 KB
- Stars: 10
- Watchers: 9
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
lg_authority - A general purpose, multi-backend capable authentication and permissions framework for CherryPy.
=================================================Dependencies
============
Required:
cherrypyOptional:
pymongo - For MongoDB backend
python-openid - For Open ID supportInstallation
============
1. git clone git://github.com/wwoods/lamegame_cherrypy_authority.git
2. cd lamegame_cherrypy_authority
3. sudo python setup.py install (or python setup.py install --user to install without sudo)Example Usage (just want to block out non-logged-in users)
==========================================================
import cherrypy
import lg_authority@lg_authority.groups('auth')
class Root(object):
auth = lg_authority.AuthRoot()@cherrypy.expose
def index(self):
return "Logged in!"cherrypy.config.update({
'tools.lg_authority.on': True,
# Uncomment the following two lines to persist changed user / group data
# 'tools.lg_authority.site_storage': 'sqlite3',
# 'tools.lg_authority.site_storage_conf': { 'file': 'test.db' } })
cherrypy.quickstart(Root())Storage Options
===============The different storage options are laid out in lg_authority/slates/storage. Currently, there are the following and their options:
ram - Store session and user data in memory only; it will get erased when the
server restarts, and does not support coordination between different
instances.
Options: No options.sqlite3 - Store session in a sqlite3 file database. Data is persisted through
the file.
Options: file - The file to store session and user information in.pymongo - Store session information in a mongodb backend.
Options:
host - The host address of the mongodb server to connect to
port - The port
db - The name of the mongodb database to store auth collections in
collection_base - An optional prefix for all of the collections created
and maintained by lg_authority.OpenID
======Being an openID server
======================
If python-openid is installed, then there is an OpenID endpoint set up automatically at (authroot)/openid. If you would like your site root to be an open ID endpoint, put the following meta tag in the index page (e.g. http://www.lamegameproductions.com):Replace www.lamegameproductions.com/auth with your auth root. It is probably wise to ensure that the xrds location is accessed through https.
Users may also use the /auth/openid URL as an endpoint, even if you don't put that meta tag on your root.