clients

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package clients contains the domain concept definitions needed to support HTTP/gRPC Client functionality.

Index

Constants

View Source
const AttestationReportSize = 0x4A0

Variables

View Source
var (
	ErrFailedToLoadClientCertKey = errors.New("failed to load client certificate and key")
	ErrFailedToLoadRootCA        = errors.New("failed to load root ca file")
)

Functions

This section is empty.

Types

type AttestedClientConfig

type AttestedClientConfig struct {
	StandardClientConfig
	AttestationPolicy string `env:"ATTESTATION_POLICY" envDefault:""`
	AttestedTLS       bool   `env:"ATTESTED_TLS"       envDefault:"false"`
	ProductName       string `env:"PRODUCT_NAME"       envDefault:"Milan"`
}

AttestedClientConfig represents a client configuration with attested TLS capabilities.

func (AttestedClientConfig) Config

type ClientConfiguration

type ClientConfiguration interface {
	Config() StandardClientConfig
}

type Security

type Security int

Security represents the type of TLS security configuration.

const (
	WithoutTLS Security = iota
	WithTLS
	WithMTLS
	WithATLS
	WithMATLS
)

func (Security) String

func (s Security) String() string

String returns a human-readable representation of the security level.

type StandardClientConfig

type StandardClientConfig 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:""`
}

StandardClientConfig represents a basic client configuration without attested TLS.

func (StandardClientConfig) Config

type TLSResult

type TLSResult struct {
	Config   *tls.Config
	Security Security
}

TLSResult contains the result of TLS configuration.

func LoadATLSConfig

func LoadATLSConfig(cfg AttestedClientConfig) (*TLSResult, error)

LoadATLSConfig configures Attested TLS.

func LoadBasicTLSConfig

func LoadBasicTLSConfig(serverCAFile, clientCert, clientKey string) (*TLSResult, error)

LoadBasicTLSConfig loads standard TLS configuration (TLS/mTLS).

Directories

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

Jump to

Keyboard shortcuts

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