Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (15 sloc) 0.488 kB
import uuid
__all__ = ['TokenGenerator', 'UUIDTokenGenerator']
class TokenGenerator(object):
"""\
A token generator which returns the key passed to it.
"""
def create_token(self, key):
return key
class UUIDTokenGenerator(TokenGenerator):
"""\
A token generator which returns a UUID4 (random) token.
See https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29
"""
def create_token(self, key):
return str(uuid.uuid4())
Jump to Line
Something went wrong with that request. Please try again.