Skip to content
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

[FFM-8688] - Handle accountID as an optional field in the JWT token #157

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

andybharness
Copy link
Contributor

@andybharness andybharness commented Jul 18, 2023

FFM-8688 - Handle accountID as an optional field in the JWT token

What
Adding new unit tests + harden the existing JWT parsing code to handle information which may be optional when an ff-proxy is in use. If the info is not available the header will not be added. Also fixed env header to fall back to UUID when not present.

Why
The proxy doesn’t send accountID in the JWT token on auth, so we should make sure the code handles this correctly without bailing out when a proxy is in use.

Testing
New unit tests written + manual

What
Adding new unit tests + harden the existing JWT parsing code to handle information which may be optional when an ff-proxy is in use.
If the info is not available the header will not be added. Also fixed env header to fall back to UUID when not present.

Why
The proxy doesn’t send accountID in the JWT token on auth, so we should make sure the code handles this correctly without bailing out when a proxy is in use.

Testing
New unit tests written + manual
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 78.12% and project coverage change: -0.22 ⚠️

Comparison is base (5a5140d) 60.86% compared to head (2b9bf56) 60.65%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #157      +/-   ##
============================================
- Coverage     60.86%   60.65%   -0.22%     
- Complexity      356      362       +6     
============================================
  Files            31       31              
  Lines          1763     1779      +16     
  Branches        195      202       +7     
============================================
+ Hits           1073     1079       +6     
- Misses          540      546       +6     
- Partials        150      154       +4     
Impacted Files Coverage Δ
.../harness/cf/client/connector/HarnessConnector.java 69.83% <78.12%> (+0.36%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andybharness andybharness merged commit 14d3516 into main Jul 18, 2023
@andybharness andybharness deleted the FFM-8688-handle-optional-headers branch July 18, 2023 16:14
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