@@ -34,6 +34,14 @@ Some of Simple JWT's behavior can be customized through settings variables in
3434 " JWK_URL" : None ,
3535 " LEEWAY" : 0 ,
3636
37+ " SJWT_CACHE_NAME" : " default" ,
38+ " CACHE_BLACKLISTED_REFRESH_TOKENS" : False ,
39+ " CACHE_BLACKLISTED_FAMILIES" : False ,
40+ " CACHE_TTL_BLACKLISTED_REFRESH_TOKENS" : 3600 , # time is seconds
41+ " CACHE_TTL_BLACKLISTED_FAMILIES" : 3600 , # time in seconds
42+ " CACHE_KEY_PREFIX_BLACKLISTED_REFRESH_TOKENS" : " sjwt_brt" ,
43+ " CACHE_KEY_PREFIX_BLACKLISTED_FAMILIES" : " sjwt_btf" ,
44+
3745 " AUTH_HEADER_TYPES" : (" Bearer" ,),
3846 " AUTH_HEADER_NAME" : " HTTP_AUTHORIZATION" ,
3947 " USER_ID_FIELD" : " id" ,
@@ -222,6 +230,47 @@ integer for seconds or a ``datetime.timedelta``. Please reference
222230https://pyjwt.readthedocs.io/en/latest/usage.html#expiration-time-claim-exp
223231for more information.
224232
233+ ``SJWT_CACHE_NAME ``
234+ ---------------------
235+
236+ Specifies the Django cache alias to use. This must match a defined entry
237+ in Django's ``CACHES `` setting.
238+
239+ Learn more about :doc: `/cache_support `.
240+
241+ ``CACHE_BLACKLISTED_REFRESH_TOKENS ``
242+ --------------------------------------
243+
244+ When set to ``True ``, enables caching of blacklisted refresh tokens.
245+ Blacklisted refresh token entries will be cached for a period defined
246+ by ``CACHE_TTL_BLACKLISTED_REFRESH_TOKENS ``.
247+
248+ ``CACHE_BLACKLISTED_FAMILIES ``
249+ --------------------------------
250+
251+ When set to ``True ``, enables caching of blacklisted token families.
252+ Blacklisted family entries will be cached for a period defined
253+ by ``CACHE_TTL_BLACKLISTED_FAMILIES ``.
254+
255+ ``CACHE_TTL_BLACKLISTED_REFRESH_TOKENS ``
256+ ------------------------------------------
257+
258+ Time-to-live (TTL) in seconds for cached refresh token blacklist entries.
259+
260+ ``CACHE_TTL_BLACKLISTED_FAMILIES ``
261+ ------------------------------------
262+
263+ Time-to-live (TTL) in seconds for cached token family blacklist entries.
264+
265+ ``CACHE_KEY_PREFIX_BLACKLISTED_REFRESH_TOKENS ``
266+ -------------------------------------------------
267+
268+ Prefix used for cache keys when storing blacklisted refresh tokens.
269+
270+ ``CACHE_KEY_PREFIX_BLACKLISTED_FAMILIES ``
271+ -------------------------------------------
272+
273+ Prefix used for cache keys when storing blacklisted token families.
225274
226275``AUTH_HEADER_TYPES ``
227276---------------------
0 commit comments