56 Commits
Author SHA1 Message Date
Ashley Davis 68f5ceb3b4 Fix manually specified Certificate and CertificateRequest versions
Basically all modern X.509 certs are version 3, but confusingly to
specify "version 3" in an encoded cert, the version number is actually
2.

For PKCS#10 CSRs, the only valid version is 1, which again
confusingly has the value "0" when encoded.

This was incorrect in many places, including one place in which the
version number on a CSR was used as a certificate's version number,
when the two are entirely unrelated.

Go ignores these values, so there's no functional changes here; still,
it's better to be accurate.

Go ignoring CSR version and specifying 0:
https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/crypto/x509/x509.go;l=1958

Go ignoring Certificate version and specifying 2:
https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/crypto/x509/x509.go;l=1534

PKCS#10 CSR specification in RFC 2986 section 4.1:
https://datatracker.ietf.org/doc/html/rfc2986#section-4

X.509 Cert specification in RFC 5280 section 4.1.2.1:
https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.1

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-08-19 14:48:12 +01:00
joshvanl d69a4e1a3c Change ParseCertificateChain to ParseSingleCertificateChain
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-05-12 14:15:54 +01:00
joshvanl 1030bbadb5 Change Venafi Signer to use ParseCertificateChain to populate Status.CA
correctly

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-05-12 14:14:47 +01:00
Richard Wall c9eb75c447 Remove unused test-case field
pkg/controller/certificaterequests/venafi/venafi_test.go:787:2                           structcheck  `issuer` is unused

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-05-07 09:55:09 +01:00
Richard Wall c15d30742d Remove duplicate import
pkg/controller/certificaterequests/venafi/venafi_test.go:43:2: package "github.com/jetstack/cert-manager/pkg/controller/test" is being imported more than once (ST1019)
pkg/controller/certificaterequests/venafi/venafi_test.go:44:2: other import of "github.com/jetstack/cert-manager/pkg/controller/test"

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-05-04 14:50:37 +01:00
joshvanl e05adbf06b Remove expected events when Ready Denied condition set
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-04-09 18:20:07 +01:00
joshvanl 50a84eaf1d Sets the Ready condition to False when a request is Denied
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-04-09 15:34:32 +01:00
joshvanl 32d0c5af4e Updates Approved/Denied tests for new reasons
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-17 13:10:39 +00:00
joshvanl a3e63b1787 Update CertificateRequest controllers to use new Denied type, and add
tests for when a CertificateRequest is denied

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-17 13:10:39 +00:00
joshvanl e62e8c517b Updates CertificateRequest signer tests to check Approved behaviour
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-17 13:10:39 +00:00
Richard Wall 50a388a8a1 Fix unit tests
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-20 14:26:43 +00:00
Richard Wall 95d26b7c60 Extract the CA from Venafi response
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-20 14:14:48 +00:00
Maartje Eyskens ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +01:00
Maartje Eyskens 1788a9d758 Update copyright to cert-manager project
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 19:04:49 +01:00
Richard Wall f3f321bbbc Update to vcert v4.11.0
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-10-08 15:02:50 +01:00
Richard Wall 55514f048c Move Venafi Pickup ID annotation key to the external API package
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-21 10:27:47 +01:00
Richard Wall 81eb53f597 ./hack/update-all.sh
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:06 +01:00
Richard Wall a70298180a Run a script to update v1alpha2 usage to v1
Script is available at https://github.com/jetstack/cert-manager/pull/3201

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:26:51 +01:00
Maartje Eyskens 827ce9c5ad Revert log levels on errors
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens 86dee5ed41 Set error log levels
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens fecd0b3518 Set all log levels for info
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens 657a410178 Fix tests
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-10 16:20:50 +02:00
Maartje Eyskens 7c01c74b90 Move annotation update logic
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-10 11:05:07 +02:00
Maartje Eyskens e952560810 implement review feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-07 14:16:29 +02:00
Maartje EyskensandJames Munnelly 35365b79c9 Use venafi.cert-manager.io/pickup-id
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-02 10:04:21 +01:00
Maartje EyskensandJames Munnelly 00d37aa21d Make wait timeout error less alarming
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-02 10:04:21 +01:00
Maartje EyskensandJames Munnelly b81a0af6f8 Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-02 10:04:21 +01:00
Maartje EyskensandJames Munnelly 63c66ee415 Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-02 10:04:21 +01:00
Maartje EyskensandJames Munnelly ca5361d79d Make unit tests work
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-02 10:04:21 +01:00
Maartje EyskensandJames Munnelly ac9895d91b Make Venafi issuer async
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-07-02 10:04:21 +01:00
Maartje Eyskens d40f010180 Error on an invalid custom field type
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-12 11:34:28 +01:00
Maartje Eyskens 1ebc9ef56b Properly sort imports
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-12 10:29:10 +01:00
Maartje Eyskens 292d7f1e61 Update vcert
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-07 09:19:24 +01:00
Maartje Eyskens 1eb4fc6846 Create internalvanafiapi to prevent cyclic imports
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-06 11:11:37 +01:00
Maartje Eyskens e040d4f284 Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-06 10:32:06 +01:00
Maartje Eyskens 15b9a940e7 Add tests for custom fields inside internal/venafi
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-05 16:14:49 +01:00
Maartje Eyskens ae742c588e Add tests for custom fields inside certificaterequest controller
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-05 15:36:30 +01:00
Maartje Eyskens 93f0cfa717 Use internal CustomField to add json tags
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-05 14:12:16 +01:00
Maartje Eyskens 42f3bca6ef Move annotation to apis
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-05 14:08:41 +01:00
Maartje Eyskens 6ecc07ba26 Update bazel
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-04 15:37:40 +01:00
Maartje Eyskens 4452fbd9a8 Add venafi.cert-manager.io/custom-fields annnotation
This adds the venafi.cert-manager.io/custom-fields annotation to CertificateRequest.
The JSON decoded value of this annotation will be passed to the Venafi customfields on signing.

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-02-04 15:15:43 +01:00
Joshua Mathianas cc802cc16e made code review changes
Signed-off-by: Joshua Mathianas <mathianasj@gmail.com>
2020-01-17 07:31:25 -05:00
Joshua Mathianas eed8f67587 fixed which namespace to find secret in based on if its a clusterissuer for venafi
Signed-off-by: Joshua Mathianas <mathianasj@gmail.com>
2020-01-16 12:19:49 -05:00
JoshVanL de7aaa84d3 Update CertificateRequest controller unit tests
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-11-19 22:09:01 +00:00
JoshVanL 94d077a5fb Adds status sub resource and changes updates
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-09-30 13:47:50 +01:00
James Munnelly 973f4aa424 Update codebase for external dependencies
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-09-26 12:52:43 +01:00
James Munnelly bf9fbea23f Update codebase for new meta apigroup
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-09-20 19:25:04 +01:00
James Munnelly 58754abf37 Refactor codebase for v1alpha2
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-09-20 16:22:43 +01:00
James Munnelly 1b8a286206 Rename Setup->Init and use Start to start informers
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-08-22 13:11:33 +01:00
James Munnelly 6052e0558e Refactor base controller and allow Running additional informers
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-08-21 13:22:57 +01:00