notary

package
v0.0.0-...-dd22d64 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package notary implements a tlsutil.Notary client and a ready to use service component.

This package is a work in progress and makes no API stability promises.

Index

Constants

View Source
const (
	APIName    = "luids.tlsutil"
	APIVersion = "v1"
	APIService = "Notary"
)

Constants for api description.

Variables

This section is empty.

Functions

func ClientBuilder

func ClientBuilder(opt ...ClientOption) apiservice.BuildFn

ClientBuilder returns builder function

func RegisterServer

func RegisterServer(server *grpc.Server, service *Service)

RegisterServer registers a service in the grpc server.

func ServiceName

func ServiceName() string

ServiceName returns service name.

Types

type Client

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

Client provides a grpc client.

func NewClient

func NewClient(conn *grpc.ClientConn, opt ...ClientOption) *Client

NewClient returns a new client.

func (*Client) API

func (c *Client) API() string

API returns API service name implemented.

func (*Client) Close

func (c *Client) Close() error

Close the client.

func (*Client) DownloadCerts

func (c *Client) DownloadCerts(ctx context.Context, chain string) ([]*x509.Certificate, error)

DownloadCerts implements tlsutil.Notary interface.

func (*Client) GetServerChain

func (c *Client) GetServerChain(ctx context.Context, ip net.IP, port int, sni, profile string) (string, error)

GetServerChain implements tlsutil.Notary interface.

func (*Client) Ping

func (c *Client) Ping() error

Ping checks connectivity with the api.

func (*Client) SetServerChain

func (c *Client) SetServerChain(ctx context.Context, ip net.IP, port int, sni, profile string, chain string) error

SetServerChain implements tlsutil.Notary interface.

func (*Client) UploadCerts

func (c *Client) UploadCerts(ctx context.Context, certs []*x509.Certificate) (string, error)

UploadCerts implements tlsutil.Notary interface.

func (*Client) VerifyChain

func (c *Client) VerifyChain(ctx context.Context, chain string, dnsname string, force bool) (tlsutil.VerifyResponse, error)

VerifyChain implements tlsutil.Notary interface.

type ClientOption

type ClientOption func(*clientOpts)

ClientOption encapsules options for client.

func CloseConnection

func CloseConnection(b bool) ClientOption

CloseConnection option closes grpc connection on close.

func SetCache

func SetCache(ttl, negativettl int) ClientOption

SetCache sets cache ttl and negative ttl (for validations).

func SetCacheCleanUps

func SetCacheCleanUps(d time.Duration) ClientOption

SetCacheCleanUps sets interval between cache cleanups.

func SetLogger

func SetLogger(l yalogi.Logger) ClientOption

SetLogger option allows set a custom logger.

type Service

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

Service implements a grpc service wrapper.

func NewService

func NewService(notary tlsutil.Notary, opt ...ServiceOption) *Service

NewService returns a new Service.

func (*Service) DownloadCerts

DownloadCerts implements grpc api.

func (*Service) GetServerChain

GetServerChain implements grpc api.

func (*Service) SetServerChain

SetServerChain implements grpc api.

func (*Service) UploadCerts

func (s *Service) UploadCerts(ctx context.Context, in *pb.UploadCertsRequest) (*pb.UploadCertsResponse, error)

UploadCerts implements grpc api.

func (*Service) VerifyChain

func (s *Service) VerifyChain(ctx context.Context, in *pb.VerifyChainRequest) (*pb.VerifyChainResponse, error)

VerifyChain implements grpc api.

type ServiceOption

type ServiceOption func(*serviceOpts)

ServiceOption is used for service configuration.

func SetServiceLogger

func SetServiceLogger(l yalogi.Logger) ServiceOption

SetServiceLogger option allows set a custom logger.

Jump to

Keyboard shortcuts

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