annotator.auth

annotator.auth.encode_token(token, secret)
annotator.auth.decode_token(token, secret='', ttl=86400, verify=True)
class annotator.auth.Authenticator(consumer_fetcher)

A wrapper around the low-level encode_token() and decode_token() that is backend inspecific, and swallows all possible exceptions thrown by badly- formatted, invalid, or malicious tokens.

request_user(request)

Retrieve the user object associated with the current request.

Arguments: request – a Flask Request object

Returns: a user object