-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for Contract Lines API #101
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,13 +204,13 @@ def __post_request(self, dict_body: dict, api_url: str): | |
control_status = response.get('control', {}).get('status', '') | ||
auth_status = response.get('operation', {}).get('authentication', {}).get('status', '') | ||
result_status = response.get('operation', {}).get('result', {}).get('status', '') | ||
|
||
|
||
if control_status == 'failure' or auth_status == 'failure' or result_status == 'failure': | ||
logger.info('Response for post request: %s', raw_response.text) | ||
else: | ||
logger.debug('Response for post request: %s', raw_response.text) | ||
|
||
if parsed_response['response']['control']['status'] == 'success': | ||
api_response = parsed_response['response']['operation'] | ||
|
||
|
@@ -255,7 +255,7 @@ def __post_request(self, dict_body: dict, api_url: str): | |
if 'result' in parsed_response: | ||
if 'errormessage' in parsed_response['result']: | ||
parsed_response = parsed_response['result']['errormessage'] | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct the key used when checking for 'errormessage' In the condition Apply this diff to fix the issue: -if 'errormessage' in parsed_response:
+if 'errormessage' in parsed_response['result']:
|
||
if 'response' in parsed_response: | ||
if 'errormessage' in parsed_response['response']: | ||
parsed_response = parsed_response['response']['errormessage'] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid logging sensitive data at 'info' level
Logging the entire
raw_response.text
at theinfo
level when a failure occurs may expose sensitive information in the logs. Consider logging only essential details or sanitizing the response before logging to prevent potential exposure of sensitive data.