square-authentication 6.2.2__py3-none-any.whl → 8.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,6 +94,43 @@ try:
94
94
  ldict_configuration["SQUARE_FILE_STORE_HELPER"]["SQUARE_FILE_STORE_PORT"]
95
95
  )
96
96
  # ===========================================
97
+
98
+ # ===========================================
99
+ # EMAIL
100
+
101
+ MAIL_GUN_API_KEY = ldict_configuration["EMAIL"]["MAIL_GUN_API_KEY"]
102
+ # ===========================================
103
+ # ===========================================
104
+ # GOOGLE
105
+
106
+ GOOGLE_AUTH_PLATFORM_CLIENT_ID = ldict_configuration["GOOGLE"][
107
+ "GOOGLE_AUTH_PLATFORM_CLIENT_ID"
108
+ ]
109
+ # ===========================================
110
+ # ===========================================
111
+ # GOOGLE
112
+
113
+ NUMBER_OF_RECOVERY_CODES = int(
114
+ ldict_configuration["LOGIC"]["NUMBER_OF_RECOVERY_CODES"]
115
+ )
116
+ EXPIRY_TIME_FOR_EMAIL_VERIFICATION_CODE_IN_SECONDS = int(
117
+ ldict_configuration["LOGIC"][
118
+ "EXPIRY_TIME_FOR_EMAIL_VERIFICATION_CODE_IN_SECONDS"
119
+ ]
120
+ )
121
+ NUMBER_OF_DIGITS_IN_EMAIL_VERIFICATION_CODE = int(
122
+ ldict_configuration["LOGIC"]["NUMBER_OF_DIGITS_IN_EMAIL_VERIFICATION_CODE"]
123
+ )
124
+ EXPIRY_TIME_FOR_EMAIL_PASSWORD_RESET_CODE_IN_SECONDS = int(
125
+ ldict_configuration["LOGIC"][
126
+ "EXPIRY_TIME_FOR_EMAIL_PASSWORD_RESET_CODE_IN_SECONDS"
127
+ ]
128
+ )
129
+ NUMBER_OF_DIGITS_IN_EMAIL_PASSWORD_RESET_CODE = int(
130
+ ldict_configuration["LOGIC"]["NUMBER_OF_DIGITS_IN_EMAIL_PASSWORD_RESET_CODE"]
131
+ )
132
+ # ===========================================
133
+
97
134
  # Initialize logger
