Skip to content
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

Rename pki.Validate to pki.CheckCRL for clarity on its purpose #3586

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

gerardsn
Copy link
Member

@gerardsn gerardsn commented Dec 3, 2024

No description provided.

@reinkrul
Copy link
Member

reinkrul commented Dec 3, 2024

Go style would be CheckCrl

@gerardsn
Copy link
Member Author

gerardsn commented Dec 4, 2024

https://go.dev/wiki/CodeReviewComments disagrees

Words in names that are initialisms or acronyms (e.g. “URL” or “NATO”) have a consistent case. For example, “URL” should appear as “URL” or “url” (as in “urlPony”, or “URLPony”), never as “Url”. As an example: ServeHTTP not ServeHttp. For identifiers with multiple initialized “words”, use for example “xmlHTTPRequest” or “XMLHTTPRequest”.

This rule also applies to “ID” when it is short for “identifier” (which is pretty much all cases when it’s not the “id” as in “ego”, “superego”), so write “appID” instead of “appId”.

Code generated by the protocol buffer compiler is exempt from this rule. Human-written code is held to a higher standard than machine-written code.

the linter doesn't know it's an acronym though

@tomelfring
Copy link

Just curious as I digged through this method to debug #3583, is CheckCRL really the only intended feature of this method? It does also check if the certificate is on a denylist (arguably some kind of CRL):

if v.denylist != nil {

And if the certificate is known in the truststore:

issuer, ok = v.getCert(cert.Issuer.String())

To me it looks like it does more than just a certificate revocation check.

@reinkrul
Copy link
Member

reinkrul commented Dec 4, 2024

https://go.dev/wiki/CodeReviewComments disagrees

Words in names that are initialisms or acronyms (e.g. “URL” or “NATO”) have a consistent case. For example, “URL” should appear as “URL” or “url” (as in “urlPony”, or “URLPony”), never as “Url”. As an example: ServeHTTP not ServeHttp. For identifiers with multiple initialized “words”, use for example “xmlHTTPRequest” or “XMLHTTPRequest”.
This rule also applies to “ID” when it is short for “identifier” (which is pretty much all cases when it’s not the “id” as in “ego”, “superego”), so write “appID” instead of “appId”.
Code generated by the protocol buffer compiler is exempt from this rule. Human-written code is held to a higher standard than machine-written code.

the linter doesn't know it's an acronym though

Oh... I'm almost sure someone pointed that out to me, but I can't remember now 🤦

@gerardsn
Copy link
Member Author

gerardsn commented Dec 5, 2024

@tomelfring

Just curious as I digged through this method to debug #3583, is CheckCRL really the only intended feature of this method? It does also check if the certificate is on a denylist (arguably some kind of CRL):

The denylist is a CRL under control of the user instead of the issuer. It should not be used but exists in case we need it in the future.

And if the certificate is known in the truststore:

We need this certificate to validate the signature on the CRL. So it is more a lookup of a trusted key than confirming the issuer is in the truststore. The trustchain is verified outside of this module and that is one of the reasons I wanted to change the name.

@gerardsn gerardsn merged commit f8410bc into master Dec 5, 2024
9 checks passed
@gerardsn gerardsn deleted the rename-pki-Validate-to-CheckCRL branch December 5, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants