@@ -148,52 +148,12 @@ type RPCServerConfig struct {
148148 RPCTimeout ConfigDuration
149149}
150150
151- // OCSPUpdaterConfig provides the various window tick times and batch sizes needed
152- // for the OCSP (and SCT) updater
153- type OCSPUpdaterConfig struct {
154- ServiceConfig
155- DBConfig
156-
157- OldOCSPWindow ConfigDuration
158- RevokedCertificateWindow ConfigDuration
159-
160- OldOCSPBatchSize int
161- RevokedCertificateBatchSize int
162-
163- OCSPMinTimeToExpiry ConfigDuration
164- OCSPStaleMaxAge ConfigDuration
165- ParallelGenerateOCSPRequests int
166-
167- AkamaiBaseURL string
168- AkamaiClientToken string
169- AkamaiClientSecret string
170- AkamaiAccessToken string
171- AkamaiV3Network string
172- AkamaiPurgeRetries int
173- AkamaiPurgeRetryBackoff ConfigDuration
174-
175- SignFailureBackoffFactor float64
176- SignFailureBackoffMax ConfigDuration
177-
178- SAService * GRPCClientConfig
179- OCSPGeneratorService * GRPCClientConfig
180- AkamaiPurgerService * GRPCClientConfig
181-
182- Features map [string ]bool
183- }
184-
185151// SyslogConfig defines the config for syslogging.
186152type SyslogConfig struct {
187153 StdoutLevel int
188154 SyslogLevel int
189155}
190156
191- // StatsdConfig defines the config for Statsd.
192- type StatsdConfig struct {
193- Server string
194- Prefix string
195- }
196-
197157// ConfigDuration is just an alias for time.Duration that allows
198158// serialization to YAML as well as JSON.
199159type ConfigDuration struct {
@@ -270,92 +230,3 @@ type PortConfig struct {
270230 HTTPSPort int
271231 TLSPort int
272232}
273-
274- // CAADistributedResolverConfig specifies the HTTP client setup and interfaces
275- // needed to resolve CAA addresses over multiple paths
276- type CAADistributedResolverConfig struct {
277- Timeout ConfigDuration
278- MaxFailures int
279- Proxies []string
280- }
281-
282- // LogShard describes a single shard of a temporally sharded
283- // CT log
284- type LogShard struct {
285- URI string
286- Key string
287- WindowStart time.Time
288- WindowEnd time.Time
289- }
290-
291- // TemporalSet contains a set of temporal shards of a single log
292- type TemporalSet struct {
293- Name string
294- Shards []LogShard
295- }
296-
297- // Setup initializes the TemporalSet by parsing the start and end dates
298- // and verifying WindowEnd > WindowStart
299- func (ts * TemporalSet ) Setup () error {
300- if ts .Name == "" {
301- return errors .New ("Name cannot be empty" )
302- }
303- if len (ts .Shards ) == 0 {
304- return errors .New ("temporal set contains no shards" )
305- }
306- for i := range ts .Shards {
307- if ts .Shards [i ].WindowEnd .Before (ts .Shards [i ].WindowStart ) ||
308- ts .Shards [i ].WindowEnd .Equal (ts .Shards [i ].WindowStart ) {
309- return errors .New ("WindowStart must be before WindowEnd" )
310- }
311- }
312- return nil
313- }
314-
315- // pick chooses the correct shard from a TemporalSet to use for the given
316- // expiration time. In the case where two shards have overlapping windows
317- // the earlier of the two shards will be chosen.
318- func (ts * TemporalSet ) pick (exp time.Time ) (* LogShard , error ) {
319- for _ , shard := range ts .Shards {
320- if exp .Before (shard .WindowStart ) {
321- continue
322- }
323- if ! exp .Before (shard .WindowEnd ) {
324- continue
325- }
326- return & shard , nil
327- }
328- return nil , fmt .Errorf ("no valid shard available for temporal set %q for expiration date %q" , ts .Name , exp )
329- }
330-
331- // LogDescription contains the information needed to submit certificates
332- // to a CT log and verify returned receipts. If TemporalSet is non-nil then
333- // URI and Key should be empty.
334- type LogDescription struct {
335- URI string
336- Key string
337- SubmitFinalCert bool
338-
339- * TemporalSet
340- }
341-
342- // Info returns the URI and key of the log, either from a plain log description
343- // or from the earliest valid shard from a temporal log set
344- func (ld LogDescription ) Info (exp time.Time ) (string , string , error ) {
345- if ld .TemporalSet == nil {
346- return ld .URI , ld .Key , nil
347- }
348- shard , err := ld .TemporalSet .pick (exp )
349- if err != nil {
350- return "" , "" , err
351- }
352- return shard .URI , shard .Key , nil
353- }
354-
355- type CTGroup struct {
356- Name string
357- Logs []LogDescription
358- // How long to wait for one log to accept a certificate before moving on to
359- // the next.
360- Stagger ConfigDuration
361- }
0 commit comments