(20250115) Allowing internal IPs to send SMS messages.
This commit is contained in:
@@ -207,12 +207,16 @@ async def send_sms_messages_api(
|
||||
# ┣┫┓┏╋┣┓ ┃ ┣┓┏┓┏┃┏
|
||||
# ┛┗┗┻┗┛┗ ┗┛┛┗┗ ┗┛┗
|
||||
|
||||
# If the session token is invalid/expired:
|
||||
if kwargs.get("session_info") is None:
|
||||
# Either the session must be valid, or
|
||||
# the IP address requesting the service must be whitelisted:
|
||||
if (
|
||||
kwargs.get("session_info") is None and
|
||||
inbound_headers["Remote-IP"] not in current_app.whitelisted_ips
|
||||
):
|
||||
return ResponseModel(
|
||||
status_code = StatusCodes.FAILED,
|
||||
http_code = HttpCodes.UNAUTHORIZED,
|
||||
message = "invalid session"
|
||||
message = "Invalid session and/or bad IP addr."
|
||||
)
|
||||
|
||||
# Get the token from the token key:
|
||||
|
||||
Reference in New Issue
Block a user