candidtest

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package candidtest provides an inmemory candid service for use in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// URL contains the URL where the server is listening.
	URL string

	// CACert contains the PEM encoded CA certificate that signed the
	// server's certificate, if the server is using TLS.
	CACert []byte

	// AdminAgentKey contains the key required to authenticate as the
	// admin agent.
	AdminAgentKey *bakery.KeyPair

	// The following fields give access to the stores used by the
	// candid server.
	Store             store.Store
	MeetingStore      meeting.Store
	ProviderDataStore store.ProviderDataStore
	RootKeyStore      bakery.RootKeyStore
	ACLStore          aclstore.ACLStore
	// contains filtered or unexported fields
}

func New

func New(users map[string]static.UserInfo) (*Server, error)

New creates a new candid server for use in tests. The server will use a static IDP with the given set of users. The server must be closed when finished with.

func NewTLS added in v1.1.0

func NewTLS(users map[string]static.UserInfo) (*Server, error)

NewTLS is like New except the listening server will be using TLS.

func (*Server) AddIdentity

func (s *Server) AddIdentity(ctx context.Context, identity *store.Identity)

AddIdentity adds a new identity to the server.

func (*Server) Close

func (s *Server) Close() error

Close closes the server.

Jump to

Keyboard shortcuts

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