square-authentication 7.0.0__tar.gz → 8.0.0__tar.gz
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.
- {square_authentication-7.0.0 → square_authentication-8.0.0}/PKG-INFO +31 -2
- {square_authentication-7.0.0 → square_authentication-8.0.0}/README.md +28 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/setup.py +3 -2
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/configuration.py +31 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/data/config.sample.ini +11 -1
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/data/config.testing.sample.ini +11 -1
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/messages.py +2 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/pydantic_models/core.py +16 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/routes/core.py +964 -31
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/routes/profile.py +10 -5
- square_authentication-8.0.0/square_authentication/utils/core.py +37 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication.egg-info/PKG-INFO +31 -2
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication.egg-info/SOURCES.txt +1 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication.egg-info/requires.txt +2 -1
- {square_authentication-7.0.0 → square_authentication-8.0.0}/tests/test_login.py +12 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/pyproject.toml +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/setup.cfg +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/__init__.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/main.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/pydantic_models/__init__.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/pydantic_models/profile.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/routes/__init__.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/routes/utility.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/utils/__init__.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/utils/encryption.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/utils/token.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication.egg-info/dependency_links.txt +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication.egg-info/top_level.txt +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/tests/test_1.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/tests/test_delete_user.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/tests/test_update_profile.py +0 -0
- {square_authentication-7.0.0 → square_authentication-8.0.0}/tests/test_username.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: square_authentication
|
3
|
-
Version:
|
3
|
+
Version: 8.0.0
|
4
4
|
Summary: authentication layer for my personal server.
|
5
5
|
Home-page: https://github.com/thepmsquare/square_authentication
|
6
6
|
Author: thePmSquare
|
@@ -19,13 +19,14 @@ Requires-Dist: bcrypt>=4.1.2
|
|
19
19
|
Requires-Dist: pyjwt>=2.8.0
|
20
20
|
Requires-Dist: requests>=2.32.3
|
21
21
|
Requires-Dist: cryptography>=42.0.7
|
22
|
-
Requires-Dist: square_commons>=
|
22
|
+
Requires-Dist: square_commons>=3.0.0
|
23
23
|
Requires-Dist: square_logger>=2.0.0
|
24
24
|
Requires-Dist: square_database_helper>=2.0.0
|
25
25
|
Requires-Dist: square_database_structure>=2.3.1
|
26
26
|
Requires-Dist: square_file_store_helper>=3.0.0
|
27
27
|
Requires-Dist: pytest>=8.0.0
|
28
28
|
Requires-Dist: httpx>=0.27.2
|
29
|
+
Requires-Dist: google-auth>=2.40.3
|
29
30
|
Dynamic: author
|
30
31
|
Dynamic: author-email
|
31
32
|
Dynamic: classifier
|
@@ -53,6 +54,34 @@ pip install square_authentication
|
|
53
54
|
|
54
55
|
## changelog
|
55
56
|
|
57
|
+
### v8.0.0
|
58
|
+
|
59
|
+
- env
|
60
|
+
- add GOOGLE section and GOOGLE_AUTH_PLATFORM_CLIENT_ID variable.
|
61
|
+
- add LOGIC section with NUMBER_OF_RECOVERY_CODES, EXPIRY_TIME_FOR_EMAIL_VERIFICATION_CODE_IN_SECONDS,
|
62
|
+
NUMBER_OF_DIGITS_IN_EMAIL_VERIFICATION_CODE, EXPIRY_TIME_FOR_EMAIL_PASSWORD_RESET_CODE_IN_SECONDS,
|
63
|
+
NUMBER_OF_DIGITS_IN_EMAIL_PASSWORD_RESET_CODE variables.
|
64
|
+
- dependencies
|
65
|
+
- add google-auth>=2.40.3.
|
66
|
+
- update square_commons to >=3.0.0.
|
67
|
+
- core
|
68
|
+
- add reset_password_and_login_using_reset_email_code_v0.
|
69
|
+
- **breaking change**: remove app_id from send_reset_password_email_v0.
|
70
|
+
- implement deletion of existing backup codes before generating new ones (generate_account_backup_codes_v0).
|
71
|
+
- implement deletion of existing backup codes before removing recovery method (update_user_recovery_methods_v0).
|
72
|
+
- implement logout_other_sessions in update_password_v0, reset_password_and_login_using_backup_code_v0 and
|
73
|
+
reset_password_and_login_using_reset_email_code_v0
|
74
|
+
- in update_password_v0, it will log out all other sessions except the current one if valid (optional)
|
75
|
+
refresh_token is passed in.
|
76
|
+
- add register_login_google_v0, **finally**.
|
77
|
+
- add validation in update_password_v0, reset_password_and_login_using_backup_code_v0, send_reset_password_email_v0,
|
78
|
+
reset_password_and_login_using_reset_email_code_v0 to check if user has credentials and has self as auth provider.
|
79
|
+
- remove profile_photo from file_store when user is deleted in delete_user_v0.
|
80
|
+
- utils
|
81
|
+
- add new core file with generate_default_username_for_google_users function.
|
82
|
+
- tests
|
83
|
+
- add test_login_fail_v0.
|
84
|
+
|
56
85
|
### v7.0.0
|
57
86
|
|
58
87
|
- internal support for UserAuthProvider.
|
@@ -16,6 +16,34 @@ pip install square_authentication
|
|
16
16
|
|
17
17
|
## changelog
|
18
18
|
|
19
|
+
### v8.0.0
|
20
|
+
|
21
|
+
- env
|
22
|
+
- add GOOGLE section and GOOGLE_AUTH_PLATFORM_CLIENT_ID variable.
|
23
|
+
- add LOGIC section with NUMBER_OF_RECOVERY_CODES, EXPIRY_TIME_FOR_EMAIL_VERIFICATION_CODE_IN_SECONDS,
|
24
|
+
NUMBER_OF_DIGITS_IN_EMAIL_VERIFICATION_CODE, EXPIRY_TIME_FOR_EMAIL_PASSWORD_RESET_CODE_IN_SECONDS,
|
25
|
+
NUMBER_OF_DIGITS_IN_EMAIL_PASSWORD_RESET_CODE variables.
|
26
|
+
- dependencies
|
27
|
+
- add google-auth>=2.40.3.
|
28
|
+
- update square_commons to >=3.0.0.
|
29
|
+
- core
|
30
|
+
- add reset_password_and_login_using_reset_email_code_v0.
|
31
|
+
- **breaking change**: remove app_id from send_reset_password_email_v0.
|
32
|
+
- implement deletion of existing backup codes before generating new ones (generate_account_backup_codes_v0).
|
33
|
+
- implement deletion of existing backup codes before removing recovery method (update_user_recovery_methods_v0).
|
34
|
+
- implement logout_other_sessions in update_password_v0, reset_password_and_login_using_backup_code_v0 and
|
35
|
+
reset_password_and_login_using_reset_email_code_v0
|
36
|
+
- in update_password_v0, it will log out all other sessions except the current one if valid (optional)
|
37
|
+
refresh_token is passed in.
|
38
|
+
- add register_login_google_v0, **finally**.
|
39
|
+
- add validation in update_password_v0, reset_password_and_login_using_backup_code_v0, send_reset_password_email_v0,
|
40
|
+
reset_password_and_login_using_reset_email_code_v0 to check if user has credentials and has self as auth provider.
|
41
|
+
- remove profile_photo from file_store when user is deleted in delete_user_v0.
|
42
|
+
- utils
|
43
|
+
- add new core file with generate_default_username_for_google_users function.
|
44
|
+
- tests
|
45
|
+
- add test_login_fail_v0.
|
46
|
+
|
19
47
|
### v7.0.0
|
20
48
|
|
21
49
|
- internal support for UserAuthProvider.
|
@@ -4,7 +4,7 @@ package_name = "square_authentication"
|
|
4
4
|
|
5
5
|
setup(
|
6
6
|
name=package_name,
|
7
|
-
version="
|
7
|
+
version="8.0.0",
|
8
8
|
packages=find_packages(),
|
9
9
|
package_data={
|
10
10
|
package_name: ["data/*"],
|
@@ -18,13 +18,14 @@ setup(
|
|
18
18
|
"pyjwt>=2.8.0",
|
19
19
|
"requests>=2.32.3",
|
20
20
|
"cryptography>=42.0.7",
|
21
|
-
"square_commons>=
|
21
|
+
"square_commons>=3.0.0",
|
22
22
|
"square_logger>=2.0.0",
|
23
23
|
"square_database_helper>=2.0.0",
|
24
24
|
"square_database_structure>=2.3.1",
|
25
25
|
"square_file_store_helper>=3.0.0",
|
26
26
|
"pytest>=8.0.0",
|
27
27
|
"httpx>=0.27.2",
|
28
|
+
"google-auth>=2.40.3",
|
28
29
|
],
|
29
30
|
extras_require={},
|
30
31
|
author="thePmSquare",
|
{square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/configuration.py
RENAMED
@@ -100,6 +100,37 @@ try:
|
|
100
100
|
|
101
101
|
MAIL_GUN_API_KEY = ldict_configuration["EMAIL"]["MAIL_GUN_API_KEY"]
|
102
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
|
+
|
103
134
|
# Initialize logger
|
104
135
|
global_object_square_logger = SquareLogger(
|
105
136
|
pstr_log_file_name=config_str_log_file_name,
|
@@ -54,4 +54,14 @@ SQUARE_FILE_STORE_IP = localhost
|
|
54
54
|
SQUARE_FILE_STORE_PORT = 10100
|
55
55
|
|
56
56
|
[EMAIL]
|
57
|
-
MAIL_GUN_API_KEY = dummy_mailgun_api_key
|
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
|
@@ -54,4 +54,14 @@ SQUARE_FILE_STORE_IP = raspi.thepmsquare.com
|
|
54
54
|
SQUARE_FILE_STORE_PORT = 20010
|
55
55
|
|
56
56
|
[EMAIL]
|
57
|
-
MAIL_GUN_API_KEY = dummy_mailgun_api_key
|
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
|
{square_authentication-7.0.0 → square_authentication-8.0.0}/square_authentication/messages.py
RENAMED
@@ -27,4 +27,6 @@ messages = {
|
|
27
27
|
"EMAIL_ALREADY_VERIFIED": "your email address has already been verified.",
|
28
28
|
"INCORRECT_VERIFICATION_CODE": "the verification code you entered is incorrect or has expired. please request a new code.",
|
29
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.",
|
30
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):
|
@@ -40,8 +48,16 @@ class ResetPasswordAndLoginUsingBackupCodeV0(BaseModel):
|
|
40
48
|
username: str
|
41
49
|
new_password: str
|
42
50
|
app_id: int
|
51
|
+
logout_other_sessions: bool = False
|
43
52
|
|
44
53
|
|
45
54
|
class SendResetPasswordEmailV0(BaseModel):
|
46
55
|
username: str
|
56
|
+
|
57
|
+
|
58
|
+
class ResetPasswordAndLoginUsingResetEmailCodeV0(BaseModel):
|
59
|
+
reset_email_code: str
|
60
|
+
username: str
|
61
|
+
new_password: str
|
47
62
|
app_id: int
|
63
|
+
logout_other_sessions: bool = False
|