11from datetime import timedelta
2- from typing import Optional , Union , Sequence , List
2+ from typing import Optional , Union , List
33from pydantic import (
44 BaseModel ,
55 validator ,
99)
1010
1111class LoadConfig (BaseModel ):
12- authjwt_token_location : Optional [Sequence [StrictStr ]] = {'headers' }
12+ authjwt_token_location : Optional [List [StrictStr ]] = {'headers' }
1313 authjwt_secret_key : Optional [StrictStr ] = None
1414 authjwt_public_key : Optional [StrictStr ] = None
1515 authjwt_private_key : Optional [StrictStr ] = None
@@ -18,9 +18,9 @@ class LoadConfig(BaseModel):
1818 authjwt_decode_leeway : Optional [Union [StrictInt ,timedelta ]] = 0
1919 authjwt_encode_issuer : Optional [StrictStr ] = None
2020 authjwt_decode_issuer : Optional [StrictStr ] = None
21- authjwt_decode_audience : Optional [Union [StrictStr ,Sequence [StrictStr ]]] = None
21+ authjwt_decode_audience : Optional [Union [StrictStr ,List [StrictStr ]]] = None
2222 authjwt_denylist_enabled : Optional [StrictBool ] = False
23- authjwt_denylist_token_checks : Optional [Sequence [StrictStr ]] = {'access' ,'refresh' }
23+ authjwt_denylist_token_checks : Optional [List [StrictStr ]] = {'access' ,'refresh' }
2424 authjwt_header_name : Optional [StrictStr ] = "Authorization"
2525 authjwt_header_type : Optional [StrictStr ] = "Bearer"
2626 authjwt_access_token_expires : Optional [Union [StrictBool ,StrictInt ,timedelta ]] = timedelta (minutes = 15 )
@@ -42,7 +42,7 @@ class LoadConfig(BaseModel):
4242 authjwt_refresh_csrf_cookie_path : Optional [StrictStr ] = "/"
4343 authjwt_access_csrf_header_name : Optional [StrictStr ] = "X-CSRF-Token"
4444 authjwt_refresh_csrf_header_name : Optional [StrictStr ] = "X-CSRF-Token"
45- authjwt_csrf_methods : Optional [Sequence [StrictStr ]] = {'POST' ,'PUT' ,'PATCH' ,'DELETE' }
45+ authjwt_csrf_methods : Optional [List [StrictStr ]] = {'POST' ,'PUT' ,'PATCH' ,'DELETE' }
4646
4747 @validator ('authjwt_access_token_expires' )
4848 def validate_access_token_expires (cls , v ):
@@ -81,5 +81,5 @@ def validate_csrf_methods(cls, v):
8181 return v .upper ()
8282
8383 class Config :
84- min_anystr_length = 1
85- anystr_strip_whitespace = True
84+ str_min_length = 1
85+ str_strip_whitespace = True
0 commit comments