done with JWT
This commit is contained in:
@@ -45,7 +45,7 @@ def serve_paths(filename):
|
||||
|
||||
# EligibilityCheck Endpoint
|
||||
@api.route("/EligibilityCheck", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def eligibility_check():
|
||||
data = request.get_json()
|
||||
# logger.info(f"EligibilityCheck request received: {data}")
|
||||
@@ -55,7 +55,7 @@ def eligibility_check():
|
||||
|
||||
# SelectOffer Endpoint
|
||||
@api.route("/SelectOffer", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def select_offer():
|
||||
data = request.get_json()
|
||||
# logger.info(f"SelectOffer request received: {data}")
|
||||
@@ -65,7 +65,7 @@ def select_offer():
|
||||
|
||||
# ProvideLoan Endpoint
|
||||
@api.route("/ProvideLoan", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def provide_loan():
|
||||
data = request.get_json()
|
||||
# logger.info(f"ProvideLoan request received: {data}")
|
||||
@@ -75,7 +75,7 @@ def provide_loan():
|
||||
|
||||
# LoanStatus Endpoint
|
||||
@api.route("/LoanStatus", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def loan_status():
|
||||
data = request.get_json()
|
||||
# logger.info(f"LoanStatus request received: {data}")
|
||||
@@ -85,7 +85,7 @@ def loan_status():
|
||||
|
||||
# Repayment Endpoint
|
||||
@api.route("/Repayment", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def repayment():
|
||||
data = request.get_json()
|
||||
# logger.info(f"Repayment request received: {data}")
|
||||
@@ -95,7 +95,7 @@ def repayment():
|
||||
|
||||
# CustomerConsent Endpoint
|
||||
@api.route("/CustomerConsent", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def customer_consent():
|
||||
data = request.get_json()
|
||||
# logger.info(f"CustomerConsent request received: {data}")
|
||||
@@ -105,7 +105,7 @@ def customer_consent():
|
||||
|
||||
# NotificationCallback Endpoint
|
||||
@api.route("/NotificationCallback", methods=["POST"])
|
||||
@require_auth
|
||||
@jwt_required()
|
||||
def notification_callback():
|
||||
data = request.get_json()
|
||||
# logger.info(f"NotificationCallback request received: {data}")
|
||||
|
||||
@@ -11,6 +11,10 @@ from flask_jwt_extended import (
|
||||
create_refresh_token,
|
||||
get_jwt_identity,
|
||||
)
|
||||
from app.config import Config
|
||||
|
||||
USERNAME = Config.BASIC_AUTH_USERNAME
|
||||
PASSWORD = Config.BASIC_AUTH_PASSWORD
|
||||
|
||||
|
||||
class AuthorizationService(BaseService):
|
||||
@@ -39,8 +43,8 @@ class AuthorizationService(BaseService):
|
||||
### TODO: Access Database credentials here ###
|
||||
|
||||
if (
|
||||
validated_data["username"] != "username"
|
||||
or validated_data["password"] != "password"
|
||||
validated_data["username"] != USERNAME
|
||||
or validated_data["password"] != PASSWORD
|
||||
):
|
||||
return ResponseHelper.unauthorized(message="Invalid credentials")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user