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

proposal: remove clockwork dependency #15

Open
ericchiang opened this issue Dec 13, 2016 · 3 comments
Open

proposal: remove clockwork dependency #15

ericchiang opened this issue Dec 13, 2016 · 3 comments

Comments

@ericchiang
Copy link

ericchiang commented Dec 13, 2016

The current clockwork dependency is used in exactly one place.

type ValidationContext struct {
    CertificateStore X509CertificateStore
    IdAttribute      string
    Clock            *Clock
}

This can easily be replaced with a method for getting the current time.

type ValidationContext struct {
    CertificateStore X509CertificateStore
    IdAttribute      string
    // Now is used to determine the current time. If not provided, time.Now is used.
    Now func() time.Time
}

Basically what tls.Config does https://golang.org/pkg/crypto/tls/#Config

It's a breaking change so I wanted to see how y'all feel about it before sending a PR.

@russellhaering
Copy link
Owner

I'm open to that, I don't think it would break much. Is the goal just to reduce external dependencies?

@ericchiang
Copy link
Author

Is the goal just to reduce external dependencies?

Yep!

@phtdacosta
Copy link

How is the state of this change? Everything that reduces surface (prone to errors) is very welcome.

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

No branches or pull requests

3 participants