Documentation
¶
Index ¶
- Variables
- func DialOptions(address, loadBalancingConfig string, tlsConfig *tls.Config) []grpc.DialOption
- func MakeServiceConfigJSON(loadBalancingConfig string) string
- func NewServerGRPCClient(config ServerClientConfig) (*grpc.ClientConn, error)
- func SetJWTSVIDCacheHitTimeout(d time.Duration)
- func SetMaxBundleWorkers(n int)
- func SetRPCTimeout(d time.Duration)
- func ValidateLoadBalancingConfig(loadBalancingConfig string) error
- func ValidateXDSBootstrap() error
- func XDSTarget(listenerName string) (string, error)
- type Client
- type Config
- type JWTSVID
- type ServerClientConfig
- type SyncBundlesStats
- type SyncEntriesStats
- type SyncStats
- type Update
- type WITSVID
- type X509SVID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnableToGetStream = errors.New("unable to get a stream") // RPCTimeoutWithCacheHit can be more aggressive with timeouts in cases where a valid SVID // exists in the cache but is old enough to try for a new SVID quickly. This is configurable // in the Experimental Config of the Agent, and can be set as low as 5 seconds RPCTimeoutWithCacheHit = defaultRPCTimeout )
Functions ¶
func DialOptions ¶ added in v1.16.0
func DialOptions(address, loadBalancingConfig string, tlsConfig *tls.Config) []grpc.DialOption
DialOptions returns the gRPC dial options used to connect to the SPIRE server.
func MakeServiceConfigJSON ¶ added in v1.16.0
func NewServerGRPCClient ¶ added in v1.11.2
func NewServerGRPCClient(config ServerClientConfig) (*grpc.ClientConn, error)
func SetJWTSVIDCacheHitTimeout ¶ added in v1.14.3
func SetMaxBundleWorkers ¶ added in v1.16.0
func SetMaxBundleWorkers(n int)
func SetRPCTimeout ¶ added in v1.16.0
func ValidateLoadBalancingConfig ¶ added in v1.16.0
func ValidateXDSBootstrap ¶ added in v1.16.0
func ValidateXDSBootstrap() error
ValidateXDSBootstrap ensures every xDS management server in the gRPC xDS bootstrap is either local (unix socket or loopback) or reached over TLS. The bootstrap is located the same way gRPC does.
Types ¶
type Client ¶
type Client interface {
SyncUpdates(ctx context.Context, cachedEntries map[string]*common.RegistrationEntry, cachedBundles map[string]*common.Bundle) (SyncStats, error)
RenewSVID(ctx context.Context, csr []byte) (*X509SVID, error)
NewX509SVIDs(ctx context.Context, csrs map[string][]byte) (map[string]*X509SVID, error)
NewJWTSVID(ctx context.Context, entryID string, audience []string, hasCacheHit bool) (*JWTSVID, spiffeid.ID, error)
NewWITSVIDs(ctx context.Context, publicKeys map[string]crypto.PublicKey, signatureAlgorithm string) (map[string]*WITSVID, error)
PostStatus(ctx context.Context, agentVersion string) error
// Release releases any resources that were held by this Client, if any.
Release()
}
type Config ¶
type Config struct {
Addr string
Log logrus.FieldLogger
TrustDomain spiffeid.TrustDomain
// KeysAndBundle is a callback that must return the keys and bundle used by the client
// to connect via mTLS to Addr.
KeysAndBundle func() ([]*x509.Certificate, crypto.Signer, []*x509.Certificate)
// RotMtx is used to prevent the creation of new connections during SVID rotations
RotMtx *sync.RWMutex
// TLSPolicy determines the post-quantum-safe policy to apply to all TLS connections.
TLSPolicy tlspolicy.Policy
// LoadBalancingConfig is an optional, opaque payload used as the
// loadBalancingConfig field of the gRPC service config.
LoadBalancingConfig string
}
Config holds a client configuration
type ServerClientConfig ¶ added in v1.11.2
type ServerClientConfig struct {
// Address is the SPIRE server address
Address string
TrustDomain spiffeid.TrustDomain
// GetBundle is a required callback that returns the current trust bundle
// for used to authenticate the server certificate.
GetBundle func() []*x509.Certificate
// GetAgentCertificate is an optional callback used to return the agent
// certificate to present to the server during the TLS handshake.
GetAgentCertificate func() *tls.Certificate
// TLSPolicy determines the post-quantum-safe policy to apply to all TLS connections.
TLSPolicy tlspolicy.Policy
// LoadBalancingConfig is an optional, opaque payload used as the
// loadBalancingConfig field of the gRPC service config. If empty, the
// default load balancing configuration is used.
LoadBalancingConfig string
// contains filtered or unexported fields
}
type SyncBundlesStats ¶ added in v1.8.7
type SyncBundlesStats struct {
Total int
}
type SyncEntriesStats ¶ added in v1.8.7
type SyncStats ¶ added in v1.8.7
type SyncStats struct {
Entries SyncEntriesStats
Bundles SyncBundlesStats
}
Click to show internal directories.
Click to hide internal directories.