Documentation ¶
Index ¶
- func Start(ctx context.Context, zpagesEnabled bool) error
- func XForwardedHostUnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- type AdminAPIConf
- type AdminCredentialsConf
- type CORSConf
- type Codec
- type Conf
- type Param
- type Server
- type TLSConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func XForwardedHostUnaryServerInterceptor ¶
func XForwardedHostUnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Types ¶
type AdminAPIConf ¶
type AdminAPIConf struct { // AdminCredentials defines the admin user credentials. AdminCredentials *AdminCredentialsConf `yaml:"adminCredentials"` // Enabled defines whether the admin API is enabled. Enabled bool `yaml:"enabled" conf:",example=true"` }
type AdminCredentialsConf ¶
type AdminCredentialsConf struct { // Username is the hardcoded username to use for authentication. Username string `yaml:"username" conf:",example=cerbos"` // PasswordHash is the base64-encoded bcrypt hash of the password to use for authentication. PasswordHash string `yaml:"passwordHash" conf:",example=JDJ5JDEwJEdEOVFzZDE2VVhoVkR0N2VkUFBVM09nalc0QnNZaC9xc2E4bS9mcUJJcEZXenp5OUpjMi91Cgo="` }
type CORSConf ¶
type CORSConf struct { // AllowedOrigins is the contents of the allowed-origins header. AllowedOrigins []string `yaml:"allowedOrigins" conf:",example=['*']"` // AllowedHeaders is the contents of the allowed-headers header. AllowedHeaders []string `yaml:"allowedHeaders" conf:",example=['content-type']"` // Disabled sets whether CORS is disabled. Disabled bool `yaml:"disabled" conf:",example=false"` // MaxAge is the max age of the CORS preflight check. MaxAge time.Duration `yaml:"maxAge" conf:",example=10s"` }
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
Codec implements the grpc Codec interface to delegate encoding to VT where possible.
type Conf ¶
type Conf struct { // AdminAPI defines the admin API configuration. AdminAPI AdminAPIConf `yaml:"adminAPI"` // TLS defines the TLS configuration for the server. TLS *TLSConf `yaml:"tls"` // HTTPListenAddr is the dedicated HTTP address. HTTPListenAddr string `yaml:"httpListenAddr" conf:"required,example=\":3592\""` // GRPCListenAddr is the dedicated GRPC address. GRPCListenAddr string `yaml:"grpcListenAddr" conf:"required,example=\":3593\""` // CORS defines the CORS configuration for the server. CORS CORSConf `yaml:"cors"` // MetricsEnabled defines whether the metrics endpoint is enabled. MetricsEnabled bool `yaml:"metricsEnabled" conf:",example=true"` // LogRequestPayloads defines whether the request payloads should be logged. LogRequestPayloads bool `yaml:"logRequestPayloads" conf:",example=false"` // PlaygroundEnabled defines whether the playground API is enabled. PlaygroundEnabled bool `yaml:"playgroundEnabled" conf:",example=false"` }
Conf is required configuration for the server.
func (*Conf) SetDefaults ¶
func (c *Conf) SetDefaults()
type TLSConf ¶
type TLSConf struct { // Cert is the path to the TLS certificate file. Cert string `yaml:"cert" conf:",example=/path/to/certificate"` // Key is the path to the TLS private key file. Key string `yaml:"key" conf:",example=/path/to/private_key"` // CACert is the path to the optional CA certificate for verifying client requests. CACert string `yaml:"caCert" conf:",example=/path/to/CA_certificate"` }
TLSConf holds TLS configuration.
Click to show internal directories.
Click to hide internal directories.