evennia.server.validators

class evennia.server.validators.EvenniaUsernameAvailabilityValidator[source]

Bases: object

Checks to make sure a given username is not taken or otherwise reserved.

class evennia.server.validators.EvenniaPasswordValidator(regex="^[\\w. @+\\-',]+$", policy="Password should contain a mix of letters, spaces, digits and @/./+/-/_/'/, only.")[source]

Bases: object

__init__(regex="^[\\w. @+\\-',]+$", policy="Password should contain a mix of letters, spaces, digits and @/./+/-/_/'/, only.")[source]

Constructs a standard Django password validator.

Parameters
  • regex (str) – Regex pattern of valid characters to allow.

  • policy (str) – Brief explanation of what the defined regex permits.

validate(password, user=None)[source]

Validates a password string to make sure it meets predefined Evennia acceptable character policy.

Parameters
  • password (str) – Password to validate

  • user (None) – Unused argument but required by Django

Returns

None (None)

None if password successfully validated,

raises ValidationError otherwise.

get_help_text()[source]

Returns a user-facing explanation of the password policy defined by this validator.

Returns

text (str) – Explanation of password policy.