Skip to content

Commit

Permalink
23504 - Fixing flake8.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfekete committed Oct 18, 2024
1 parent c50563a commit 5771d6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
9 changes: 3 additions & 6 deletions search-api/src/search_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ class UnitTestingConfig(Config): # pylint: disable=too-few-public-methods
'kty': 'RSA',
'alg': 'RS256',
'use': 'sig',
'n': 'AN-fWcpCyE5KPzHDjigLaSUVZI0uYrcGcc40InVtl-rQRDmAh-C2W8H4_Hxhr5VLc6crsJ2LiJTV_E72S03pzpOOaaYV6-TzAjCou2GYJIXev7f6Hh512PuG5wyxda_TlBSsI-gvphRTPsKCnPutrbiukCYrnPuWxX5_cES9eStR',
# noqa: E501
'n': 'AN-fWcpCyE5KPzHDjigLaSUVZI0uYrcGcc40InVtl-rQRDmAh-C2W8H4_Hxhr5VLc6crsJ2LiJTV_E72S03pzpOOaaYV6-TzAjCou2GYJIXev7f6Hh512PuG5wyxda_TlBSsI-gvphRTPsKCnPutrbiukCYrnPuWxX5_cES9eStR', # noqa: E501
'e': 'AQAB'
}
]
Expand All @@ -213,11 +212,9 @@ class UnitTestingConfig(Config): # pylint: disable=too-few-public-methods
'kty': 'RSA',
'alg': 'RS256',
'use': 'sig',
'n': 'AN-fWcpCyE5KPzHDjigLaSUVZI0uYrcGcc40InVtl-rQRDmAh-C2W8H4_Hxhr5VLc6crsJ2LiJTV_E72S03pzpOOaaYV6-TzAjCou2GYJIXev7f6Hh512PuG5wyxda_TlBSsI-gvphRTPsKCnPutrbiukCYrnPuWxX5_cES9eStR',
# noqa: E501
'n': 'AN-fWcpCyE5KPzHDjigLaSUVZI0uYrcGcc40InVtl-rQRDmAh-C2W8H4_Hxhr5VLc6crsJ2LiJTV_E72S03pzpOOaaYV6-TzAjCou2GYJIXev7f6Hh512PuG5wyxda_TlBSsI-gvphRTPsKCnPutrbiukCYrnPuWxX5_cES9eStR', # noqa: E501
'e': 'AQAB',
'd': 'C0G3QGI6OQ6tvbCNYGCqq043YI_8MiBl7C5dqbGZmx1ewdJBhMNJPStuckhskURaDwk4-8VBW9SlvcfSJJrnZhgFMjOYSSsBtPGBIMIdM5eSKbenCCjO8Tg0BUh_xa3CHST1W4RQ5rFXadZ9AeNtaGcWj2acmXNO3DVETXAX3x0',
# noqa: E501
'd': 'C0G3QGI6OQ6tvbCNYGCqq043YI_8MiBl7C5dqbGZmx1ewdJBhMNJPStuckhskURaDwk4-8VBW9SlvcfSJJrnZhgFMjOYSSsBtPGBIMIdM5eSKbenCCjO8Tg0BUh_xa3CHST1W4RQ5rFXadZ9AeNtaGcWj2acmXNO3DVETXAX3x0', # noqa: E501
'p': 'APXcusFMQNHjh6KVD_hOUIw87lvK13WkDEeeuqAydai9Ig9JKEAAfV94W6Aftka7tGgE7ulg1vo3eJoLWJ1zvKM',
'q': 'AOjX3OnPJnk0ZFUQBwhduCweRi37I6DAdLTnhDvcPTrrNWuKPg9uGwHjzFCJgKd8KBaDQ0X1rZTZLTqi3peT43s',
'dp': 'AN9kBoA5o6_Rl9zeqdsIdWFmv4DB5lEqlEnC7HlAP-3oo3jWFO9KQqArQL1V8w2D4aCd0uJULiC9pCP7aTHvBhc',
Expand Down
6 changes: 3 additions & 3 deletions search-api/src/search_api/resources/v2/payments/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def gcp_listener():
200 - on success or invalid message (do not return invalid message in the queue)
"""
ce = simple_queue.get_simple_cloud_event(request, wrapped=True)
if ce is None or ce.data is None or not 'id' in ce.data or not 'statusCode' in ce.data:
# current flow says if msg is inv alid, it should be ACKed to get out of the queue
if ce is None or ce.data is None or 'id' not in ce.data or 'statusCode' not in ce.data:
# current flow says if msg is invalid, it should be ACKed to get out of the queue
current_app.logger.error('Invalid Event Message Received: %s ', json.dumps(dataclasses.asdict(ce)))
return {}, HTTPStatus.OK

try:
credit_card_payment = ce.data
if credit_card_payment.get('corpTypeCode', '') != 'BUS':
raise Exception('invalid or missing corpTypeCode.') # noqa pylint: disable=broad-exception-raised
raise Exception('invalid or missing corpTypeCode.') # noqa: E713 # pylint: disable=broad-exception-raised
dar = DocumentAccessRequest.find_by_id(credit_card_payment['id'])
if not dar:
raise DbRecordNotFoundException()
Expand Down
4 changes: 1 addition & 3 deletions search-api/src/search_api/services/gcp_auth/auth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
import os

from http import HTTPStatus

from cachecontrol import CacheControl
from flask import abort, current_app, request
from requests.sessions import Session

from google.oauth2 import service_account
import google.auth.transport.requests
import google.oauth2.id_token as id_token # pylint: disable=consider-using-from-import
import google.oauth2.id_token as id_token # pylint: disable=consider-using-from-import

from search_api.services.gcp_auth.abstract_auth_service import AuthService

Expand Down

0 comments on commit 5771d6b

Please sign in to comment.