Skip to content

[ENGA3-297]: Fixed the issue of logging secret key in clear text.#55

Closed
aashishgurung wants to merge 1 commit intomasterfrom
feature/ENGA3-297
Closed

[ENGA3-297]: Fixed the issue of logging secret key in clear text.#55
aashishgurung wants to merge 1 commit intomasterfrom
feature/ENGA3-297

Conversation

@aashishgurung
Copy link
Copy Markdown

Objective

Fixed the issue of logging secret key in clear text.

Jira Ticket: #297

Description

The key to be displayed is stored in a new variable display_key. It will store the first 4 character in plain text and remaining characters are replaced by *.

Environments

  • Python: 3.10.6
  • Omise Python: 0.11.0

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment thread omise/request.py
Comment on lines +88 to +92

# Replacing characters with * other than the first 4 characters
display_key = self.api_key[:4] + (len(self.api_key) - 4)*'*'

logger.debug('Authorization: %s', display_key)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just remove logger.debug('Authorization: %s', self.api_key) on L88 and L111

@aashishgurung
Copy link
Copy Markdown
Author

Fixed the issue from another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants