Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORSConfig ¶ added in v0.4.1
type CORSConfig struct {
// Enable CORS for the server (default: true)
Enabled bool `mapstructure:"enabled" json:"enabled" default:"true"`
AllowedOrigins []string `mapstructure:"allowedorigins" json:"allowedorigins"`
AllowedMethods []string `mapstructure:"allowedmethods" json:"allowedmethods" default:"[\"GET\",\"POST\",\"PATCH\",\"DELETE\",\"OPTIONS\"]"`
AllowedHeaders []string `` /* 256-byte string literal not displayed */
ExposedHeaders []string `mapstructure:"exposedheaders" json:"exposedheaders"`
AllowCredentials bool `mapstructure:"allowcredentials" json:"allowcredentials" default:"true"`
MaxAge int `mapstructure:"maxage" json:"maxage" default:"3600"`
Debug bool `mapstructure:"debug" json:"debug"`
// Additive fields - appended to base lists at runtime without replacing defaults
AdditionalMethods []string `mapstructure:"additionalmethods" json:"additionalmethods"`
AdditionalHeaders []string `mapstructure:"additionalheaders" json:"additionalheaders"`
AdditionalExposedHeaders []string `mapstructure:"additionalexposedheaders" json:"additionalexposedheaders"`
}
CORS Configuration for the server
func (CORSConfig) EffectiveExposedHeaders ¶ added in v0.12.0
func (c CORSConfig) EffectiveExposedHeaders() []string
EffectiveExposedHeaders returns ExposedHeaders merged with AdditionalExposedHeaders. Uses case-insensitive deduplication since HTTP headers are case-insensitive per RFC 7230.
func (CORSConfig) EffectiveHeaders ¶ added in v0.12.0
func (c CORSConfig) EffectiveHeaders() []string
EffectiveHeaders returns AllowedHeaders merged with AdditionalHeaders. Uses case-insensitive deduplication since HTTP headers are case-insensitive per RFC 7230.
func (CORSConfig) EffectiveMethods ¶ added in v0.12.0
func (c CORSConfig) EffectiveMethods() []string
EffectiveMethods returns AllowedMethods merged with AdditionalMethods.
type Config ¶
type Config struct {
Auth auth.Config `mapstructure:"auth" json:"auth"`
Cache cache.Config `mapstructure:"cache" json:"cache"`
GRPC GRPCConfig `mapstructure:"grpc" json:"grpc"`
// To Deprecate: Use the WithKey[X]Provider StartOptions to register trust providers.
CryptoProvider security.Config `mapstructure:"cryptoProvider" json:"cryptoProvider"`
TLS TLSConfig `mapstructure:"tls" json:"tls"`
CORS CORSConfig `mapstructure:"cors" json:"cors"`
WellKnownConfigRegister func(namespace string, config any) error `mapstructure:"-" json:"-"`
// Programmatic interceptors injected at startup (not loaded from config)
ExtraConnectInterceptors []connect.Interceptor `mapstructure:"-" json:"-"`
ExtraIPCInterceptors []connect.Interceptor `mapstructure:"-" json:"-"`
// Port to listen on
Port int `mapstructure:"port" json:"port" default:"8080"`
Host string `mapstructure:"host,omitempty" json:"host"`
PublicHostname string `mapstructure:"public_hostname,omitempty" json:"publicHostname"`
// Http server config
HTTPServerConfig HTTPServerConfig `mapstructure:"http" json:"http"`
// Enable pprof
EnablePprof bool `mapstructure:"enable_pprof" json:"enable_pprof" default:"false"`
// Trace is for configuring open telemetry based tracing.
Trace tracing.Config `mapstructure:"trace" json:"trace"`
}
Configurations for the server
type ConnectRPC ¶ added in v0.4.27
type ConnectRPC struct {
Mux *http.ServeMux
Interceptors []connect.HandlerOption
ServiceReflection []string
}
type GRPCConfig ¶
type GRPCConfig struct {
// Enable reflection for grpc server (default: true)
ReflectionEnabled bool `mapstructure:"reflectionEnabled" json:"reflectionEnabled" default:"true"`
MaxCallRecvMsgSizeBytes int `mapstructure:"maxCallRecvMsgSize" json:"maxCallRecvMsgSize" default:"4194304"` // 4MB = 4 * 1024 * 1024 = 4194304
MaxCallSendMsgSizeBytes int `mapstructure:"maxCallSendMsgSize" json:"maxCallSendMsgSize" default:"4194304"` // 4MB = 4 * 1024 * 1024 = 4194304
}
GRPC Server specific configurations
type HTTPServerConfig ¶ added in v0.7.2
type HTTPServerConfig struct {
ReadTimeout time.Duration `mapstructure:"readTimeout" json:"readTimeout"`
ReadHeaderTimeout time.Duration `mapstructure:"readHeaderTimeout" json:"readHeaderTimeout"`
WriteTimeout time.Duration `mapstructure:"writeTimeout" json:"writeTimeout"`
IdleTimeout time.Duration `mapstructure:"idleTimeout" json:"idleTimeout"`
MaxHeaderBytes int `mapstructure:"maxHeaderBytes" json:"maxHeaderBytes"`
}
type OpenTDFServer ¶
type OpenTDFServer struct {
AuthN *auth.Authentication
GRPCGatewayMux *runtime.ServeMux
HTTPServer *http.Server
ConnectRPCInProcess *inProcessServer
ConnectRPC *ConnectRPC
CacheManager *cache.Manager
// To Deprecate: Use the TrustKeyIndex and TrustKeyManager instead
CryptoProvider *security.StandardCrypto
Listener net.Listener
PublicHostname string
// contains filtered or unexported fields
}
func NewOpenTDFServer ¶
func (OpenTDFServer) Start ¶
func (s OpenTDFServer) Start() error
func (OpenTDFServer) Stop ¶
func (s OpenTDFServer) Stop()
type TLSConfig ¶
type TLSConfig struct {
// Enable TLS for the server (default: false)
Enabled bool `mapstructure:"enabled" json:"enabled" default:"false"`
// Path to the certificate file
Cert string `mapstructure:"cert" json:"cert"`
// Path to the key file
Key string `mapstructure:"key" json:"key"`
}
TLS Configuration for the server
Click to show internal directories.
Click to hide internal directories.