From 5e1a224c2971811e96e3c8fab45c1fe70775f898 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 13 Sep 2023 14:23:46 -0700 Subject: [PATCH] notify-admin-721 remove BasicAuth --- app/__init__.py | 8 -------- app/custom_auth.py | 18 ------------------ poetry.lock | 24 +++++++++++------------- 3 files changed, 11 insertions(+), 39 deletions(-) delete mode 100644 app/custom_auth.py diff --git a/app/__init__.py b/app/__init__.py index 5f5bb4680..806d63be1 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -36,7 +36,6 @@ from werkzeug.local import LocalProxy from app import proxy_fix from app.asset_fingerprinter import asset_fingerprinter from app.config import configs -from app.custom_auth import CustomBasicAuth from app.extensions import redis_client, zendesk_client from app.formatters import ( convert_to_boolean, @@ -121,7 +120,6 @@ from app.url_converters import ( login_manager = LoginManager() csrf = CSRFProtect() talisman = Talisman() -basic_auth = CustomBasicAuth() # The current service attached to the request stack. @@ -234,8 +232,6 @@ def create_app(application): login_manager.session_protection = None login_manager.anonymous_user = AnonymousUser - setup_basic_auth(application) - # make sure we handle unicode correctly redis_client.redis_store.decode_responses = True @@ -565,7 +561,3 @@ def init_jinja(application): ] jinja_loader = jinja2.FileSystemLoader(template_folders) application.jinja_loader = jinja_loader - - -def setup_basic_auth(application): - application.basic_auth = CustomBasicAuth(application) diff --git a/app/custom_auth.py b/app/custom_auth.py deleted file mode 100644 index 8f5186b2c..000000000 --- a/app/custom_auth.py +++ /dev/null @@ -1,18 +0,0 @@ -from flask import jsonify, request -from flask_basicauth import BasicAuth - - -class CustomBasicAuth(BasicAuth): - """ - Description: - Override BasicAuth to permit anonymous healthcheck at /_status?simple=true - """ - - def challenge(self): - if "/_status" in request.url: - if request.args.get("elb", None) or request.args.get("simple", None): - return jsonify(status="ok"), 200 - return super(CustomBasicAuth, self).challenge() - - -custom_basic_auth = CustomBasicAuth() diff --git a/poetry.lock b/poetry.lock index 779c6847b..575d59d50 100644 --- a/poetry.lock +++ b/poetry.lock @@ -168,17 +168,17 @@ files = [ [[package]] name = "boto3" -version = "1.28.46" +version = "1.28.47" description = "The AWS SDK for Python" optional = false python-versions = ">= 3.7" files = [ - {file = "boto3-1.28.46-py3-none-any.whl", hash = "sha256:04445d70127c25fad69e2cab7e3f5cb219c8d6e60463af3657f20e29ac517957"}, - {file = "boto3-1.28.46.tar.gz", hash = "sha256:2ca2852f7b7c1bc2e56f10f968d4c8483c8228b935ecd89a444ae8292ad0dc24"}, + {file = "boto3-1.28.47-py3-none-any.whl", hash = "sha256:27560da44099e7e2ee961d3971d8ea659de2e0dc24e78043d1c3027d89b2d8a2"}, + {file = "boto3-1.28.47.tar.gz", hash = "sha256:be69cd28e3732b63ad61f6d2429b1eac92428588911a5a7367faa4e129a4738d"}, ] [package.dependencies] -botocore = ">=1.31.46,<1.32.0" +botocore = ">=1.31.47,<1.32.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.6.0,<0.7.0" @@ -187,13 +187,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.31.46" +version = "1.31.47" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">= 3.7" files = [ - {file = "botocore-1.31.46-py3-none-any.whl", hash = "sha256:ac0c1258b1782cde42950bd00138fdce6bd7d04855296af8c326d5844a426473"}, - {file = "botocore-1.31.46.tar.gz", hash = "sha256:6c30be3371624a80d6a881d9c7771a80e0eb82697ee374aaf522cd59b76e14dd"}, + {file = "botocore-1.31.47-py3-none-any.whl", hash = "sha256:6a60f9601270458102529b17fdcba5551b918f9eedc32bbc2f467e63edfb2662"}, + {file = "botocore-1.31.47.tar.gz", hash = "sha256:a0ba5629eb17a37bf449bccda9df6ae652d5755f73145519d5eb244f6963b31b"}, ] [package.dependencies] @@ -800,21 +800,19 @@ testing = ["hatch", "pre-commit", "pytest", "tox"] [[package]] name = "filelock" -version = "3.12.3" +version = "3.12.4" description = "A platform independent file lock." optional = false python-versions = ">=3.8" files = [ - {file = "filelock-3.12.3-py3-none-any.whl", hash = "sha256:f067e40ccc40f2b48395a80fcbd4728262fab54e232e090a4063ab804179efeb"}, - {file = "filelock-3.12.3.tar.gz", hash = "sha256:0ecc1dd2ec4672a10c8550a8182f1bd0c0a5088470ecd5a125e45f49472fac3d"}, + {file = "filelock-3.12.4-py3-none-any.whl", hash = "sha256:08c21d87ded6e2b9da6728c3dff51baf1dcecf973b768ef35bcbc3447edb9ad4"}, + {file = "filelock-3.12.4.tar.gz", hash = "sha256:2e6f249f1f3654291606e046b09f1fd5eac39b360664c27f5aad072012f8bcbd"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.7.1", markers = "python_version < \"3.11\""} - [package.extras] docs = ["furo (>=2023.7.26)", "sphinx (>=7.1.2)", "sphinx-autodoc-typehints (>=1.24)"] testing = ["covdefaults (>=2.3)", "coverage (>=7.3)", "diff-cover (>=7.7)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "pytest-timeout (>=2.1)"] +typing = ["typing-extensions (>=4.7.1)"] [[package]] name = "flake8"