loglist

package
v0.0.0-...-d42865c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Informational purpose = "info"

Informational means that the new log list can contain Usable, Qualified, and Pending logs, which will all accept submissions but not necessarily be trusted by Chrome clients.

View Source
const Issuance purpose = "scts"

Issuance means that the new log list should only contain Usable logs, which can issue SCTs that will be trusted by all Chrome clients.

View Source
const Validation purpose = "lint"

Validation means that the new log list should only contain Usable and Readonly logs, whose SCTs will be trusted by all Chrome clients but aren't necessarily still issuing SCTs today.

Variables

This section is empty.

Functions

func InitLintList

func InitLintList(path string) error

InitLintList creates and stores a loglist intended for linting (i.e. with purpose Validation). We have to store this in a global because the zlint framework doesn't (yet) support configuration, so the e_scts_from_same_operator lint cannot load a log list on its own. Instead, we have the CA call this initialization function at startup, and have the lint call the getter below to get access to the cached list.

Types

type List

type List map[string]OperatorGroup

List represents a list of logs, grouped by their operator, arranged by the "v3" schema as published by Chrome: https://www.gstatic.com/ct/log_list/v3/log_list_schema.json It exports no fields so that consumers don't have to deal with the terrible autogenerated names of the structs it wraps.

func GetLintList

func GetLintList() List

GetLintList returns the log list initialized by InitLintList. This must only be called after InitLintList has been called on the same (or parent) goroutine.

func New

func New(path string) (List, error)

New returns a LogList of all operators and all logs parsed from the file at the given path. The file must conform to the JSON Schema published by Google: https://www.gstatic.com/ct/log_list/v3/log_list_schema.json

func (List) OperatorForLogID

func (ll List) OperatorForLogID(logID string) (string, error)

OperatorForLogID returns the Name of the Group containing the Log with the given ID, or an error if no such log/group can be found.

func (List) Permute

func (ll List) Permute() []string

Permute returns the list of operator group names in a randomized order.

func (List) PickOne

func (ll List) PickOne(operator string, expiry time.Time) (string, string, error)

PickOne returns the URI and Public Key of a single randomly-selected log which is run by the given operator and whose temporal interval includes the given expiry time. It returns an error if no such log can be found.

func (List) SubsetForPurpose

func (ll List) SubsetForPurpose(names []string, p purpose) (List, error)

SubsetForPurpose returns a new log list containing only those logs whose names match those in the given list, and whose state is acceptable for the given purpose. It returns an error if any of the given names are not found in the starting list, or if the resulting list is too small to satisfy the Chrome "two operators" policy.

type Log

type Log struct {
	Name           string
	Url            string
	Key            string
	StartInclusive time.Time
	EndExclusive   time.Time
	State          state
}

Log represents a single log run by an operator. It contains just the info necessary to contact a log, and to determine whether that log will accept the submission of a certificate with a given expiration.

type OperatorGroup

type OperatorGroup map[string]Log

OperatorGroup represents a group of logs which are all run by the same operator organization. It provides constant-time lookup of logs within the group by their unique ID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL