client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 18 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comms

type Comms struct {
	*connect.ProtoComms
}

Client object used to implement endpoints and top-level comms functionality

func NewClientComms

func NewClientComms(id *id.ID, pubKeyPem, privKeyPem, salt []byte) (*Comms, error)

Returns a Comms object with given attributes

func (*Comms) BatchNodeRegistration

func (c *Comms) BatchNodeRegistration(host *connect.Host,
	message *pb.SignedClientBatchKeyRequest) (*pb.SignedBatchKeyResponse, error)

Client -> Gateway Send Function

func (*Comms) GetGatewayTLSCertificate

func (c *Comms) GetGatewayTLSCertificate(host *connect.Host,
	message *pb.RequestGatewayCert) (*pb.GatewayCertificate, error)

GetGatewayTLSCertificate Client -> Gateway cert request

func (*Comms) RegisterForNotifications

func (c *Comms) RegisterForNotifications(host *connect.Host,
	message *pb.NotificationRegisterRequest) (*messages.Ack, error)

Client -> NotificationBot

func (*Comms) RegisterToken

func (c *Comms) RegisterToken(host *connect.Host, message *pb.RegisterTokenRequest) (*messages.Ack, error)

RegisterToken registers the given token. It evaluates that the TransmissionRsaRegistarSig is correct. The RSA->PEM relationship is one to many. It will succeed if the token is already registered.

func (*Comms) RegisterTrackedID

func (c *Comms) RegisterTrackedID(host *connect.Host, message *pb.RegisterTrackedIdRequest) (*messages.Ack, error)

RegisterTrackedID registers the given ID to be tracked. The request is signed Returns an error if TransmissionRSA is not registered with a valid token. The actual ID is not revealed, instead an intermediary value is sent which cannot be revered to get the ID, but is repeatable. So it can be rainbow-tabled.

func (*Comms) RequestBatchMessages

func (c *Comms) RequestBatchMessages(host *connect.Host,
	message *pb.GetMessagesBatch) (*pb.GetMessagesResponseBatch, error)

RequestMessages Client -> Gateway Send Function

func (*Comms) RequestHistoricalRounds

func (c *Comms) RequestHistoricalRounds(host *connect.Host,
	message *pb.HistoricalRounds) (*pb.HistoricalRoundsResponse, error)

RequestHistoricalRounds Client -> Gateway Send Function

func (*Comms) RequestMessages

func (c *Comms) RequestMessages(host *connect.Host,
	message *pb.GetMessages) (*pb.GetMessagesResponse, error)

RequestMessages Client -> Gateway Send Function

func (*Comms) RequestNdf

func (c *Comms) RequestNdf(host *connect.Host,
	message *pb.NDFHash) (*pb.NDF, error)

RequestNdf is used to get an NDF from permissioning. It is only used by UDB when starting or by client in testing. Other than those two uses, this function should never be used as clients.

func (*Comms) RetrieveNdf

func (c *Comms) RetrieveNdf(currentDef *ndf.NetworkDefinition) (*ndf.NetworkDefinition, error)

RetrieveNdf, attempts to connect to the permissioning server to retrieve the latest ndf for the notifications bot

func (*Comms) SendChannelLeaseRequest

func (c *Comms) SendChannelLeaseRequest(host *connect.Host, message *pb.ChannelLeaseRequest) (*pb.ChannelLeaseResponse, error)

Client -> User Discovery channel authentication & lease request

func (*Comms) SendConfirmFact

func (c *Comms) SendConfirmFact(host *connect.Host, message *pb.FactConfirmRequest) (*messages.Ack, error)

Client -> User Discovery Delete Fact Function

func (*Comms) SendPoll

func (c *Comms) SendPoll(host *connect.Host,
	message *pb.GatewayPoll) (*pb.GatewayPollResponse, time.Time, time.Duration, error)

SendPoll Client -> Gateway Send Function Returns a time.Time of the local clock (not netTime) when the comm was sent and a time.Duration representing the roundTripTime of the comm

func (*Comms) SendPutManyMessages

func (c *Comms) SendPutManyMessages(host *connect.Host,
	messages *pb.GatewaySlots, timeout time.Duration) (
	*pb.GatewaySlotResponse, error)

SendPutManyMessages Client -> Gateway Send Function

func (*Comms) SendPutMessage

func (c *Comms) SendPutMessage(host *connect.Host, message *pb.GatewaySlot,
	timeout time.Duration) (*pb.GatewaySlotResponse, error)

SendPutMessage Client -> Gateway Send Function

func (*Comms) SendRegisterFact

func (c *Comms) SendRegisterFact(host *connect.Host, message *pb.FactRegisterRequest) (*pb.FactRegisterResponse, error)

Client -> User Discovery Register Fact Function

func (*Comms) SendRegisterUser

func (c *Comms) SendRegisterUser(host *connect.Host, message *pb.UDBUserRegistration) (*messages.Ack, error)

Client -> User Discovery Register User Function

func (*Comms) SendRegistrationMessage

func (c *Comms) SendRegistrationMessage(host *connect.Host,
	message *pb.ClientRegistration) (*pb.SignedClientRegistrationConfirmations, error)

Client -> Registration Send Function

func (*Comms) SendRemoveFact

func (c *Comms) SendRemoveFact(host *connect.Host, message *pb.FactRemovalRequest) (*messages.Ack, error)

Client -> User Discovery Delete Fact Function

func (*Comms) SendRemoveUser

func (c *Comms) SendRemoveUser(host *connect.Host, message *pb.FactRemovalRequest) (*messages.Ack, error)

Client -> User Discovery Delete Fact Function

func (*Comms) SendRequestClientKeyMessage

func (c *Comms) SendRequestClientKeyMessage(host *connect.Host,
	message *pb.SignedClientKeyRequest) (*pb.SignedKeyResponse, error)

SendRequestClientKeyMessage Client -> Gateway Send Function

func (*Comms) SendUsernameValidation

func (c *Comms) SendUsernameValidation(host *connect.Host,
	message *pb.UsernameValidationRequest) (*pb.UsernameValidation, error)

SendUsernameValidation is a client to User Discovery send function. This will send a mixmessages.UsernameValidationRequest to UD, which UD will validate and send back a mixmessages.UsernameValidation.

func (*Comms) UnregisterForNotifications

func (c *Comms) UnregisterForNotifications(host *connect.Host, message *pb.NotificationUnregisterRequest) (*messages.Ack, error)

Client -> NotificationBot

func (*Comms) UnregisterToken

func (c *Comms) UnregisterToken(host *connect.Host, message *pb.UnregisterTokenRequest) (*messages.Ack, error)

UnregisterToken unregisters the given token. The request is signed. Does not return an error if the token cannot be found

func (*Comms) UnregisterTrackedID

func (c *Comms) UnregisterTrackedID(host *connect.Host, message *pb.UnregisterTrackedIdRequest) (*messages.Ack, error)

UnregisterTrackedID unregisters the given tracked ID. The request is signed. Does not return an error if the token cannot be found

Jump to

Keyboard shortcuts

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