trisa

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingIdentity = &api.Error{
		Code:    api.Error_MISSING_FIELDS,
		Message: "identity payload is required",
		Retry:   true,
	}

	ErrMissingTransaction = &api.Error{
		Code:    api.Error_MISSING_FIELDS,
		Message: "transaction payload is required",
		Retry:   true,
	}

	ErrMissingSentAt = &api.Error{
		Code:    api.Error_MISSING_FIELDS,
		Message: "sent at payload field is required for non-repudiation",
		Retry:   true,
	}

	ErrInvalidTimestamp = &api.Error{
		Code:    api.Error_VALIDATION_ERROR,
		Message: "could not parse payload timestamp as RFC3339 timestamp",
		Retry:   true,
	}
)

Functions

func Validate

func Validate(payload *api.Payload) *api.Error

Validates an incoming TRISA payload, ensuring that it has all required fields and handled types for the specified node. If not, a TRISA error is returned.

Types

type Server

type Server struct {
	api.UnimplementedTRISAHealthServer
	api.UnimplementedTRISANetworkServer
	// contains filtered or unexported fields
}

The TRISA server implements the TRISANetwork and TRISAHealth services defined by the TRISA protocol buffers in the github.com/trisacrypto/trisa repository. It can be run as a standalone service or can be embedded as a component in a larger service.

func New

func New(conf config.TRISAConfig, network network.Network, store store.Store, echan chan<- error) (s *Server, err error)

Create a new TRISA server ready to handle gRPC requests.

func (*Server) ConfirmAddress

func (s *Server) ConfirmAddress(ctx context.Context, in *api.Address) (*api.AddressConfirmation, error)

Address confirmation allows an originator VASP to establish that a beneficiary VASP has control of a crypto wallet address, prior to sending transaction information with sensitive PII data.

NOTE: this RPC is currently undefined by the v9 whitepaper

func (*Server) Handle added in v0.22.0

func (s *Server) Handle(ctx context.Context, p *postman.Packet) (err error)

func (*Server) HandleError added in v0.22.0

func (s *Server) HandleError(ctx context.Context, p *postman.Packet) (err error)

func (*Server) HandleSealed

func (s *Server) HandleSealed(ctx context.Context, p *postman.Packet) (err error)

func (*Server) KeyExchange

func (s *Server) KeyExchange(ctx context.Context, in *api.SigningKey) (out *api.SigningKey, err error)

KeyExchange is a preperatory RPC that is required before Transfer RPCs to ensure each counterparty has the public keys needed to encrypt secure envelopes for the recipient.

func (*Server) Run

func (s *Server) Run(sock net.Listener)

func (*Server) Serve

func (s *Server) Serve() (err error)

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Status

func (s *Server) Status(ctx context.Context, in *api.HealthCheck) (out *api.ServiceState, err error)

Status implements the TRISAHealth gRPC interface and is used for GDS health checks. TODO: allow user to configure not before/after time window

func (*Server) Transfer

func (s *Server) Transfer(ctx context.Context, in *api.SecureEnvelope) (_ *api.SecureEnvelope, err error)

func (*Server) TransferStream

func (s *Server) TransferStream(stream api.TRISANetwork_TransferStreamServer) (err error)

Directories

Path Synopsis
gds

Jump to

Keyboard shortcuts

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