From 83cf83a67c2e4521796ce3e62428e39565a7b693 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 23:55:20 +0800 Subject: [PATCH] Revised the type hint of the "algorithm" and "__qop" properties of the DigestAuth class. --- src/flask_digest_auth/auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/flask_digest_auth/auth.py b/src/flask_digest_auth/auth.py index 9144933..409dbaa 100644 --- a/src/flask_digest_auth/auth.py +++ b/src/flask_digest_auth/auth.py @@ -45,7 +45,7 @@ class DigestAuth: = URLSafeTimedSerializer(token_urlsafe(32)) self.realm: str = "" if realm is None else realm """The realm. Default is an empty string.""" - self.algorithm: t.Optional[str] = None + self.algorithm: t.Optional[t.Literal["MD5", "MD5-sess"]] = None """The algorithm, either None, ``MD5``, or ``MD5-sess``. Default is None.""" self.use_opaque: bool = True @@ -53,7 +53,8 @@ class DigestAuth: self.__domain: t.List[str] = [] """A list of directories that this username and password applies to. Default is empty.""" - self.__qop: t.List[str] = ["auth", "auth-int"] + self.__qop: t.List[t.Literal["auth", "auth-int"]] \ + = ["auth", "auth-int"] """A list of supported quality of protection supported, either ``qop``, ``auth-int``, both, or empty. Default is both.""" self.app: t.Optional[Flask] = None