fix: backport RSA key encoding (#148) and log-file output (#152) to release-0.17#153
Merged
JoshVanL merged 2 commits intodapr:release-0.17from Apr 9, 2026
Merged
Conversation
…pr#148) * fix: support RSA key encoding in EncodePrivateKey EncodePrivateKey only handled *ecdsa.PrivateKey and ed25519.PrivateKey, rejecting RSA keys with "unsupported key type". Since RSA keys also use x509.MarshalPKCS8PrivateKey with the same PKCS#8 block type, add *rsa.PrivateKey to the existing case list. Adds table-driven tests covering RSA-2048, RSA-4096, ECDSA P-256, Ed25519, and unsupported type with roundtrip verification through DecodePEMPrivateKey. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * fix: address review feedback - Drop RSA-4096 test case to avoid slow CI (2048 is sufficient coverage) - Replace custom containsSubstr/searchSubstr with strings.Contains - Remove unused helper functions Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> --------- Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
* feat: add OutputFile option for log destination in logger Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com> * feat: add file output support for logging Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com> * lint Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com> * add cleanup for file output logger in options tests Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com> * fix: address review feedback for log file output - Relax file permissions from 0600 to 0644 to allow reads (per Albert's review) - Track open log file handle in package-level state protected by mutex to prevent FD leaks when ApplyOptionsToLoggers is called multiple times - Close previous log file before opening a new one on re-apply - Revert output to stdout when OutputFile is empty (handles config reload) - Extract setLogOutput helper for clarity - Add TestApplyOptionsToLoggersFileOutputReapply test verifying re-apply closes the previous file and switches to the new one Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * fix: improve error handling and output file management in logging Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com> * fix: address Copilot review — atomic file swap and early test cleanup - Open new log file before closing the old one so loggers are never left pointing at a closed FD if OpenFile fails - Register t.Cleanup immediately after ApplyOptionsToLoggers to prevent FD leaks on assertion failures Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> --------- Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com> Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-authored-by: Nelson Parente <nelson_parente@live.com.pt>
JoshVanL
approved these changes
Apr 9, 2026
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.
Summary
Cherry-picks two merged PRs from
mainontorelease-0.17for av0.17.1patch release:fd4e38618c6fce