diff options
| author | Frederick Muriuki Muriithi | 2026-05-01 15:05:11 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-05-01 15:05:11 -0500 |
| commit | 8a11dda78f1142347c85d943b11bf0a48e8530fe (patch) | |
| tree | 86b7578eb9945e506f3690877df633e0e27955ec /gn_auth/auth/authentication/oauth2/resource_server.py | |
| parent | c8176603fb3d6ac8cd4c917dde397dd0de9faf03 (diff) | |
| download | gn-auth-8a11dda78f1142347c85d943b11bf0a48e8530fe.tar.gz | |
Use module-level logging rather than the app's logger.
Diffstat (limited to 'gn_auth/auth/authentication/oauth2/resource_server.py')
| -rw-r--r-- | gn_auth/auth/authentication/oauth2/resource_server.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gn_auth/auth/authentication/oauth2/resource_server.py b/gn_auth/auth/authentication/oauth2/resource_server.py index 8ecf923..edab02c 100644 --- a/gn_auth/auth/authentication/oauth2/resource_server.py +++ b/gn_auth/auth/authentication/oauth2/resource_server.py @@ -1,4 +1,5 @@ """Protect the resources endpoints""" +import logging from datetime import datetime, timezone, timedelta from flask import current_app as app @@ -16,6 +17,9 @@ from gn_auth.auth.authentication.oauth2.models.jwt_bearer_token import ( from gn_auth.auth.authentication.oauth2.models.oauth2token import ( token_by_access_token) +logger = logging.getLogger(__name__) + + class BearerTokenValidator(_BearerTokenValidator): """Extends `authlib.oauth2.rfc6750.BearerTokenValidator`""" def authenticate_token(self, token_string: str): @@ -66,7 +70,7 @@ class JWTBearerTokenValidator(_JWTBearerTokenValidator): claims.validate() return claims except JoseError as error: - app.logger.debug('Authenticate token failed. %r', error) + logger.debug('Authenticate token failed. %r', error) return None |
