goxmldsig icon indicating copy to clipboard operation
goxmldsig copied to clipboard

proposal: remove clockwork dependency

Open ericchiang opened this issue 8 years ago • 3 comments

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.

ericchiang avatar Dec 13 '16 23:12 ericchiang

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

russellhaering avatar Dec 15 '16 18:12 russellhaering

Is the goal just to reduce external dependencies?

Yep!

ericchiang avatar Dec 15 '16 18:12 ericchiang

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

phtdacosta avatar Oct 18 '22 18:10 phtdacosta