Commit Graph

47 Commits

Author SHA1 Message Date
Jeremy Campbell
dc876fef16
Add x509 v3 CA Issuers Extension
Signed-off-by: Jeremy Campbell <jeremy.campbell@okta.com>
2023-11-16 12:45:16 -06:00
Tim Ramlot
e7530880ce
use Version 3 for all Certificates and Version 0 for all CertificateRequests
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-11 10:21:55 +02:00
Tim Ramlot
0cf0f80b40
switch to non-deprecated functions in source code
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-10 19:22:49 +02:00
Tim Ramlot
b999749854
improve gen.CSR and use it everywhere
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-11-10 09:21:31 +01:00
joshvanl
e804431dba Fire event for informational purposes when the CertificateRequest has not yet been approved.
Signed-off-by: joshvanl <me@joshvanl.dev>
2022-10-23 18:04:58 +01:00
Ashley Davis
3a055cc2f5
rename all uses of github.com/jetstack/cert-manager
This was done by running the following command twice:

 ```bash
 grep -Ri "github.com/jetstack/cert-manager" . | \
 cut -d":" -f1 | \
 sort | \
 uniq | \
 xargs sed -i
 "s/github.com\/jetstack\/cert-manager/github.com\/cert-manager\/cert-manager/"
 ```

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-02 09:08:31 +00:00
joshvanl
bd18c0ed86 Update CertificateRequest controllers to use new controller factory
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-27 12:51:49 +00:00
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
58a25314f7 Changes CR CA controller to use ECDSA keys
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-05-12 15:07:25 +01:00
joshvanl
ea2cfdc3c9 Updates CA issuer to updates SignCSRTemplate and propagate CA
certificate down

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-05-12 14:22:59 +01:00
Jake Sanders
eab7c954a2
Use %v to log errors
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-05 16:28:46 +01:00
Jake Sanders
bab9efaa8f
staticcheck: package imported more than once
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-04 14:58:23 +01:00
Jake Sanders
0625249fc7
errcheck: Error return value of controller.Register is not checked
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-04 14:14:48 +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
Maël Valais
f6cb6b8787 ocspServers test: give a link to the TODO issue
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-05 16:57:38 +01:00
Maël Valais
97893e1c69 PR comment: fix misspelling
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-05 16:42:48 +01:00
Maël Valais
0facd3bdd4 ocspServers field: fix flaky unit test
Truncating the time to the second did not seem to be enough. Some CI
builds would fail due to the truncation yielding different times.

Instead of truncating, I propose to use a delta of 1 second.

Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:20:51 +01:00
Maël Valais
e7b3e6c4e5 PR comment: no more "return" in test code
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Irbe Krumina <irbekrm@gmail.com>
2021-03-01 14:12:02 +01:00
Maël Valais
dc4f0a34e9 PR comment: compare time.Time instead of strings
Also removed the unused "givenNamespace"

Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Irbe Krumina <irbekrm@gmail.com>
2021-02-25 10:28:56 +01:00
Maël Valais
e50f26fc97 PR comment: fix notAfter test case using time.Truncate
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Irbe Krumina <irbekrm@gmail.com>
2021-02-24 15:07:54 +01:00
Maël Valais
c9dcae2313 ocspServers field: add unit test
Signed-off-by: Maël Valais <mael@vls.dev>
2021-02-24 11:05:59 +01: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
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
Josh Soref
81aaf3d7d2 spelling: signing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-02-24 17:20:49 -05:00
Josh Soref
08f7e24c74 spelling: invalid
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-02-24 16:43:19 -05:00
JoshVanL
b989f4e604
Remove cert-manager core issuers from marking CR as InvalidRequest
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-01-17 13:35:05 +00:00
JoshVanL
1c9557b729
Adds InvalidRequest condition set to CertificateRequest controllers
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-01-09 15:13:54 +00: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
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
JoshVanL
1814a09580 Update CA CR controller tests with now correct conditions
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-08-14 22:54:47 +01:00
JoshVanL
6e983fd7e6 Refactors CA cr controller to use sync
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-08-14 18:17:26 +01:00
JoshVanL
ea84dfdb2b Code organisation and cleaning up code
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-08-13 23:37:35 +01:00
JoshVanL
8be302dc10 Moves fake lister into /test and removes logging from reporter
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-08-01 13:44:19 +01:00
JoshVanL
480347aa26 Creates CR reporter util and updates ca_test.go
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-08-01 11:29:11 +01:00
James Munnelly
489feb3c30 Rename request->certificateRequest
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-25 16:35:23 +01:00
James Munnelly
c4b30cd837 Use test Builder directly in CA requests controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-25 16:18:03 +01:00
JoshVanL
a0d5793d9b Adds Recorder event tests to CA CR controller
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-07-23 18:18:44 +01:00
JoshVanL
f8c511a705 Address ca sign returning error
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-07-23 12:06:30 +01:00
JoshVanL
ab838197fc Move CA signer into ./pkg/controller/certificaterequests/ca
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-07-23 09:27:22 +01:00