Add option to specify OCSP server #3497#3505
Add option to specify OCSP server #3497#3505jetstack-bot merged 6 commits intocert-manager:masterfrom
Conversation
|
Hi @hugoboos. Thanks for your PR. I'm waiting for a jetstack or cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
03a79c9 to
ecb19a1
Compare
|
/assign @jakexks |
|
/ok-to-test |
ecb19a1 to
d3f3ae0
Compare
|
/retest |
d3f3ae0 to
11353f2
Compare
wallrj
left a comment
There was a problem hiding this comment.
Thanks @hugoboos
You'll need to rebase and regenerate and update the copyright headers because we just merged a change to the boilerplate header.
If the OCSP value must be a URL, then we could add some API validation to avoid users setting a bad value here. See https://github.com/jetstack/cert-manager/blob/11353f2936c42f3b2bc91d62be969bf7efa9f50e/pkg/internal/apis/certmanager/validation/issuer_test.go
11353f2 to
334266c
Compare
|
Not sure what's the status of this PR, can we have it merged for v1.2 or should we bump it to v1.3? /assign @JoshVanL |
| // The OCSP responder can be queried for the revocation status of an issued certificate. | ||
| // If not set the certificate wil be issued without the OCSP server set. | ||
| // +optional | ||
| OCSPServer []string `json:"ocspServer,omitempty"` |
There was a problem hiding this comment.
This name is singular, but it's a slice? Should this be ocspServers?
There was a problem hiding this comment.
Aaah I know why it was using a singular name: the standard library's x509.go uses a singular name!
// RFC 5280, 4.2.2.1 (Authority Information Access)
OCSPServer []string
IssuingCertificateURL []stringThe RFC 5280 describe the authority information access field (= analogous to our ocspServer array) as (ASN.1-like syntax):
id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
AuthorityInfoAccessSyntax ::=
SEQUENCE SIZE (1..MAX) OF AccessDescription
AccessDescription ::= SEQUENCE {
accessMethod OBJECT IDENTIFIER,
accessLocation GeneralName }
id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
→ I renamed OCSPServer to OCSPServers, is that still OK?
There was a problem hiding this comment.
Yes, i have reused the naming from x509.go and the certificate.
There was a problem hiding this comment.
We did this previously (reused the names from x509 for some fields) and eventually moved away from it (e.g. 'organization -> organizations').
I think OCSPServers makes sense to me! 😄
|
Can we add a test case for this to ensure that it's being properly plumbed through? |
@munnerz Where do you think I could add a test? I'm not sure where 😅 |
Signed-off-by: Maël Valais <mael@vls.dev> Co-authored-by: James Munnelly <james@munnelly.eu>
|
/retest |
|
/retest Those pesky Venafi Cloud tests are still failing 😞 |
I think a unit test in the CA issuer code that ensures that given an issuer that configures I'd expect to see this in |
pkg/issuer/ca/setup_test.go
Outdated
| // TODO: How do I c.Issue()? The ca.CA struct only implements | ||
| // the Setup function, not the Issue function. |
There was a problem hiding this comment.
There was a problem hiding this comment.
I tried writing a new unit test in pkg/controller/certificaterequests/ca but I had no way to check that the oscpServers has been properly set in the resulting certificate.
I started to write a new unit test that does check the created certificate; you can see it on another branch (take a look at ca_test.go).
I have not finished and I really wish we could add this ocspServers feature to v1.2-alpha.2 we are going to release this morning
@munnerz What do you think? I will create a new issue "add unit test for ocspServers and crlDistributionPoints" and point to the existing branch I started
Signed-off-by: Maël Valais <mael@vls.dev> Co-authored-by: James Munnelly <james@munnelly.eu>
The reason I had to withdraw from writing this unit test is that the ca.CA type in pkg/issuer/ca does not implement the Sign function, which means I cannot test the Sign feature. I then tried to implement the same unit test to pkg/controller/certificaterequests/ca, but the existing unit test do not check the fields inside the produced certificate, which means I cannot ensure that the ocspServers fields has properly been applied to the certificate. I will write a proper unit test... a bit later. Signed-off-by: Maël Valais <mael@vls.dev> Co-authored-by: James Munnelly <james@munnelly.eu>
|
|
|
/lgtm |
|
/kind feature |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hugoboos, jakexks, wallrj The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Another task that I forgot to do as part of this PR: document the Still to be done:
|
What this PR does / why we need it:
Adds option to specify OCSP server on the CA issuer.
Which issue this PR fixes *:
fixes #3497
Special notes for your reviewer:
Release note: