auth updated routes tested & password is not yet tested

This commit is contained in:
2025-01-29 15:58:42 +03:00
parent a0b1b1bef9
commit f7eedb5ea0
11 changed files with 147 additions and 84 deletions

View File

@@ -113,7 +113,7 @@ AuthenticationCheckTokenEventMethods = MethodToEvent(
)
def authentication_check_token_is_valid():
def authentication_check_token_is_valid(request: Request):
context_retriever = ContextRetrievers(func=authentication_check_token_is_valid)
function = AuthenticationCheckTokenEventMethods.retrieve_event(
event_function_code=f"{authentication_check_token_event.key}"
@@ -142,7 +142,7 @@ AuthenticationRefreshEventMethods = MethodToEvent(
)
def authentication_refresh_user_info():
def authentication_refresh_user_info(request: Request):
context_retriever = ContextRetrievers(func=authentication_refresh_user_info)
function = AuthenticationRefreshEventMethods.retrieve_event(
event_function_code=f"{authentication_refresh_user_info_event.key}"
@@ -169,7 +169,7 @@ AuthenticationChangePasswordEventMethods = MethodToEvent(
)
def authentication_change_password_event_callable(data: EndpointBaseRequestModel):
def authentication_change_password_event_callable(request: Request, data: EndpointBaseRequestModel):
context_retriever = ContextRetrievers(
func=authentication_change_password_event_callable
)
@@ -198,7 +198,7 @@ AuthenticationCreatePasswordEventMethods = MethodToEvent(
)
def authentication_create_password(data: EndpointBaseRequestModel):
def authentication_create_password(request: Request, data: EndpointBaseRequestModel):
context_retriever = ContextRetrievers(func=authentication_create_password)
function = AuthenticationCreatePasswordEventMethods.retrieve_event(
event_function_code=f"{authentication_create_password_event.key}"
@@ -227,13 +227,18 @@ AuthenticationDisconnectUserEventMethods = MethodToEvent(
)
def authentication_disconnect_user(data: EndpointBaseRequestModel):
def authentication_disconnect_user(request: Request):
context_retriever = ContextRetrievers(func=authentication_disconnect_user)
function = AuthenticationDisconnectUserEventMethods.retrieve_event(
event_function_code=f"{authentication_disconnect_user_event.key}"
)
AuthenticationFunctions.context_retriever = context_retriever
return function.endpoint_callable(data=data)
return function.endpoint_callable()
AuthenticationDisconnectUserEventMethods.endpoint_callable = (
authentication_disconnect_user
)
AuthenticationLogoutEventMethods = MethodToEvent(
@@ -249,13 +254,14 @@ AuthenticationLogoutEventMethods = MethodToEvent(
)
def authentication_logout_user(data: EndpointBaseRequestModel):
def authentication_logout_user(request: Request, data: EndpointBaseRequestModel):
context_retriever = ContextRetrievers(func=authentication_logout_user)
function = AuthenticationLogoutEventMethods.retrieve_event(
event_function_code=f"{authentication_logout_user_event.key}"
)
validated_data = function.REQUEST_VALIDATOR(**data.data)
AuthenticationFunctions.context_retriever = context_retriever
return function.endpoint_callable(data=data)
return function.endpoint_callable(data=validated_data)
AuthenticationLogoutEventMethods.endpoint_callable = authentication_logout_user
@@ -268,7 +274,7 @@ AuthenticationRefreshTokenEventMethods = MethodToEvent(
},
headers=[],
errors=[],
decorators_list=[MiddlewareModule.auth_required],
decorators_list=[],
url="/refresh-token",
method="POST",
summary="Refresh token",
@@ -276,13 +282,12 @@ AuthenticationRefreshTokenEventMethods = MethodToEvent(
)
def authentication_refresher_token(data: EndpointBaseRequestModel):
context_retriever = ContextRetrievers(func=authentication_refresher_token)
def authentication_refresher_token(request: Request, data: EndpointBaseRequestModel):
function = AuthenticationRefreshTokenEventMethods.retrieve_event(
event_function_code=f"{authentication_refresher_token_event.key}"
)
AuthenticationFunctions.context_retriever = context_retriever
return function.endpoint_callable(data=data)
validated_data = function.REQUEST_VALIDATOR(**data.data)
return function.endpoint_callable(request=request, data=validated_data)
AuthenticationRefreshTokenEventMethods.endpoint_callable = (
@@ -304,7 +309,7 @@ AuthenticationForgotPasswordEventMethods = MethodToEvent(
)
def authentication_forgot_password(data: EndpointBaseRequestModel):
def authentication_forgot_password(request: Request, data: EndpointBaseRequestModel):
context_retriever = ContextRetrievers(func=authentication_forgot_password)
function = AuthenticationForgotPasswordEventMethods.retrieve_event(
event_function_code=f"{authentication_forgot_password_event.key}"
@@ -333,7 +338,7 @@ AuthenticationResetPasswordEventMethods = MethodToEvent(
)
def authentication_reset_password(data: EndpointBaseRequestModel):
def authentication_reset_password(request: Request, data: EndpointBaseRequestModel):
context_retriever = ContextRetrievers(func=authentication_reset_password)
function = AuthenticationResetPasswordEventMethods.retrieve_event(
event_function_code=f"{authentication_reset_password_event.key}"
@@ -362,7 +367,7 @@ AuthenticationDownloadAvatarEventMethods = MethodToEvent(
)
def authentication_download_avatar():
def authentication_download_avatar(request: Request):
context_retriever = ContextRetrievers(func=authentication_download_avatar)
function = AuthenticationDownloadAvatarEventMethods.retrieve_event(
event_function_code=f"{authentication_download_avatar_event.key}"