Documentation ¶
Index ¶
- Variables
- type LogTracker
- type LogTrackerFactory
- type Verifier
- func (v *Verifier) Index(vrfProof []byte, directoryID, userID string) ([]byte, error)
- func (v *Verifier) LastVerifiedLogRoot() *pb.LogRootRequest
- func (v *Verifier) VerifyBatchGetUser(req *pb.BatchGetUserRequest, resp *pb.BatchGetUserResponse) error
- func (v *Verifier) VerifyGetUser(req *pb.GetUserRequest, resp *pb.GetUserResponse) error
- func (v *Verifier) VerifyLogRoot(req *pb.LogRootRequest, slr *pb.LogRoot) (*types.LogRootV1, error)
- func (v *Verifier) VerifyMapLeaf(directoryID, userID string, in *pb.MapLeaf, mapRoot *types.MapRootV1) error
- func (v *Verifier) VerifyMapRevision(lr *types.LogRootV1, smr *pb.MapRoot) (*types.MapRootV1, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNilProof occurs when the provided GetUserResponse contains a nil proof. ErrNilProof = errors.New("nil proof") )
Functions ¶
This section is empty.
Types ¶
type LogTracker ¶
type LogTracker interface { // LastVerifiedLogRoot retrieves the tree size of the latest log root. LastVerifiedLogRoot() *pb.LogRootRequest // VerifyLogRoot verifies root and updates the trusted root if it is newer. VerifyLogRoot(state *pb.LogRootRequest, newRoot *pb.LogRoot) (*types.LogRootV1, error) }
LogTracker tracks a series of consistent log roots.
type LogTrackerFactory ¶
type LogTrackerFactory func(*tclient.LogVerifier) LogTracker
LogTrackerFactory allows the caller of NewFromDirectory to supply different tracker implementations. eg. no-op, single-synchronous-head, and multi-head tracking.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier is a client helper library for verifying requests and responses.
func New ¶
func New(vrf vrf.PublicKey, mv *tclient.MapVerifier, lv *tclient.LogVerifier, lt LogTracker) *Verifier
New creates a new instance of the client verifier.
func NewFromDirectory ¶
func NewFromDirectory(config *pb.Directory, f LogTrackerFactory) (*Verifier, error)
NewFromDirectory creates a new instance of the client verifier from a config.
func (*Verifier) LastVerifiedLogRoot ¶
func (v *Verifier) LastVerifiedLogRoot() *pb.LogRootRequest
LastVerifiedLogRoot returns a LogRootRequest for making an RPC
func (*Verifier) VerifyBatchGetUser ¶
func (v *Verifier) VerifyBatchGetUser(req *pb.BatchGetUserRequest, resp *pb.BatchGetUserResponse) error
VerifyBatchGetUser verifies that the retrieved profiles are correct.
func (*Verifier) VerifyGetUser ¶
func (v *Verifier) VerifyGetUser(req *pb.GetUserRequest, resp *pb.GetUserResponse) error
VerifyGetUser verifies that the retrieved profile of userID is correct.
func (*Verifier) VerifyLogRoot ¶
VerifyLogRoot verifies that revision.LogRoot is consistent with the last trusted SignedLogRoot.