Skip to content

fix: added null or empty checks for basic auth credentials#98

Merged
asadali214 merged 4 commits intomainfrom
97-basic-auth-credentials-validation
May 3, 2024
Merged

fix: added null or empty checks for basic auth credentials#98
asadali214 merged 4 commits intomainfrom
97-basic-auth-credentials-validation

Conversation

@asadali214
Copy link
Copy Markdown
Collaborator

@asadali214 asadali214 commented May 3, 2024

What

This PR fixes a bug when username/password in CoreHelper.getBase64EncodedCredentials is null or empty, and encoded their combination.

Why

We need to fail the validation if an authentication parameter value is set to an empty string.

Closes #97

Type of change

Select multiple if applicable.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

Dependency Change

N/A

Breaking change

N/A

Testing

Unit tests are added to test the new functionality

Checklist

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

@asadali214 asadali214 added the bug Something isn't working label May 3, 2024
@asadali214 asadali214 requested a review from sufyankhanrao May 3, 2024 07:22
@asadali214 asadali214 self-assigned this May 3, 2024
Comment thread src/test/java/apimatic/core/utilities/CoreHelperTest.java Outdated
Comment thread src/test/java/apimatic/core/utilities/CoreHelperTest.java Outdated
@asadali214 asadali214 requested a review from sufyankhanrao May 3, 2024 07:35
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@asadali214 asadali214 merged commit e36b3fc into main May 3, 2024
@asadali214 asadali214 deleted the 97-basic-auth-credentials-validation branch May 3, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getBase64EncodedCredentials function in CoreHelper didn't check for empty values

2 participants