MCPcopy Create free account
hub / github.com/cloudflare/certmgr / UpdateIfNeeded

Method UpdateIfNeeded

cert/spec.go:219–231  ·  view source on GitHub ↗

UpdateIfNeeded performs a refresh only if PKI is in need of a refresh (expired, new CA, etc)

()

Source from the content-addressed store, hash-verified

217
218// UpdateIfNeeded performs a refresh only if PKI is in need of a refresh (expired, new CA, etc)
219func (spec *Spec) UpdateIfNeeded() error {
220 ca, err := spec.getCurrentCA()
221 if err != nil {
222 return err
223 }
224 err = spec.validateStoredPKI(ca)
225 if err == nil {
226 log.Debugf("spec %s is still valid", spec)
227 return nil
228 }
229 log.Infof("spec %s is needs refresh: %s", spec, err)
230 return spec.doRefresh(ca)
231}
232
233// ForceUpdate forces a refresh of the PKI content
234func (spec *Spec) ForceUpdate() error {

Callers 2

RunMethod · 0.95
ensureFunction · 0.80

Calls 3

getCurrentCAMethod · 0.95
validateStoredPKIMethod · 0.95
doRefreshMethod · 0.95

Tested by

no test coverage detected