From e6737d0e52214be0f986e781886e0283ca0072c1 Mon Sep 17 00:00:00 2001 From: thor Date: Mon, 4 Feb 2019 09:55:31 -0800 Subject: [PATCH] Jwt cache config (#516) * adding in the params to turn on/off jwks caching Signed-off-by: thor wolpert * altering config to set duration to an int, werkzeug caching requires typed comparison. Signed-off-by: thor wolpert * altering config to set duration to an int, werkzeug caching requires typed comparison. Signed-off-by: thor wolpert --- api/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/config.py b/api/config.py index 5e2da4bd2..f706718b7 100644 --- a/api/config.py +++ b/api/config.py @@ -56,7 +56,11 @@ class Config(object): JWT_OIDC_AUDIENCE = os.getenv('JWT_OIDC_AUDIENCE') JWT_OIDC_CLIENT_SECRET = os.getenv('JWT_OIDC_CLIENT_SECRET') JWT_OIDC_CACHING_ENABLED = os.getenv('JWT_OIDC_CACHING_ENABLED') - JWT_OIDC_JWKS_CACHE_TIMEOUT = os.getenv('JWT_OIDC_JWKS_CACHE_TIMEOUT') + try: + JWT_OIDC_JWKS_CACHE_TIMEOUT = int(os.getenv('JWT_OIDC_JWKS_CACHE_TIMEOUT')) + except: + JWT_OIDC_JWKS_CACHE_TIMEOUT = 300 + TESTING = False, DEBUG = False