From 6a14c04aaa1d01d6254cdc49a7694cfad30c4cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 6 Dec 2022 17:46:17 +0800 Subject: [PATCH] Moved UnauthorizedException from flask_digest_auth.exception to flask_digest_auth.auth, because it is only used there. --- src/flask_digest_auth/auth.py | 6 +++++- src/flask_digest_auth/exception.py | 25 ------------------------- 2 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 src/flask_digest_auth/exception.py diff --git a/src/flask_digest_auth/auth.py b/src/flask_digest_auth/auth.py index f976ba1..05f8517 100644 --- a/src/flask_digest_auth/auth.py +++ b/src/flask_digest_auth/auth.py @@ -31,7 +31,6 @@ from itsdangerous import URLSafeTimedSerializer, BadData from werkzeug.datastructures import Authorization from flask_digest_auth.algo import calc_response -from flask_digest_auth.exception import UnauthorizedException class BasePasswordHashGetter: @@ -400,3 +399,8 @@ class AuthState: """Constructs the authorization state.""" self.opaque: t.Optional[str] = None self.stale: t.Optional[bool] = None + + +class UnauthorizedException(Exception): + """The exception thrown when the authentication is failed.""" + pass diff --git a/src/flask_digest_auth/exception.py b/src/flask_digest_auth/exception.py deleted file mode 100644 index 81d54d7..0000000 --- a/src/flask_digest_auth/exception.py +++ /dev/null @@ -1,25 +0,0 @@ -# The Flask HTTP Digest Authentication Project. -# Author: imacat@mail.imacat.idv.tw (imacat), 2022/11/3 - -# Copyright (c) 2022 imacat. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""The exception. - -""" - - -class UnauthorizedException(Exception): - """The exception thrown when the authentication is failed.""" - pass