Tokens¶
-
class
flaskbb.core.tokens.
TokenActions
[source]¶ Collection of token actions.
Note
This is just a class rather than an enum because enums cannot be extended at runtime which would limit the number of token actions to the ones implemented by FlaskBB itself and block extension of tokens by plugins.
-
class
flaskbb.core.tokens.
Token
(user_id, operation)[source]¶ Parameters: - user_id (int) –
- operation (str) – An operation taken from
TokenActions
-
class
flaskbb.core.tokens.
TokenSerializer
[source]¶
-
class
flaskbb.core.tokens.
TokenVerifier
[source]¶ Used to verify the validatity of tokens post deserialization, such as an email matching the user id in the provided token.
Should raise a
ValidationError
if verification fails.
-
exception
flaskbb.core.tokens.
TokenError
(reason)[source]¶ Raised when there is an issue with deserializing a token. Has helper classmethods to ensure consistent verbiage.
Parameters: reason (str) – An explanation of why the token is invalid