Registration¶
These interfaces and implementations control the user registration flow in FlaskBB.
Registration Interfaces¶
-
class
flaskbb.core.auth.registration.
UserRegistrationInfo
(username, password, email, language, group)¶ User registration object, contains all relevant information for validating and creating a new user.
-
class
flaskbb.core.auth.registration.
UserValidator
¶ Used to validate user registrations and stop the registration process by raising a
ValidationError
.-
validate
(user_info)¶ This method is abstract.
Parameters: user_info ( UserRegistrationInfo
) – The provided registration information.
-
-
class
flaskbb.core.auth.registration.
UserRegistrationService
¶ Used to manage the registration process. A default implementation is provided however, this interface is provided in case alternative flows are needed.
-
register
(user_info)¶ This method is abstract.
Parameters: user_info ( UserRegistrationInfo
) – The provided user registration information.
-
Registration Provided Implementations¶
-
class
flaskbb.auth.services.registration.
UsernameRequirements
(min, max, blacklist)¶ Configuration for username requirements, minimum and maximum length and disallowed names.
-
class
flaskbb.auth.services.registration.
UsernameValidator
(requirements)¶ Validates that the username for the registering user meets the minimum requirements (appropriate length, not a forbidden name).
-
class
flaskbb.auth.services.registration.
UsernameUniquenessValidator
(users)¶ Validates that the provided username is unique in the application.
-
class
flaskbb.auth.services.registration.
EmailUniquenessValidator
(users)¶ Validates that the provided email is unique in the application.
-
class
flaskbb.auth.services.registration.
RegistrationService
(validators, user_repo)¶ Default registration service for FlaskBB, runs the registration information against the provided validators and if it passes, creates the user.
If any of the provided
UserValidators
raise aValidationError
then the register method will raise aStopValidation
with all reasons why the registration was prevented.