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

Search SubjectAlternativeNames when finding cert #529

Merged
merged 1 commit into from Feb 3, 2023

Conversation

tomsaleeba
Copy link
Contributor

@tomsaleeba tomsaleeba commented Nov 26, 2022

Fixes (no ticket)

Description of Issue Fixed

  • cert alt names are not searched

Changes proposed in this pull request:

  • search alt names when "searching by domain"
  • remove code around expired certs as it's no longer needed (we filter the statuses instead)

remove expired cert check as we don't need it now we have a cert status filter, add tests
@sonarcloud
Copy link

sonarcloud bot commented Nov 26, 2022

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

}
return null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the code around checking for expired certs because we don't need it with the cert status filter on line 6. Then I refactored what was left of the code.

I completely removed the call to describeCertificate because I realised all the details are already available from the summary list, so the extra API call is redundant.

for (const currCert of certificates) {
const allDomainsForCert = [
currCert.DomainName,
...(currCert.SubjectAlternativeNameSummaries || []),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where we include alt names in the search.

return;
}
throw new Error("Programmer error: didn't add new test mock data");
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't need this because it was related to the separate API call to check expiries.

@tomsaleeba tomsaleeba marked this pull request as ready for review November 26, 2022 01:13
@rddimon rddimon merged commit b302dcf into amplify-education:master Feb 3, 2023
@tomsaleeba tomsaleeba deleted the alt-name branch February 21, 2023 18:28
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.

None yet

2 participants