client

package
v0.0.0-...-cc9bb6a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	ShardHint        uint64
	Signature        types.Signature
	KeyHash          types.Hash
	InclusionProof   types.InclusionProof
	CosignedTreeHead types.CosignedTreeHead
}

TODO: should signature+key_hash (not) be in bundle?

func (*Bundle) FromASCII

func (b *Bundle) FromASCII(r io.Reader) error

func (*Bundle) ToASCII

func (b *Bundle) ToASCII(w io.Writer) error

func (*Bundle) Verify

func (b *Bundle) Verify(k *types.PublicKey, p *policy.Policy, r io.Reader) error

type SubmitClient

type SubmitClient struct {
	// contains filtered or unexported fields
}

func NewSubmitClient

func NewSubmitClient(policy policy.Policy) *SubmitClient

func (*SubmitClient) AddLeaves

func (sc *SubmitClient) AddLeaves(_ context.Context, leaves []requests.Leaf) ([]Bundle, error)

TODO: feedback on the below sketch; improve it; implement properly. 0. Select one log in policy, setup API network client. 1. Loop over all leaves that have yet to received 200 OK. Move on to the next leaf on a non-200 status code, trying again next itteration. 3. Try to fetch an inclusion proof for the latest HTTP 200 OK response every time a new cosigned tree head becomes available. Output warning if more than two cosigned tree heads pass. 4. Loop over all leaves and fetch inclusion proofs for X. [Exit with error if any inclusion proof is not available / invalid] 5. Return bundles in the same order as leaves were passed.

type Submitter

type Submitter interface {
	AddLeaves(context.Context, []requests.Leaf) ([]Bundle, error)
}

Directories

Path Synopsis
package api implements the Sigsum v0 API.
package api implements the Sigsum v0 API.

Jump to

Keyboard shortcuts

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