-
Notifications
You must be signed in to change notification settings - Fork 468
ACME Certificate Revocation #625
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
Conversation
Checking if this solves the issue with new linting issues that, at least locally, seem to have been introduced between v1.41.0 and latest (v1.43.0).
The logic for both test cases is fairly similar, but with some small differences. Made those clearer by means of some comments. Also added some comments to the middleware logic that decided whether to extract JWK or lookup by KID.
acme/api/handler.go
Outdated
extractPayloadByJWK := func(next nextHTTP) nextHTTP { | ||
return h.baseURLFromRequest(h.lookupProvisioner(h.addNonce(h.addDirLink(h.verifyContentType(h.parseJWS(h.validateJWS(h.extractJWK(h.verifyAndExtractJWSPayload(next))))))))) | ||
return validatingMiddleware(h.validateJWS(h.extractJWK(h.verifyAndExtractJWSPayload(next)))) |
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.
should ValidateJWS also be part of validateMiddleware?
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.
Good point 😅. I have to admit validatingMiddleware
is not that great of a name, as it does more than just that, but it works.
Fixed in 004fc05.
acme/api/revoke.go
Outdated
} | ||
|
||
// extractIdentifiers extracts ACME identifiers from an x509 certificate and | ||
// creates a map from them. The map ensures that double SANs are deduplicated. |
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.
double -> duplicated
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.
Fixed in 004fc05
acme/api/revoke.go
Outdated
} | ||
result[identifierKey(identifier)] = identifier | ||
} | ||
// TODO(hs): should we include the CommonName or not? |
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.
Seems like we can remove this comment.
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.
Fixed in 004fc05
As discussed in smallstep#767, we opted for not including this authorization flow to prevent users from getting OOMs. We can add the functionality back when the underlying data store can provide access to a long list of Authorizations more efficiently, for example when a callback is implemented.
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.
lgtm
This PR adds ACME certificate revocation as discussed in #468.
Basic revocation using either JWK or KID works. Needs error handling improvements and tests.