Closed MDeLuise closed 3 weeks ago
Attention: Patch coverage is 0%
with 50 lines
in your changes missing coverage. Please review.
Project coverage is 16.78%. Comparing base (
70cbdd3
) to head (209709a
). Report is 6 commits behind head on develop.
Issue Overview: Creating a JWT Certificate in a child account was causing login failures for users attempting to access the REST API. This affected both users of the child account and users from other accounts.
Steps to Reproduce:
Current Behaviour:
Expected Behaviour:
Fix Implemented: Instead of querying the certificates and retrieving only one without specifying sorting (which defaulted to alphabetical order by name), the fix introduces significant changes:
Query All Certificates: The new implementation queries all of the user's certificates as well as the inherited ones. This comprehensive query ensures all potential JWT certificates are considered.
Determine the Nearest Certificate: A new function,
getNearestCertificate
, is introduced. This function processes the list of queried certificates to determine the nearest valid certificate. The functiongetNearestCertificateFromList
is then used to get the actual closest certificate, prioritizing the user's own JWT certificate if it exists, or the closest parent JWT certificate otherwise.This approach ensures that the most relevant JWT certificate is used for authentication.
Code Changes:
getNearestCertificate
function to query and process all relevant certificates.getNearestCertificateFromList
to select the nearest valid certificate from the list.Screen Sharing of the Fix: Screen sharing of the fix
Impact:
By merging this pull request, we ensure that the JWT Certificate creation process no longer disrupts the login functionality, providing a smoother and more secure user experience across all accounts.