Skip to content

put options to validate certs in an object #90

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

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

phbnf
Copy link
Collaborator

@phbnf phbnf commented Jan 17, 2025

Towards #5

This PR puts settings related to chain validation into their own object.

@phbnf phbnf requested review from roger2hk and AlCutter January 17, 2025 10:30
@phbnf phbnf marked this pull request as ready for review January 17, 2025 10:32
config.go Outdated
type ChainValidationConfig struct {
// Path to the file containing root certificates that are acceptable to the
// log. The certs are served through get-roots endpoint.
RootsPemFile string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmd/gcp/main.go Outdated
if err != nil {
klog.Exitf("Failed to create checkpoint signer: %v", err)
klog.Exitf("Failed to initialize log config: %v", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
klog.Exitf("Failed to initialize log config: %v", err)
klog.Exitf("Invalid log config: %v", err)

cmd/gcp/main.go Outdated
if err != nil {
klog.Exitf("Invalid config: %v", err)
klog.Exitf("Failed to initiate storage backend: %v", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
klog.Exitf("Failed to initiate storage backend: %v", err)
klog.Exitf("Failed to initialize storage backend: %v", err)

config.go Outdated
@@ -29,6 +29,35 @@ import (
"k8s.io/klog/v2"
)

type ChainValidationConfig struct {
// Path to the file containing root certificates that are acceptable to the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit on doc comments in this struct - they should really start with the name of the thing being commented on, e.g. "RootsPEMFile is the path to a file con..."

Probably worth a comment on the struct too since it's exported?

config.go Outdated
Comment on lines 36 to 42
// If RejectExpired is true then the certificate validity period will be
// checked against the current time during the validation of submissions.
// This will cause expired certificates to be rejected.
RejectExpired bool
// If RejectUnexpired is true then CTFE rejects certificates that are either
// currently valid or not yet valid.
RejectUnexpired bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but do we still need RejectUnexpired?
And if not, would the user setting NotAfterStart or NotAfterLimit to non-nil values be enough?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a TODO. It's currently used by daedalus.

@phbnf phbnf merged commit aed7a8b into transparency-dev:main Jan 17, 2025
7 checks passed
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