square-authentication 1.0.0__py3-none-any.whl → 3.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.
@@ -6,11 +6,11 @@ from square_logger.main import SquareLogger
6
6
 
7
7
  try:
8
8
  config_file_path = (
9
- os.path.dirname(os.path.abspath(__file__))
10
- + os.sep
11
- + "data"
12
- + os.sep
13
- + "config.ini"
9
+ os.path.dirname(os.path.abspath(__file__))
10
+ + os.sep
11
+ + "data"
12
+ + os.sep
13
+ + "config.ini"
14
14
  )
15
15
  ldict_configuration = ConfigReader(config_file_path).read_configuration()
16
16
 
@@ -3,6 +3,7 @@ import os.path
3
3
  from fastapi import FastAPI, status
4
4
  from fastapi.middleware.cors import CORSMiddleware
5
5
  from fastapi.responses import JSONResponse
6
+ from square_commons import get_api_output_in_standard_format
6
7
  from uvicorn import run
7
8
 
8
9
  from square_authentication.configuration import (
@@ -31,15 +32,14 @@ app.include_router(utility.router)
31
32
  @app.get("/")
32
33
  @global_object_square_logger.async_auto_logger
33
34
  async def root():
34
- return JSONResponse(
35
- status_code=status.HTTP_200_OK, content={"text": config_str_module_name}
36
- )
35
+ output_content = get_api_output_in_standard_format(log=config_str_module_name)
36
+ return JSONResponse(status_code=status.HTTP_200_OK, content=output_content)
37
37
 
38
38
 
39
39
  if __name__ == "__main__":
40
40
  try:
41
41
  if os.path.exists(config_str_ssl_key_file_path) and os.path.exists(
42
- config_str_ssl_crt_file_path
42
+ config_str_ssl_crt_file_path
43
43
  ):
44
44
  run(
45
45
  app,
@@ -0,0 +1,17 @@
1
+ messages = {
2
+ "REGISTRATION_SUCCESSFUL": "registration was successful. welcome aboard!",
3
+ "LOGIN_SUCCESSFUL": "you have logged in successfully.",
4
+ "LOGOUT_SUCCESSFUL": "you have logged out successfully.",
5
+ "INCORRECT_USERNAME": "the username you entered does not exist.",
6
+ "INCORRECT_PASSWORD": "the password you entered is incorrect. please try again.",
7
+ "INCORRECT_USER_ID": "the user ID you provided does not exist or is invalid.",
8
+ "USERNAME_ALREADY_EXISTS": "the username you entered is already taken. please choose a different one.",
9
+ "INCORRECT_ACCESS_TOKEN": "the access token provided is invalid or expired.",
10
+ "INCORRECT_REFRESH_TOKEN": "the refresh token provided is invalid or expired.",
11
+ "GENERIC_CREATION_SUCCESSFUL": "records created successfully.",
12
+ "GENERIC_READ_SUCCESSFUL": "data retrieved successfully.",
13
+ "GENERIC_UPDATE_SUCCESSFUL": "your information has been updated successfully.",
14
+ "GENERIC_DELETE_SUCCESSFUL": "your records have been deleted successfully.",
15
+ "GENERIC_400": "the request is invalid or cannot be processed.",
16
+ "GENERIC_500": "an internal server error occurred. please try again later.",
17
+ }
File without changes
@@ -0,0 +1,24 @@
1
+ from typing import Optional
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class RegisterUsernameV0(BaseModel):
7
+ username: str
8
+ password: str
9
+ app_id: Optional[int] = None
10
+
11
+
12
+ class LoginUsernameV0(BaseModel):
13
+ username: str
14
+ password: str
15
+ app_id: int
16
+
17
+
18
+ class DeleteUserV0(BaseModel):
19
+ password: str
20
+
21
+
22
+ class UpdatePasswordV0(BaseModel):
23
+ old_password: str
24
+ new_password: str