grpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0

Package grpc contains the domain concept definitions needed to support Agent Client grpc functionality.

Index

Constants

View Source
const (
	AttestationReportSize = 0x4A0
	WithATLS              = "with aTLS"
	WithTLS               = "with TLS"
)

Variables

View Source
var (
	ErrAttestationPolicyMissing = errors.New("failed due to missing Attestation Policy file")
	ErrAttestationPolicyDecode  = errors.New("failed to decode Attestation Policy file")
)

Functions

func CustomDialer added in v0.4.0

func CustomDialer(ctx context.Context, addr string) (net.Conn, error)

func ReadAttestationPolicy added in v0.4.0

func ReadAttestationPolicy(manifestPath string, attestationConfiguration *check.Config) error

Types

type AgentClientConfig added in v0.4.0

type AgentClientConfig struct {
	BaseConfig
	AttestationPolicy string `env:"ATTESTATION_POLICY" envDefault:""`
	AttestedTLS       bool   `env:"ATTESTED_TLS"       envDefault:"false"`
}

func (AgentClientConfig) GetBaseConfig added in v0.4.0

func (a AgentClientConfig) GetBaseConfig() BaseConfig

type BaseConfig added in v0.4.0

type BaseConfig struct {
	URL          string        `env:"URL"             envDefault:"localhost:7001"`
	Timeout      time.Duration `env:"TIMEOUT"         envDefault:"60s"`
	ClientCert   string        `env:"CLIENT_CERT"     envDefault:""`
	ClientKey    string        `env:"CLIENT_KEY"      envDefault:""`
	ServerCAFile string        `env:"SERVER_CA_CERTS"    envDefault:""`
}

func (BaseConfig) GetBaseConfig added in v0.4.0

func (a BaseConfig) GetBaseConfig() BaseConfig

type Client

type Client interface {
	// Close closes gRPC connection.
	Close() error

	// Secure is used for pretty printing TLS info.
	Secure() string

	// Connection returns the gRPC connection.
	Connection() *grpc.ClientConn
}

func NewClient

func NewClient(cfg ClientConfiguration) (Client, error)

type ClientConfiguration added in v0.4.0

type ClientConfiguration interface {
	GetBaseConfig() BaseConfig
}

type ManagerClientConfig added in v0.4.0

type ManagerClientConfig struct {
	BaseConfig
}

func (ManagerClientConfig) GetBaseConfig added in v0.4.0

func (a ManagerClientConfig) GetBaseConfig() BaseConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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