fix: Updated the domain field update function to decrypt and check the certificate expire#1075
Open
choonkeat1986 wants to merge 1 commit into
Open
fix: Updated the domain field update function to decrypt and check the certificate expire#1075choonkeat1986 wants to merge 1 commit into
choonkeat1986 wants to merge 1 commit into
Conversation
a92a025 to
e2c291c
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the domains Update use case to preserve existing certificate metadata while allowing certificate replacement with expiration validation, and adjusts unit tests to reflect the additional pre-fetch behavior.
Changes:
- Fetch the existing domain (with certificate data) before updating, and reuse existing cert fields unless a new cert is provided.
- When a new provisioning cert is provided, validate its expiration and (when available) update the cert in the configured cert store.
- Update
TestUpdatemocks to account for the new initialGetByNamecall.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/usecase/domains/usecase.go | Adds pre-fetch + certificate expiration validation and cert-store handling in Update. |
| internal/usecase/domains/usecase_test.go | Updates TestUpdate expectations for the added GetByName call. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1075 +/- ##
==========================================
+ Coverage 43.39% 43.65% +0.25%
==========================================
Files 141 141
Lines 13397 13434 +37
==========================================
+ Hits 5814 5864 +50
+ Misses 7022 7004 -18
- Partials 561 566 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e2c291c to
bb934a6
Compare
…e certificate expire
bb934a6 to
9b6f7d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
[x ] Unit Tests have been added for new changes
API tests have been updated if applicable
[x ] All commented code has been removed
If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.
What are you changing?
Fixing the issue on the domain certificate expire date after edit the existing domain profile and reupload the certificate.
#1019