98
135
  global_object_square_logger = SquareLogger(
99
136
  pstr_log_file_name=config_str_log_file_name,
@@ -51,4 +51,17 @@ SQUARE_DATABASE_PORT = 10010
51
51
 
52
52
  SQUARE_FILE_STORE_PROTOCOL = http
53
53
  SQUARE_FILE_STORE_IP = localhost
54
- SQUARE_FILE_STORE_PORT = 10100
54
+ SQUARE_FILE_STORE_PORT = 10100
55
+
56
+ [EMAIL]
57
+ MAIL_GUN_API_KEY = dummy_mailgun_api_key
58
+
59
+ [GOOGLE]
60
+ GOOGLE_AUTH_PLATFORM_CLIENT_ID = dummy_google_client_id
61
+
62
+ [LOGIC]
63
+ NUMBER_OF_RECOVERY_CODES = 10
64
+ EXPIRY_TIME_FOR_EMAIL_VERIFICATION_CODE_IN_SECONDS = 600
65
+ NUMBER_OF_DIGITS_IN_EMAIL_VERIFICATION_CODE = 6
66
+ EXPIRY_TIME_FOR_EMAIL_PASSWORD_RESET_CODE_IN_SECONDS = 600
67
+ NUMBER_OF_DIGITS_IN_EMAIL_PASSWORD_RESET_CODE = 6
@@ -51,4 +51,17 @@ SQUARE_DATABASE_PORT = 20010
51
51
 
52
52
  SQUARE_FILE_STORE_PROTOCOL = http
53
53
  SQUARE_FILE_STORE_IP = raspi.thepmsquare.com
54
- SQUARE_FILE_STORE_PORT = 20010
54
+ SQUARE_FILE_STORE_PORT = 20010
55
+
56
+ [EMAIL]
57
+ MAIL_GUN_API_KEY = dummy_mailgun_api_key
58
+
59
+ [GOOGLE]
60
+ GOOGLE_AUTH_PLATFORM_CLIENT_ID = dummy_google_client_id
61
+
62
+ [LOGIC]
63
+ NUMBER_OF_RECOVERY_CODES = 10
64
+ EXPIRY_TIME_FOR_EMAIL_VERIFICATION_CODE_IN_SECONDS = 600
65
+ NUMBER_OF_DIGITS_IN_EMAIL_VERIFICATION_CODE = 6
66
+ EXPIRY_TIME_FOR_EMAIL_PASSWORD_RESET_CODE_IN_SECONDS = 600
67
+ NUMBER_OF_DIGITS_IN_EMAIL_PASSWORD_RESET_CODE = 6
@@ -13,8 +13,20 @@ messages = {
13
13
  "GENERIC_READ_SUCCESSFUL": "data retrieved successfully.",
14
14
  "GENERIC_UPDATE_SUCCESSFUL": "your information has been updated successfully.",
15
15
  "GENERIC_DELETE_SUCCESSFUL": "your records have been deleted successfully.",
16
+ "GENERIC_ACTION_SUCCESSFUL": "the action was completed successfully.",
16
17
  "GENERIC_400": "the request is invalid or cannot be processed.",
17
18
  "GENERIC_500": "an internal server error occurred. please try again later.",
18
19
  "INVALID_FILE_FORMAT": "the file format is not supported. please upload a valid file.",
19
20
  "FILE_SIZE_EXCEEDS_LIMIT": "the file size exceeds the limit. please upload a smaller file.",
21
+ "INCORRECT_AUTH_PROVIDER": "you have not linked this authentication provider to your account. please link it first.",
22
+ "INVALID_EMAIL_FORMAT": "the email address is invalid. please provide a valid email address.",
23
+ "INVALID_PHONE_NUMBER_FORMAT": "the phone number is invalid. please provide a valid phone number.",
24
+ "GENERIC_MISSING_REQUIRED_FIELD": "a required field is missing. please check your input and try again.",
25
+ "RECOVERY_METHOD_NOT_ENABLED": "the recovery method you are trying to use is not enabled for your account.",
26
+ "INCORRECT_BACKUP_CODE": "the backup code you provided is incorrect or has already been used. please try again with a valid code.",
27
+ "EMAIL_ALREADY_VERIFIED": "your email address has already been verified.",
28
+ "INCORRECT_VERIFICATION_CODE": "the verification code you entered is incorrect or has expired. please request a new code.",
29
+ "EMAIL_NOT_VERIFIED": "your email address has not been verified. please verify your email to continue.",
30
+ "ACCOUNT_WITH_EMAIL_ALREADY_EXISTS": "an account with this email address already exists.",
31
+ "MALFORMED_USER": " the user data is malformed or incomplete.",
20
32
  }
@@ -10,6 +10,12 @@ class RegisterUsernameV0(BaseModel):
10
10
  app_id: Optional[int] = None
11
11
 
12
12
 
13
+ class RegisterLoginGoogleV0(BaseModel):
14
+ google_id: str
15
+ app_id: Optional[int] = None
16
+ assign_app_id_if_missing: bool = False
17
+
18
+
13
19
  class LoginUsernameV0(BaseModel):
14
20
  username: str
15
21
  password: str
@@ -24,6 +30,8 @@ class DeleteUserV0(BaseModel):
24
30
  class UpdatePasswordV0(BaseModel):
25
31
  old_password: str
26
32
  new_password: str
33
+ logout_other_sessions: bool = False
34
+ preserve_session_refresh_token: Optional[str] = None
27
35
 
28
36
 
29
37
  class TokenType(Enum):
@@ -33,3 +41,23 @@ class TokenType(Enum):
33
41
 
34
42
  class LogoutAppsV0(BaseModel):
35
43
  app_ids: List[int]
44
+
45
+
46
+ class ResetPasswordAndLoginUsingBackupCodeV0(BaseModel):
47
+ backup_code: str
48
+ username: str
49
+ new_password: str
50
+ app_id: int
51
+ logout_other_sessions: bool = False
52
+
53
+
54
+ class SendResetPasswordEmailV0(BaseModel):
55
+ username: str
56
+
57
+
58
+ class ResetPasswordAndLoginUsingResetEmailCodeV0(BaseModel):
59
+ reset_email_code: str
60
+ username: str
61
+ new_password: str
62
+ app_id: int
63
+ logout_other_sessions: bool = False
@@ -0,0 +1,5 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class ValidateEmailVerificationCodeV0(BaseModel):
5
+ verification_code: str