1
1
from datetime import timedelta
2
- from typing import Optional , Union , Sequence , List
2
+ from typing import Optional , Union , List
3
3
from pydantic import (
4
4
BaseModel ,
5
5
validator ,
9
9
)
10
10
11
11
class LoadConfig (BaseModel ):
12
- authjwt_token_location : Optional [Sequence [StrictStr ]] = {'headers' }
12
+ authjwt_token_location : Optional [List [StrictStr ]] = {'headers' }
13
13
authjwt_secret_key : Optional [StrictStr ] = None
14
14
authjwt_public_key : Optional [StrictStr ] = None
15
15
authjwt_private_key : Optional [StrictStr ] = None
@@ -18,9 +18,9 @@ class LoadConfig(BaseModel):
18
18
authjwt_decode_leeway : Optional [Union [StrictInt ,timedelta ]] = 0
19
19
authjwt_encode_issuer : Optional [StrictStr ] = None
20
20
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
22
22
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' }
24
24
authjwt_header_name : Optional [StrictStr ] = "Authorization"
25
25
authjwt_header_type : Optional [StrictStr ] = "Bearer"
26
26
authjwt_access_token_expires : Optional [Union [StrictBool ,StrictInt ,timedelta ]] = timedelta (minutes = 15 )
@@ -42,7 +42,7 @@ class LoadConfig(BaseModel):
42
42
authjwt_refresh_csrf_cookie_path : Optional [StrictStr ] = "/"
43
43
authjwt_access_csrf_header_name : Optional [StrictStr ] = "X-CSRF-Token"
44
44
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' }
46
46
47
47
@validator ('authjwt_access_token_expires' )
48
48
def validate_access_token_expires (cls , v ):
@@ -81,5 +81,5 @@ def validate_csrf_methods(cls, v):
81
81
return v .upper ()
82
82
83
83
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