Identifier plugin for repoze.who with beaker.session cache implementation
Project description
repoze.who-use_beaker is a repoze.who identifier plugin. It is aimed at replacing repoze.who.plugins.auth_tkt in order to store the user data in beaker session.
The plugin stores a dictionary containing at least {‘repoze.who.userid’: userid} under key repoze.who.tkt.
UseBeakerPlugin takes the following parameters:
key_name (default: repoze.who.tkt) - the key name to store the userid under:
>>> userid = session['repoze.who.tkt']
session_name (default: beaker.session) - the key name of the beaker session in the WSGI environment:
>>> session = environ['beaker.session']
delete_on_logout (default: false) - if false then on logout session['repoze.who.tkt'] is erased but the other session data stays and will be reused during the next session. If you want the session to be invalidated pass delete_on_logout = True
alsopersist (default: [‘userdata’]) - a sequence of item keys that are persisted along to repoze.who.userid
Usually you should use make_plugin method instead of instantiating UseBeakerPlugin directly:
>>> from repoze.who.plugins.use_beaker import make_plugin >>> plugin = make_plugin(**kw)
In order to properly use the beaker.session repoze.who (with repoze.who-use_beaker) has to be placed lower in the WSGI stack. Usually this means that you have to define repoze.who in your framework’s middleware configuration higher than beaker session. E.g. (using the factory from repoze.what-quickstart):
>>> from beaker.middleware import SessionMiddleware >>> from repoze.what.plugins.quickstart import setup_sql_auth >>> from repoze.who.plugins.use_beaker import make_plugin as make_beaker_plugin ... # app definition here >>> app = setup_sql_auth(app, ... User, Group, Permission, DBSession, ... # HERE we provide the beaker plugin to be used as the primary identifier ... identifiers=[('use_beaker', make_beaker_plugin())], ... form_plugin=... # The rest of repoze configuration ... # more middlewares here >>> app = SessionMiddleware(app, config)
Git repository is located at GitHub.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file repoze.who-use_beaker-0.3.zip
.
File metadata
- Download URL: repoze.who-use_beaker-0.3.zip
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b88b86fab145025247768aa1fa05c76855ad439366b569d083f99ce3a01815d6 |
|
MD5 | bf4723bdc4cda6c2c4a0d6dc93c97552 |
|
BLAKE2b-256 | b14ab04b34fd29ec21a63e07951e152f57b77da875b0c28ca39e6feaa1be07e6 |
File details
Details for the file repoze.who-use_beaker-0.3.tar.gz
.
File metadata
- Download URL: repoze.who-use_beaker-0.3.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 368474bac3728f30a960cf067a73fe9424f4ced9aec47038b17db13c544d8bb0 |
|
MD5 | 55e552db94c4779c1b2c584a3bd3e73b |
|
BLAKE2b-256 | 635bee3f3503be6378e722f9b2d74b867a04c4f39571c4ca4bd1904233cc3919 |
File details
Details for the file repoze.who_use_beaker-0.3-py2.6.egg
.
File metadata
- Download URL: repoze.who_use_beaker-0.3-py2.6.egg
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc77a6777375653b3b8e40a8ff8666a6e4f6dd09081507d34d469a7f107b057c |
|
MD5 | cf9fde7fe1e50b586d479be80adc0b53 |
|
BLAKE2b-256 | 986703b7d6ceb7a2b156a25e0f771f6d16faec37e6cc483edbb2878a066cf3bb |
File details
Details for the file repoze.who_use_beaker-0.3-py2.5.egg
.
File metadata
- Download URL: repoze.who_use_beaker-0.3-py2.5.egg
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbbf72eb12ecb17c194f2268005c37f05818944dc0b11e815baa007715301d8c |
|
MD5 | 20c45ee07119427a7353c3f853198598 |
|
BLAKE2b-256 | f06b9dbfd6e1bc850fd4e4d2cc92ba1181b15f3efb9d1a4de1a17babf900a436 |