diff --git a/monkey/monkey_island/cc/resources/auth/register.py b/monkey/monkey_island/cc/resources/auth/register.py index 8f4814858..d3938ec7b 100644 --- a/monkey/monkey_island/cc/resources/auth/register.py +++ b/monkey/monkey_island/cc/resources/auth/register.py @@ -12,6 +12,9 @@ logger = logging.getLogger(__name__) class Registration(AbstractResource): + """ + A resource for user registration + """ urls = ["/api/register"] @@ -19,6 +22,14 @@ class Registration(AbstractResource): self._authentication_service = authentication_service def post(self): + """ + Gets a username and password from the request sent from the client, + and registers a new user + + :raises InvalidRegistrationCredentialsError: If username or password is empty + :raises AlreadyRegisteredError: If a user has already been registered + """ + username, password = get_username_password_from_request(request) try: