Fix REST auth errors for Flask-HTTPAuth 4.8.1 (#2697)
Some checks are pending
Build Docker container on push / Build image (push) Waiting to run
Extension Compatibility Check / extension-compat (push) Waiting to run
Tests / test (push) Waiting to run
Tests / cypress (push) Waiting to run
Tests / extension-smoketest (push) Waiting to run
TOC Generator / TOC Generator (push) Waiting to run
Black Python Linter / black (push) Waiting to run

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nazim <nazim@openclaw.ai>
This commit is contained in:
al-munazzim 2026-08-12 12:17:08 +02:00 committed by GitHub
parent 07eb1520dc
commit 180801223d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 5 deletions

View file

@ -5,7 +5,7 @@ Flask-Babel==3.1.0
Flask-Cors==6.0.0
Flask-Login==0.6.3
Flask-RESTful==0.3.10
Flask-HTTPAuth==4.8.0
Flask-HTTPAuth==4.8.1
hwi==3.1.0
python-dotenv==1.2.2
requests==2.33.0

View file

@ -267,9 +267,9 @@ flask-cors==6.0.0 \
--hash=sha256:4592c1570246bf7beee96b74bc0adbbfcb1b0318f6ba05c412e8909eceec3393 \
--hash=sha256:6332073356452343a8ccddbfec7befdc3fdd040141fe776ec9b94c262f058657
# via -r requirements.in
flask-httpauth==4.8.0 \
--hash=sha256:66568a05bc73942c65f1e2201ae746295816dc009edd84b482c44c758d75097a \
--hash=sha256:a58fedd09989b9975448eef04806b096a3964a7feeebc0a78831ff55685b62b0
flask-httpauth==4.8.1 \
--hash=sha256:0080393d70e12327781f7509115175ec5e47209816489a620d4fd39e20cea2e8 \
--hash=sha256:88499b22f1353893743c3cd68f2ca561c4ad9ef75cd6bcc7f621161cd0e80744
# via -r requirements.in
flask-login==0.6.3 \
--hash=sha256:5e23d14a607ef12806c699590b89d0f0e0d67baeec599d75947bf9c147330333 \

View file

@ -1,4 +1,5 @@
"""Security Related things for the REST-API"""
import logging, jwt
from functools import wraps
@ -14,6 +15,18 @@ from flask import current_app as app
logger = logging.getLogger(__name__)
@auth.error_handler
@token_auth.error_handler
def auth_error(status):
"""Return REST API authentication failures as JSON.
Flask-HTTPAuth 4.8.1 changed the default unauthorized response body to
plain text ("Unauthorized Access"). The REST API has historically returned
Flask-RESTful JSON error objects, and clients/tests rely on that shape.
"""
return abort(status)
@auth.verify_password
def verify_password(username, password):
"""Validate user passwords and store user in the 'g' object"""