[chore]: Separated Simbrella to bank calls
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from flask import request
|
||||
from app.helpers.response_helper import ResponseHelper
|
||||
from app.utils.logger import logger
|
||||
import os
|
||||
|
||||
VALID_APP_IDS = os.getenv("VALID_APP_ID", "")
|
||||
|
||||
def require_app_id():
|
||||
"""Middleware to check if App-ID is present and valid."""
|
||||
app_id = request.headers.get("App-ID")
|
||||
|
||||
if not app_id:
|
||||
logger.error("Unauthorized access: Missing App-ID.")
|
||||
return ResponseHelper.unauthorized("Missing App-ID")
|
||||
|
||||
if app_id not in VALID_APP_IDS:
|
||||
logger.error(f"Unauthorized access: Invalid App-ID {app_id}.")
|
||||
return ResponseHelper.unauthorized("Invalid App-ID")
|
||||
|
||||
return None
|
||||
Reference in New Issue
Block a user