http

package
v0.0.0-...-d12bbc4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0, Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package http contains private implementation details for the FirmwareTransparency personality server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAS

type CAS interface {
	// Store puts the image under the key.
	Store([]byte, []byte) error

	// Retrieve gets a binary image that was previously stored.
	// Must return status code NotFound if no such image exists.
	Retrieve([]byte) ([]byte, error)
}

CAS is the interface to the Content Addressable Store for firmware images.

type MockTrillian

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

MockTrillian is a mock of Trillian interface.

func NewMockTrillian

func NewMockTrillian(ctrl *gomock.Controller) *MockTrillian

NewMockTrillian creates a new mock instance.

func (*MockTrillian) AddSignedStatement

func (m *MockTrillian) AddSignedStatement(arg0 context.Context, arg1 []byte) error

AddSignedStatement mocks base method.

func (*MockTrillian) ConsistencyProof

func (m *MockTrillian) ConsistencyProof(arg0 context.Context, arg1, arg2 uint64) ([][]byte, error)

ConsistencyProof mocks base method.

func (*MockTrillian) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTrillian) FirmwareManifestAtIndex

func (m *MockTrillian) FirmwareManifestAtIndex(arg0 context.Context, arg1, arg2 uint64) ([]byte, [][]byte, error)

FirmwareManifestAtIndex mocks base method.

func (*MockTrillian) InclusionProofByHash

func (m *MockTrillian) InclusionProofByHash(arg0 context.Context, arg1 []byte, arg2 uint64) (uint64, [][]byte, error)

InclusionProofByHash mocks base method.

func (*MockTrillian) Root

func (m *MockTrillian) Root() *types.LogRootV1

Root mocks base method.

type MockTrillianMockRecorder

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

MockTrillianMockRecorder is the mock recorder for MockTrillian.

func (*MockTrillianMockRecorder) AddSignedStatement

func (mr *MockTrillianMockRecorder) AddSignedStatement(arg0, arg1 interface{}) *gomock.Call

AddSignedStatement indicates an expected call of AddSignedStatement.

func (*MockTrillianMockRecorder) ConsistencyProof

func (mr *MockTrillianMockRecorder) ConsistencyProof(arg0, arg1, arg2 interface{}) *gomock.Call

ConsistencyProof indicates an expected call of ConsistencyProof.

func (*MockTrillianMockRecorder) FirmwareManifestAtIndex

func (mr *MockTrillianMockRecorder) FirmwareManifestAtIndex(arg0, arg1, arg2 interface{}) *gomock.Call

FirmwareManifestAtIndex indicates an expected call of FirmwareManifestAtIndex.

func (*MockTrillianMockRecorder) InclusionProofByHash

func (mr *MockTrillianMockRecorder) InclusionProofByHash(arg0, arg1, arg2 interface{}) *gomock.Call

InclusionProofByHash indicates an expected call of InclusionProofByHash.

func (*MockTrillianMockRecorder) Root

func (mr *MockTrillianMockRecorder) Root() *gomock.Call

Root indicates an expected call of Root.

type Server

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

Server is the core state & handler implementation of the FT personality.

func NewServer

func NewServer(c Trillian, cas CAS, signer note.Signer) *Server

NewServer creates a new server that interfaces with the given Trillian logger.

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers(r *mux.Router)

RegisterHandlers registers HTTP handlers for firmware transparency endpoints.

type Trillian

type Trillian interface {
	// AddSignedStatement adds the statement to the log if it isn't already present.
	AddSignedStatement(ctx context.Context, data []byte) error

	// Root returns the most recent root seen by this client.
	Root() *types.LogRootV1

	// ConsistencyProof gets the consistency proof between two given tree sizes.
	ConsistencyProof(ctx context.Context, from, to uint64) ([][]byte, error)

	// FirmwareManifestAtIndex gets the value at the given index and an inclusion proof
	// to the given tree size.
	FirmwareManifestAtIndex(ctx context.Context, index, treeSize uint64) ([]byte, [][]byte, error)

	// InclusionProofByHash fetches an inclusion proof and index for the first leaf found with the specified hash, if any.
	InclusionProofByHash(ctx context.Context, hash []byte, treeSize uint64) (uint64, [][]byte, error)
}

Trillian is the interface to the Trillian Log required for the personality frontend.

Jump to

Keyboard shortcuts

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