Module: Fortifier::Authentication

Defined in:
app/models/fortifier/authentication.rb

Constant Summary collapse

LOGIN_REGEX =

ASCII, strict

/\A\w[\w\.\-_@']+\z/
NAME_REGEX =

Unicode, permissive

/\A[^[:cntrl:]\\<>\/&]*\z/
EMAIL_NAME_REGEX =
'[\w\.%\+\-\']+'.freeze
DOMAIN_HEAD_REGEX =
'(?:[A-Z0-9\-]+\.)+'.freeze
DOMAIN_TLD_REGEX =
'(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum)'.freeze
EMAIL_REGEX =
/\A#{EMAIL_NAME_REGEX}@#{DOMAIN_HEAD_REGEX}#{DOMAIN_TLD_REGEX}\z/i
SECRET_REGEX =

Custom regex’ (IdS)

/\A(?=.*\d)(?=.*([a-z]|[A-Z]))([\x20-\x7E]){10,40}\z/
IP_ADDRESS_REGEX =
/\A\d{1,3}(\.\d{1,3}){3}\z/