diff options
author | Frederick Muriuki Muriithi | 2024-08-05 12:13:10 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-08-05 12:13:10 -0500 |
commit | eb05221f57ec4b6a5537ac7661811ba33b4b0385 (patch) | |
tree | d28559c167bb96840480429dc69b710095bbf7c2 /gn_auth/auth | |
parent | 368c8be255050a49857209c8f8af9889ed629c0e (diff) | |
download | gn-auth-eb05221f57ec4b6a5537ac7661811ba33b4b0385.tar.gz |
Fix linting errors.
Diffstat (limited to 'gn_auth/auth')
-rw-r--r-- | gn_auth/auth/authentication/oauth2/models/jwtrefreshtoken.py | 4 | ||||
-rw-r--r-- | gn_auth/auth/authentication/oauth2/server.py | 2 | ||||
-rw-r--r-- | gn_auth/auth/authorisation/resources/views.py | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/gn_auth/auth/authentication/oauth2/models/jwtrefreshtoken.py b/gn_auth/auth/authentication/oauth2/models/jwtrefreshtoken.py index 58dd14a..46515c8 100644 --- a/gn_auth/auth/authentication/oauth2/models/jwtrefreshtoken.py +++ b/gn_auth/auth/authentication/oauth2/models/jwtrefreshtoken.py @@ -142,7 +142,7 @@ def link_child_token(conn: db.DbConnection, parenttoken: str, childtoken: str): "WHERE token=:parenttoken"), {"parenttoken": parent.token, "childtoken": childtoken}) - def __check_child__(parent): + def __check_child__(parent):#pylint: disable=[unused-variable] with db.cursor(conn) as cursor: cursor.execute( ("SELECT * FROM jwt_refresh_tokens WHERE token=:parenttoken"), @@ -154,7 +154,7 @@ def link_child_token(conn: db.DbConnection, parenttoken: str, childtoken: str): "activity detected.") return Right(parent) - def __revoke_and_raise_error__(_error_msg_): + def __revoke_and_raise_error__(_error_msg_):#pylint: disable=[unused-variable] load_refresh_token(conn, parenttoken).then( lambda _tok: revoke_refresh_token(conn, _tok)) raise InvalidGrantError(_error_msg_) diff --git a/gn_auth/auth/authentication/oauth2/server.py b/gn_auth/auth/authentication/oauth2/server.py index 175b640..ba5abe8 100644 --- a/gn_auth/auth/authentication/oauth2/server.py +++ b/gn_auth/auth/authentication/oauth2/server.py @@ -138,8 +138,10 @@ def make_jwt_token_generator(app): class JsonAuthorizationServer(AuthorizationServer): + """An authorisation server using JSON rather than FORMDATA.""" def create_oauth2_request(self, request): + """Create an OAuth2 Request from the flask request.""" res = create_oauth_request(request, OAuth2Request, True) return res diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py index 19d3d9a..494fde9 100644 --- a/gn_auth/auth/authorisation/resources/views.py +++ b/gn_auth/auth/authorisation/resources/views.py @@ -46,7 +46,7 @@ from .models import ( unassign_resource_user, resource_category_by_id, user_roles_on_resources, unlink_data_from_resource, create_resource as _create_resource, get_resource_id) -from .groups.models import Group, resource_owner, group_role_by_id +from .groups.models import Group resources = Blueprint("resources", __name__) @@ -440,7 +440,7 @@ def resources_authorisation(): "Expected a JSON object with a 'resource-ids' key.") }) resp.status_code = 400 - except Exception as _exc: + except Exception as _exc:#pylint: disable=[broad-except] app.logger.debug("Generic exception.", exc_info=True) resp = jsonify({ "status": "general-exception", |