Skip to main content

Usage

import morepath
from more.itsdangerous import IdentityPolicy

class App(morepath.App):
    pass

@App.identity_policy()
def get_identity_policy():
    return IdentityPolicy()

@App.verify_identity()
def verify_identity(identity):
    # trust the identity established by the identity policy (we could keep
    # checking if the user is really in the database here - or if it was
    # removed in the meantime)
    return True

See http://morepath.readthedocs.org/en/latest/security.html to learn more about Morepath’s security model and and have a look at the commented source code:

https://github.com/morepath/more.itsdangerous/blob/master/more/itsdangerous/identity_policy.py

The IdentityPolicy class is meant to be extended because everyone has differing needs. It simply provides a way to store the identity as a signed cookie, using itsdangerous.

Usage in Development

By default, the cookies created by more.itsdangerous are HttpOnly and Secure.

If you have differing needs or if you are running a development server you might have to change the identity policy’s configuration:

@App.identity_policy()
def get_identity_policy():
    # make the cookies work under http, not just https
    return IdentityPolicy(secure=False)

Note that this should only be used in development. In this day and age you do not want to transmit cookies over http!

Run the Tests

Install tox and run it:

pip install tox
tox

Limit the tests to a specific python version:

tox -e py27

Conventions

More Itsdangerous follows PEP8 as close as possible. To test for it run:

tox -e pep8

More Itsdangerous uses Semantic Versioning

Build Status

Build Status

Coverage

Project Coverage

Latests PyPI Release

Latest PyPI Release

License

more.itsdangerous is released under the revised BSD license

Changelog

0.0.2 (2016-04-18)

  • Adds compatibility with Morepath 0.14+. [henri-hulski]

0.0.1 (2015-04-29)

  • Initial release [href]

Metadata

Release files for more.itsdangerous 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for more.itsdangerous 0.0.2
File Size Uploaded
more.itsdangerous-0.0.2.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for more.itsdangerous 0.0.2
File Interpreter ABI Platform
more.itsdangerous-0.0.2-py2-none-any.whl Python 2 none any Details

Total release size: 14.4 kB

Release files / more.itsdangerous-0.0.2.tar.gz

Download URL more.itsdangerous-0.0.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c0352ec418cb5f356261d88c600c18f7d7627895d357fe2f933fe643e42ba0f2
BLAKE2b-256 checksum
How to use checksums
5622a423e8d148b628cf62f8bc8ec63ffdbda62258783e68c743c987321e68f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / more.itsdangerous-0.0.2-py2-none-any.whl

Download URL more.itsdangerous-0.0.2-py2-none-any.whl
Size 8.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
711867e2e480cce7c1cf8a4053a295a005f7c8ed6f58cf0957ed2caf3fbf28d1
BLAKE2b-256 checksum
How to use checksums
fad236db86cdd047a31d85b84b4b73ca488be3c220b60d7d870437856f875a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page