-
Notifications
You must be signed in to change notification settings - Fork 23
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
add support for ecdsa keys #28
add support for ecdsa keys #28
Conversation
6f6f36e
to
362411d
Compare
Hi. Thanks for the contribution!! This looks great! May I suggest a few other unit tests:
I used Creating coverage.html for a PRgo install github.com/Azure/gocover@latest
gh pr checkout 28
go test ./... -coverprofile=cover.out
gocover diff --repository-path=$PWD --cover-profile=cover.out --compare-branch=origin/main |
Thanks for the feedback @maelvls ! I will work on addressing those things today. |
I added the events in 6c628c9 and updated the tests to ensure we are getting the expected private key format in 5790859 I noticed there are no tests for |
Hi @maelvls I believe I have addressed the requested changes for this PR. |
Hey, sorry for the delay! I will take a look on Monday (it's Friday 19:56 now and I want to go home lol) Note: I'll be on PTO from Tue 27 June to Sun 23 July. Please ping another maintainer (such as |
Hey, sorry for the lack of unit tests on Preferably, we would first write the missing unit tests for Given that you have already spent a lot of time working on this PR, I'd understand if you would prefer merging this PR first and then write the new unit tests in another PR. What do you think? |
Signed-off-by: Vinny Sabatini <[email protected]>
Signed-off-by: Vinny Sabatini <[email protected]>
Signed-off-by: Vinny Sabatini <[email protected]>
Signed-off-by: Vinny Sabatini <[email protected]>
5790859
to
7949fd4
Compare
No problem about the missing tests. I have no opposition to adding additional test coverage for that before this PR is merged. It looks like #27 added some tests I think I can build on top of which helps a lot. I will work on adding coverage for my changes, making sure the PR checks pass, and then will reach out for a review. Thanks! |
Signed-off-by: Vinny Sabatini <[email protected]>
f302ded
to
d79e75a
Compare
I am not positive what is causing the failed test case at this point, still looking into it Signed-off-by: Vinny Sabatini <[email protected]>
} else if tt.wantCSR.PublicKeyAlgorithm == x509.RSA { | ||
privateKey = rsaKey | ||
} | ||
csr, err := x509.CreateCertificateRequest(rand.Reader, tt.wantCSR, privateKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was working well with the RSA signature algorithm, but comparing the two signatures will fail with ECDSA since the signatures depend on a random number.
It is probably why the test TestRoute_buildNextCR/With_ECDSA_private_key_algorithm_annotation
is failing 😅
I imagine that (for the ECDSA test specifically) we can simply check that the "rest" of the CSR is the same without checking the signature
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip @maelvls! It does seem like that is the cause of that test failing. I'll try to update that test accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I updated the test to cover the ECDSA use case and the rest of the PR is ready for review whenever you have time @maelvls, thanks again for the suggestion 😄
Signed-off-by: Vinny Sabatini <[email protected]>
Excellent work, thank you so much for contributing this feature!! 🙏 Let's create a new release with you feature on Monday! I think there are a few changes that haven't been released yet too. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maelvls The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This upgrades cert-manager/cert-manager to v1.12.1 in order to use the
PrivateKeyAlgorithmAnnotationKey
released in v1.9.0.I believe this would close out #15