Documentation
¶
Overview ¶
Package stfe implements a System Transparency Front-End (STFE) personality for the Trillian log server gRPC API.
Index ¶
- Constants
- func NewNodePathFromHashPath(hashes [][]byte) []types.NodeHash
- func NewStItemListFromLeaves(leaves []*trillian.LogLeaf) (*types.StItemList, error)
- func NewTreeHeadV1FromLogRoot(lr *ttypes.LogRootV1) *types.TreeHeadV1
- type ActiveSthSource
- func (s *ActiveSthSource) AddCosignature(_ context.Context, costh *types.StItem) error
- func (s *ActiveSthSource) Cosigned(_ context.Context) (*types.StItem, error)
- func (s *ActiveSthSource) Latest(ctx context.Context) (*types.StItem, error)
- func (s *ActiveSthSource) Run(ctx context.Context)
- func (s *ActiveSthSource) Stable(_ context.Context) (*types.StItem, error)
- type Endpoint
- type Handler
- type Instance
- type LogParameters
- type SthSource
Constants ¶
const ( EndpointAddEntry = Endpoint("add-entry") EndpointAddCosignature = Endpoint("add-cosignature") EndpointGetLatestSth = Endpoint("get-latest-sth") EndpointGetStableSth = Endpoint("get-stable-sth") EndpointGetCosignedSth = Endpoint("get-cosigned-sth") EndpointGetProofByHash = Endpoint("get-proof-by-hash") EndpointGetConsistencyProof = Endpoint("get-consistency-proof") EndpointGetEntries = Endpoint("get-entries") )
Variables ¶
This section is empty.
Functions ¶
func NewNodePathFromHashPath ¶
func NewStItemListFromLeaves ¶
func NewStItemListFromLeaves(leaves []*trillian.LogLeaf) (*types.StItemList, error)
func NewTreeHeadV1FromLogRoot ¶
func NewTreeHeadV1FromLogRoot(lr *ttypes.LogRootV1) *types.TreeHeadV1
Types ¶
type ActiveSthSource ¶
type ActiveSthSource struct {
// contains filtered or unexported fields
}
ActiveSthSource implements the SthSource interface for an STFE instance that accepts new logging requests, i.e., the log is running in read+write mode.
func NewActiveSthSource ¶
func NewActiveSthSource(cli trillian.TrillianLogClient, lp *LogParameters) (*ActiveSthSource, error)
NewActiveSthSource returns an initialized ActiveSthSource
func (*ActiveSthSource) AddCosignature ¶
func (*ActiveSthSource) Run ¶
func (s *ActiveSthSource) Run(ctx context.Context)
type Handler ¶
type Handler struct {
Instance *Instance
Endpoint Endpoint
Method string
Handler func(context.Context, *Instance, http.ResponseWriter, *http.Request) (int, error)
}
Handler implements the http.Handler interface, and contains a reference to an STFE server instance as well as a function that uses it.
type Instance ¶
type Instance struct {
Client trillian.TrillianLogClient
LogParameters *LogParameters
SthSource SthSource
}
Instance is an instance of the system transparency front-end
type LogParameters ¶
type LogParameters struct {
LogId *types.Namespace // log identifier
LogIdBytes []byte // serialized log id
LogIdStr string // serialized log id (hex)
TreeId int64 // used internally by Trillian
Prefix string // e.g., "test" for <base>/test
MaxRange int64 // max entries per get-entries request
SubmitterPolicy bool // if we have a submitter policy (true means that namespaces must be registered)
WitnessPolicy bool // if we have a witness policy (true means that namespaces must be registered)
Submitters *types.NamespacePool // trusted submitters
Witnesses *types.NamespacePool // trusted witnesses
Deadline time.Duration // gRPC deadline
Interval time.Duration // cosigning sth frequency
HashType crypto.Hash // hash function used by Trillian
Signer crypto.Signer // access to Ed25519 private key
}
LogParameters is a collection of log parameters
func NewLogParameters ¶
func NewLogParameters(signer crypto.Signer, logId *types.Namespace, treeId int64, prefix string, submitters, witnesses *types.NamespacePool, maxRange int64, interval, deadline time.Duration, submitterPolicy, witnessPolicy bool) (*LogParameters, error)
NewLogParameters creates newly initialized log parameters
func (*LogParameters) SignTreeHeadV1 ¶
func (lp *LogParameters) SignTreeHeadV1(th *types.TreeHeadV1) (*types.StItem, error)
SignTreeHeadV1 signs a TreeHeadV1 structure
type SthSource ¶
type SthSource interface {
// Latest returns the most reccent signed_tree_head_v*.
Latest(context.Context) (*types.StItem, error)
// Stable returns the most recent signed_tree_head_v* that is stable for
// some period of time, e.g., 10 minutes.
Stable(context.Context) (*types.StItem, error)
// Cosigned returns the most recent cosigned_tree_head_v*.
Cosigned(context.Context) (*types.StItem, error)
// AddCosignature attempts to add a cosignature to the stable STH. The
// passed cosigned_tree_head_v* must have a single verified cosignature.
AddCosignature(context.Context, *types.StItem) error
// Run keeps the STH source updated until cancelled
Run(context.Context)
}
SthSource provides access to the log's STHs.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd/add-entry
command
|
|
|
cmd/get-consistency-proof
command
|
|
|
cmd/get-entries
command
|
|
|
cmd/get-proof-by-hash
command
|
|
|
cmd/get-sth
command
|
|
|
Package main provides an STFE server binary
|
Package main provides an STFE server binary |
|
cmd/new-namespace
command
Package main outputs the private and public parts of a new namespace
|
Package main outputs the private and public parts of a new namespace |