config

package
v0.0.0-...-0ba7dcb Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 45 Imported by: 0

README

Config Schema

This package defines AuthProxy's YAML/JSON configuration file syntax. It can compose common primitives, auth permissions, and resource definitions that are valid in configuration files.

Runtime resource models that are also exposed through REST APIs should live under internal/schema/resources/... and be referenced from config instead of duplicated here.

Documentation

Index

Constants

View Source
const (
	DefaultInitiateToRedirectTtl = 30 * time.Second
	DefaultOAuthRoundTripTtl     = 1 * time.Hour
)
View Source
const (
	AuthTypeOAuth2 = connectors.AuthTypeOAuth2
	AuthTypeAPIKey = connectors.AuthTypeAPIKey

	ApiKeyPlacementBearer = connectors.ApiKeyPlacementBearer
	ApiKeyPlacementHeader = connectors.ApiKeyPlacementHeader
	ApiKeyPlacementQuery  = connectors.ApiKeyPlacementQuery
	ApiKeyPlacementBasic  = connectors.ApiKeyPlacementBasic

	PKCEMethodS256  = connectors.PKCEMethodS256
	PKCEMethodPlain = connectors.PKCEMethodPlain

	OAuth2GrantAuthorizationCode = connectors.OAuth2GrantAuthorizationCode
	OAuth2GrantClientCredentials = connectors.OAuth2GrantClientCredentials

	TokenEndpointAuthClientSecretPost  = connectors.TokenEndpointAuthClientSecretPost
	TokenEndpointAuthClientSecretBasic = connectors.TokenEndpointAuthClientSecretBasic
	TokenEndpointAuthNone              = connectors.TokenEndpointAuthNone
)

Re-export constants from the connectors sub-package

View Source
const (
	AwsCredentialsTypeAccessKey = common.AwsCredentialsTypeAccessKey
	AwsCredentialsTypeImplicit  = common.AwsCredentialsTypeImplicit

	ProviderTypeValue                 = keyschema.ProviderTypeValue
	ProviderTypeBase64                = keyschema.ProviderTypeBase64
	ProviderTypeEnvVar                = keyschema.ProviderTypeEnvVar
	ProviderTypeEnvVarBase64          = keyschema.ProviderTypeEnvVarBase64
	ProviderTypeFile                  = keyschema.ProviderTypeFile
	ProviderTypeRandom                = keyschema.ProviderTypeRandom
	ProviderTypeAwsSecretsManager     = keyschema.ProviderTypeAwsSecretsManager
	ProviderTypeAwsKMS                = keyschema.ProviderTypeAwsKMS
	ProviderTypeGcp                   = keyschema.ProviderTypeGcp
	ProviderTypeGcpKMS                = keyschema.ProviderTypeGcpKMS
	ProviderTypeHashicorpVault        = keyschema.ProviderTypeHashicorpVault
	ProviderTypeHashicorpVaultTransit = keyschema.ProviderTypeHashicorpVaultTransit
	ProviderTypeRaw                   = keyschema.ProviderTypeRaw
	ProviderTypeMock                  = keyschema.ProviderTypeMock
	ProviderTypeMockKMS               = keyschema.ProviderTypeMockKMS

	DataEncryptionKeySize                      = keyschema.DataEncryptionKeySize
	KeyVersionProtectedDataTypeAuthProxyAESGCM = keyschema.KeyVersionProtectedDataTypeAuthProxyAESGCM
)

Re-export constants from the common and key resource sub-packages

View Source
const DefaultSetupTtl = 24 * time.Hour
View Source
const DefaultSoftDeleteRetention = 30 * 24 * time.Hour // 30 days
View Source
const DefaultTelemetrySamplingRatio = 1.0

DefaultTelemetrySamplingRatio is the default trace sampling ratio when telemetry is enabled and no explicit ratio is configured.

View Source
const DefaultTelemetryServiceNamePrefix = "authproxy"

DefaultTelemetryServiceNamePrefix is the prefix applied to the service name reported in OTel resources (e.g. "authproxy-api"). Configurable via telemetry.resource.service_name_prefix.

View Source
const SchemaIdConfig = "https://raw.githubusercontent.com/rmorlok/authproxy/refs/heads/main/schema/config/schema.json"

Variables

View Source
var (
	KindToString                 = common.KindToString
	MarshalToYamlString          = common.MarshalToYamlString
	MustMarshalToYamlString      = common.MustMarshalToYamlString
	NewStringValueDirect         = common.NewStringValueDirect
	NewStringValueDirectInline   = common.NewStringValueDirectInline
	ValidateNamespacePath        = nschema.ValidatePath
	SplitNamespacePathToPrefixes = nschema.SplitPathToPrefixes
	NamespacePathFromRoot        = nschema.PathFromRoot
)

Re-export functions from the common and namespace sub-packages

View Source
var (
	NewScopeRequiredBool      = connectors.NewScopeRequiredBool
	NewScopeRequiredPredicate = connectors.NewScopeRequiredPredicate
)
View Source
var (
	DataHash                    = keyschema.DataHash
	NewKeyDataRandomBytes       = keyschema.NewKeyDataRandomBytes
	ResetKeyDataMockRegistry    = keyschema.ResetKeyDataMockRegistry
	NewKeyDataMock              = keyschema.NewKeyDataMock
	KeyDataMockAddVersion       = keyschema.KeyDataMockAddVersion
	KeyDataMockSetVersions      = keyschema.KeyDataMockSetVersions
	KeyDataMockRemoveVersion    = keyschema.KeyDataMockRemoveVersion
	ResetKeyDataMockKMSRegistry = keyschema.ResetKeyDataMockKMSRegistry
	NewKeyDataMockKMS           = keyschema.NewKeyDataMockKMS
	KeyDataMockKMSAddVersion    = keyschema.KeyDataMockKMSAddVersion
	KeyDataMockKMSWrap          = keyschema.KeyDataMockKMSWrap
)
View Source
var DefaultTelemetryHTTPExcludedPaths = []string{"/ping", "/healthz"}

DefaultTelemetryHTTPExcludedPaths are the paths excluded from inbound HTTP telemetry by default. Avoids drowning telemetry in liveness probes.

View Source
var (
	RootNamespace = nschema.Root
)

Re-export constants from the namespace sub-package

Functions

func AllServiceIdStrings

func AllServiceIdStrings() []string

func AllValidServiceIds

func AllValidServiceIds(ids []string) bool

func IsValidServiceId

func IsValidServiceId(id ServiceId) bool

Types

type AdminUser

type AdminUser struct {
	Username    string               `json:"username" yaml:"username"`
	Email       string               `json:"email" yaml:"email"`
	Key         *Key                 `json:"key" yaml:"key"`
	Permissions []aschema.Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
}

type AdminUsers

type AdminUsers struct {
	InnerVal AdminUsersType `json:"-" yaml:"-"`
}

func (*AdminUsers) All

func (au *AdminUsers) All() []*AdminUser

func (*AdminUsers) GetByJwtSubject

func (au *AdminUsers) GetByJwtSubject(subject string) (*AdminUser, bool)

func (*AdminUsers) GetByUsername

func (au *AdminUsers) GetByUsername(username string) (*AdminUser, bool)

func (*AdminUsers) MarshalJSON

func (au *AdminUsers) MarshalJSON() ([]byte, error)

func (*AdminUsers) MarshalYAML

func (au *AdminUsers) MarshalYAML() (interface{}, error)

func (*AdminUsers) UnmarshalJSON

func (au *AdminUsers) UnmarshalJSON(data []byte) error

func (*AdminUsers) UnmarshalYAML

func (au *AdminUsers) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML handles unmarshalling from YAML while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

type AdminUsersExternalSource

type AdminUsersExternalSource struct {
	KeysPath         string               `json:"keys_path" yaml:"keys_path"`
	Permissions      []aschema.Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
	SyncCronSchedule string               `json:"sync_cron_schedule,omitempty" yaml:"sync_cron_schedule,omitempty"`
}

func (*AdminUsersExternalSource) All

func (s *AdminUsersExternalSource) All() []*AdminUser

func (*AdminUsersExternalSource) GetByJwtSubject

func (s *AdminUsersExternalSource) GetByJwtSubject(subject string) (*AdminUser, bool)

func (*AdminUsersExternalSource) GetByUsername

func (s *AdminUsersExternalSource) GetByUsername(username string) (*AdminUser, bool)

func (*AdminUsersExternalSource) GetSyncCronScheduleOrDefault

func (sa *AdminUsersExternalSource) GetSyncCronScheduleOrDefault() string

GetSyncCronScheduleOrDefault returns the cron schedule for admin users sync, or a default of every 5 minutes if not configured.

type AdminUsersList

type AdminUsersList []*AdminUser

func UnmarshallYamlAdminUsersList

func UnmarshallYamlAdminUsersList(data []byte) (AdminUsersList, error)

func UnmarshallYamlAdminUsersListString

func UnmarshallYamlAdminUsersListString(data string) (AdminUsersList, error)

func (AdminUsersList) All

func (aul AdminUsersList) All() []*AdminUser

func (AdminUsersList) GetByJwtSubject

func (s AdminUsersList) GetByJwtSubject(subject string) (*AdminUser, bool)

func (AdminUsersList) GetByUsername

func (aul AdminUsersList) GetByUsername(username string) (*AdminUser, bool)

type AdminUsersType

type AdminUsersType interface {
	All() []*AdminUser
	GetByUsername(username string) (*AdminUser, bool)
	GetByJwtSubject(subject string) (*AdminUser, bool)
}

type ApiKeyPlacement

type ApiKeyPlacement = connectors.ApiKeyPlacement

Re-export types from the connectors sub-package

type AppMetrics

type AppMetrics struct {
	// AutoMigrate controls if the migration to build the indexes for app metrics happens automatically on startup.
	// If this value is not specified in the config, it defaults to true.
	AutoMigrate *bool `json:"auto_migrate,omitempty" yaml:"auto_migrate,omitempty"`

	// Database is the database provider for app metrics. This can be the same database as the main database but would
	// typically be a data warehouse in production.
	Database *Database `json:"database" yaml:"database"`

	// BlobStorage configures the blob storage backend used for storing full request/response logs.
	// If not configured, full request-event logging will use an in-memory store (not suitable for production).
	BlobStorage *BlobStorage `json:"blob_storage,omitempty" yaml:"blob_storage,omitempty"`

	// ResourceSnapshotInterval is how often resource snapshot jobs should write metrics samples.
	// If unset, defaults to 15 minutes.
	ResourceSnapshotInterval *HumanDuration `json:"resource_snapshot_interval,omitempty" yaml:"resource_snapshot_interval,omitempty"`

	// RequestEvents configures request-event capture into the app metrics store.
	RequestEvents *AppMetricsRequestEvents `json:"request_events,omitempty" yaml:"request_events,omitempty"`
}

AppMetrics are the settings for application metrics storage and capture.

func (*AppMetrics) GetAutoMigrate

func (d *AppMetrics) GetAutoMigrate() bool

func (*AppMetrics) GetRequestEvents

func (d *AppMetrics) GetRequestEvents() *AppMetricsRequestEvents

func (*AppMetrics) GetResourceSnapshotInterval

func (d *AppMetrics) GetResourceSnapshotInterval() time.Duration

func (*AppMetrics) Validate

func (d *AppMetrics) Validate(vc *common.ValidationContext) error

type AppMetricsRequestEvents

type AppMetricsRequestEvents struct {
	// Retention is how long the high-level logs should be retained. If unset, defaults to 30 days.
	Retention *HumanDuration `json:"retention" yaml:"retention"`

	// MaxRequestSize is the max size of request that will be stored. Values over this will be truncated.
	MaxRequestSize *HumanByteSize `json:"max_request_size,omitempty" yaml:"max_request_size,omitempty"`

	// MaxResponseSize is the max size of the response that will be stored. Values over this will be truncated.
	MaxResponseSize *HumanByteSize `json:"max_response_size,omitempty" yaml:"max_response_size,omitempty"`

	// MaxResponseWait is the maximum amount of time to wait for a response before logging it. Defaults to 60 seconds.
	MaxResponseWait *HumanDuration `json:"max_response_wait" yaml:"max_response_wait"`

	// FullRequestRecording flags if the full body/headers be logged for requests. Defaults to never, or can be enabled
	// with API calls to specific resources, or always on.
	FullRequestRecording *FullRequestRecording `json:"full_request_recording,omitempty" yaml:"full_request_recording,omitempty"`

	// FullRequestRetention is how long the full request events should be retained. If unset, defaults to 30 days.
	FullRequestRetention *HumanDuration `json:"full_request_retention,omitempty" yaml:"full_request_retention,omitempty"`

	// FlushInterval is how often buffered records are flushed the database. Defaults to 5s.
	FlushInterval *HumanDuration `json:"flush_interval,omitempty" yaml:"flush_interval,omitempty"`

	// FlushBatchSize is the number of records that triggers a flush. Defaults to 1000.
	FlushBatchSize *int `json:"flush_batch_size,omitempty" yaml:"flush_batch_size,omitempty"`
}

AppMetricsRequestEvents are the settings related to capturing HTTP request events.

func (*AppMetricsRequestEvents) GetFlushBatchSize

func (d *AppMetricsRequestEvents) GetFlushBatchSize() int

func (*AppMetricsRequestEvents) GetFlushInterval

func (d *AppMetricsRequestEvents) GetFlushInterval() time.Duration

func (*AppMetricsRequestEvents) GetFullRequestRecording

func (d *AppMetricsRequestEvents) GetFullRequestRecording() FullRequestRecording

func (*AppMetricsRequestEvents) GetFullRequestRetention

func (d *AppMetricsRequestEvents) GetFullRequestRetention() time.Duration

func (*AppMetricsRequestEvents) GetMaxRequestSize

func (d *AppMetricsRequestEvents) GetMaxRequestSize() uint64

func (*AppMetricsRequestEvents) GetMaxResponseSize

func (d *AppMetricsRequestEvents) GetMaxResponseSize() uint64

func (*AppMetricsRequestEvents) GetMaxResponseWait

func (d *AppMetricsRequestEvents) GetMaxResponseWait() time.Duration

func (*AppMetricsRequestEvents) GetRetention

func (d *AppMetricsRequestEvents) GetRetention() time.Duration

type Auth

type Auth = connectors.Auth

Re-export types from the connectors sub-package

type AuthApiKey

type AuthApiKey = connectors.AuthApiKey

Re-export types from the connectors sub-package

type AuthNoAuth

type AuthNoAuth = connectors.AuthNoAuth

Re-export types from the connectors sub-package

type AuthOAuth2

type AuthOAuth2 = connectors.AuthOAuth2

Re-export types from the connectors sub-package

type AuthOauth2Authorization

type AuthOauth2Authorization = connectors.AuthOauth2Authorization

Re-export types from the connectors sub-package

type AuthOauth2PKCE

type AuthOauth2PKCE = connectors.AuthOauth2PKCE

Re-export types from the connectors sub-package

type AuthOauth2Token

type AuthOauth2Token = connectors.AuthOauth2Token

Re-export types from the connectors sub-package

type AuthType

type AuthType = connectors.AuthType

Re-export types from the connectors sub-package

type AwsCredentials

type AwsCredentials = common.AwsCredentials

Re-export types from the common sub-package

type AwsCredentialsAccessKey

type AwsCredentialsAccessKey = common.AwsCredentialsAccessKey

Re-export types from the common sub-package

type AwsCredentialsImpl

type AwsCredentialsImpl = common.AwsCredentialsImpl

Re-export types from the common sub-package

type AwsCredentialsImplicit

type AwsCredentialsImplicit = common.AwsCredentialsImplicit

Re-export types from the common sub-package

type AwsCredentialsType

type AwsCredentialsType = common.AwsCredentialsType

Re-export types from the common sub-package

type BlobStorage

type BlobStorage struct {
	InnerVal BlobStorageImpl `json:"-" yaml:"-"`
}

BlobStorage is the holder for a BlobStorageImpl instance.

func (*BlobStorage) GetProvider

func (b *BlobStorage) GetProvider() BlobStorageProvider

func (*BlobStorage) MarshalJSON

func (b *BlobStorage) MarshalJSON() ([]byte, error)

func (*BlobStorage) MarshalYAML

func (b *BlobStorage) MarshalYAML() (interface{}, error)

func (*BlobStorage) UnmarshalJSON

func (b *BlobStorage) UnmarshalJSON(data []byte) error

UnmarshalJSON handles unmarshalling from JSON while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

func (*BlobStorage) UnmarshalYAML

func (b *BlobStorage) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML handles unmarshalling from YAML while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

type BlobStorageFilesystem

type BlobStorageFilesystem struct {
	Provider BlobStorageProvider `json:"provider" yaml:"provider"`
	Path     string              `json:"path" yaml:"path"`
}

func (*BlobStorageFilesystem) GetProvider

func (b *BlobStorageFilesystem) GetProvider() BlobStorageProvider

type BlobStorageImpl

type BlobStorageImpl interface {
	GetProvider() BlobStorageProvider
}

BlobStorageImpl is the interface implemented by concrete blob storage configurations.

type BlobStorageMemory

type BlobStorageMemory struct {
	Provider BlobStorageProvider `json:"provider" yaml:"provider"`
}

func (*BlobStorageMemory) GetProvider

func (b *BlobStorageMemory) GetProvider() BlobStorageProvider

type BlobStorageProvider

type BlobStorageProvider string
const (
	BlobStorageProviderS3         BlobStorageProvider = "s3"
	BlobStorageProviderMemory     BlobStorageProvider = "memory"
	BlobStorageProviderFilesystem BlobStorageProvider = "filesystem"
)

type BlobStorageS3

type BlobStorageS3 struct {
	Provider       BlobStorageProvider `json:"provider" yaml:"provider"`
	Endpoint       string              `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
	Region         string              `json:"region,omitempty" yaml:"region,omitempty"`
	Bucket         string              `json:"bucket" yaml:"bucket"`
	Credentials    *AwsCredentials     `json:"credentials,omitempty" yaml:"credentials,omitempty"`
	ForcePathStyle bool                `json:"force_path_style,omitempty" yaml:"force_path_style,omitempty"`
	Prefix         string              `json:"prefix,omitempty" yaml:"prefix,omitempty"`
}

func (*BlobStorageS3) GetAwsConfigLoadOptions

func (b *BlobStorageS3) GetAwsConfigLoadOptions(ctx context.Context) ([]func(*awsconfig.LoadOptions) error, error)

func (*BlobStorageS3) GetProvider

func (b *BlobStorageS3) GetProvider() BlobStorageProvider

func (*BlobStorageS3) GetS3Options

func (b *BlobStorageS3) GetS3Options() []func(*s3.Options)

type ConfiguredActor

type ConfiguredActor struct {
	ExternalId  string               `json:"external_id" yaml:"external_id"`
	Key         *Key                 `json:"key" yaml:"key"`
	Permissions []aschema.Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
	Labels      map[string]string    `json:"labels,omitempty" yaml:"labels,omitempty"`
}

type ConfiguredActors

type ConfiguredActors struct {
	InnerVal ConfiguredActorsType `json:"-" yaml:"-"`
}

func (*ConfiguredActors) All

func (ca *ConfiguredActors) All() []*ConfiguredActor

func (*ConfiguredActors) GetByExternalId

func (ca *ConfiguredActors) GetByExternalId(externalId string) (*ConfiguredActor, bool)

func (*ConfiguredActors) GetBySubject

func (ca *ConfiguredActors) GetBySubject(subject string) (*ConfiguredActor, bool)

func (*ConfiguredActors) MarshalJSON

func (ca *ConfiguredActors) MarshalJSON() ([]byte, error)

func (*ConfiguredActors) MarshalYAML

func (ca *ConfiguredActors) MarshalYAML() (interface{}, error)

func (*ConfiguredActors) UnmarshalJSON

func (ca *ConfiguredActors) UnmarshalJSON(data []byte) error

func (*ConfiguredActors) UnmarshalYAML

func (ca *ConfiguredActors) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML handles unmarshalling from YAML while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

type ConfiguredActorsExternalSource

type ConfiguredActorsExternalSource struct {
	KeysPath         string               `json:"keys_path" yaml:"keys_path"`
	Permissions      []aschema.Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
	SyncCronSchedule string               `json:"sync_cron_schedule,omitempty" yaml:"sync_cron_schedule,omitempty"`
}

func (*ConfiguredActorsExternalSource) All

func (*ConfiguredActorsExternalSource) GetByExternalId

func (s *ConfiguredActorsExternalSource) GetByExternalId(externalId string) (*ConfiguredActor, bool)

func (*ConfiguredActorsExternalSource) GetBySubject

func (s *ConfiguredActorsExternalSource) GetBySubject(subject string) (*ConfiguredActor, bool)

func (*ConfiguredActorsExternalSource) GetSyncCronScheduleOrDefault

func (s *ConfiguredActorsExternalSource) GetSyncCronScheduleOrDefault() string

GetSyncCronScheduleOrDefault returns the cron schedule for actors sync, or a default of every 5 minutes if not configured.

type ConfiguredActorsList

type ConfiguredActorsList []*ConfiguredActor

func UnmarshallYamlConfiguredActorsList

func UnmarshallYamlConfiguredActorsList(data []byte) (ConfiguredActorsList, error)

func UnmarshallYamlConfiguredActorsListString

func UnmarshallYamlConfiguredActorsListString(data string) (ConfiguredActorsList, error)

func (ConfiguredActorsList) All

func (ConfiguredActorsList) GetByExternalId

func (cal ConfiguredActorsList) GetByExternalId(externalId string) (*ConfiguredActor, bool)

func (ConfiguredActorsList) GetBySubject

func (cal ConfiguredActorsList) GetBySubject(subject string) (*ConfiguredActor, bool)

type ConfiguredActorsType

type ConfiguredActorsType interface {
	All() []*ConfiguredActor
	GetByExternalId(externalId string) (*ConfiguredActor, bool)
	GetBySubject(subject string) (*ConfiguredActor, bool)
}

type Connections

type Connections struct {
	// SetupTtl is the maximum time a connection can remain in an incomplete setup state
	// before it is automatically cleaned up. Defaults to 24 hours.
	SetupTtl *HumanDuration `json:"setup_ttl,omitempty" yaml:"setup_ttl,omitempty"`
}

Connections contains configuration for connection management.

func (*Connections) GetSetupTtlOrDefault

func (c *Connections) GetSetupTtlOrDefault() time.Duration

GetSetupTtlOrDefault returns the configured setup TTL, or 24 hours if not configured.

type Connector

type Connector = connectors.Connector

Re-export types from the connectors sub-package

type Connectors

type Connectors = connectors.Connectors

Re-export types from the connectors sub-package

type CookieConfig

type CookieConfig struct {
	DomainVal   *string `json:"domain,omitempty" yaml:"domain,omitempty"`
	SameSiteVal *string `json:"same_site,omitempty" yaml:"same_site,omitempty"`
}

type CorsConfig

type CorsConfig struct {
	AllowedOrigins   []string       `json:"allowed_origins,omitempty" yaml:"allowed_origins,omitempty"`
	AllowedMethods   []string       `json:"allowed_methods,omitempty" yaml:"allowed_methods,omitempty"`
	AllowedHeaders   []string       `json:"allowed_headers,omitempty" yaml:"allowed_headers,omitempty"`
	ExposedHeaders   []string       `json:"exposed_headers,omitempty" yaml:"exposed_headers,omitempty"`
	MaxAge           *HumanDuration `json:"max_age,omitempty" yaml:"max_age,omitempty"`
	AllowCredentials *bool          `json:"allow_credentials,omitempty" yaml:"allow_credentials,omitempty"`
}

func (*CorsConfig) ToGinCorsConfig

func (c *CorsConfig) ToGinCorsConfig(defaults *cors.Config) *cors.Config

type DataEncryptionKeyInfo

type DataEncryptionKeyInfo = keyschema.DataEncryptionKeyInfo

Re-export types from the key resource sub-package

type DataEncryptionKeys

type DataEncryptionKeys struct {
	// RotationInterval is how old the current DEK can be before a new current DEK
	// is generated. Defaults to 90 days.
	RotationInterval *HumanDuration `json:"rotation_interval,omitempty" yaml:"rotation_interval,omitempty"`

	// EnsureCurrent controls whether the DEK generator creates a current DEK
	// when a data-encryption key has none. Defaults to true.
	EnsureCurrent *bool `json:"ensure_current,omitempty" yaml:"ensure_current,omitempty"`
}

DataEncryptionKeys configures lifecycle management for generated DEKs used by data-encryption keys.

func (*DataEncryptionKeys) GetRotationInterval

func (d *DataEncryptionKeys) GetRotationInterval() time.Duration

func (*DataEncryptionKeys) ShouldEnsureCurrent

func (d *DataEncryptionKeys) ShouldEnsureCurrent() bool

func (*DataEncryptionKeys) ShouldRotate

func (d *DataEncryptionKeys) ShouldRotate(now time.Time, currentCreatedAt time.Time) bool

func (*DataEncryptionKeys) Validate

type Database

type Database struct {
	InnerVal DatabaseImpl `json:"-" yaml:"-"`
}

Database is the holder for a DatabaseImpl instance.

func (*Database) GetAutoMigrate

func (d *Database) GetAutoMigrate() bool

func (*Database) GetAutoMigrationLockDuration

func (d *Database) GetAutoMigrationLockDuration() time.Duration

func (*Database) GetDriver

func (d *Database) GetDriver() string

func (*Database) GetDsn

func (d *Database) GetDsn() string

func (*Database) GetPlaceholderFormat

func (d *Database) GetPlaceholderFormat() sq.PlaceholderFormat

func (*Database) GetProvider

func (d *Database) GetProvider() DatabaseProvider

func (*Database) GetSoftDeleteRetention

func (d *Database) GetSoftDeleteRetention() *time.Duration

func (*Database) GetSoftDeleteRetentionOrDefault

func (d *Database) GetSoftDeleteRetentionOrDefault() time.Duration

GetSoftDeleteRetentionOrDefault returns the configured soft delete retention duration, or 30 days if not configured.

func (*Database) GetUri

func (d *Database) GetUri() string

func (*Database) MarshalJSON

func (d *Database) MarshalJSON() ([]byte, error)

func (*Database) MarshalYAML

func (d *Database) MarshalYAML() (interface{}, error)

func (*Database) UnmarshalJSON

func (d *Database) UnmarshalJSON(data []byte) error

UnmarshalJSON handles unmarshalling from JSON while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

func (*Database) UnmarshalYAML

func (d *Database) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML handles unmarshalling from YAML while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

func (*Database) Validate

func (d *Database) Validate(vc *common.ValidationContext) error

type DatabaseClickhouse

type DatabaseClickhouse struct {
	Provider                  DatabaseProvider `json:"provider" yaml:"provider"`
	Addresses                 []string         `json:"addresses,omitempty" yaml:"addresses,omitempty"`
	Address                   *StringValue     `json:"address,omitempty" yaml:"address,omitempty"`
	AddressList               *StringValue     `json:"address_list,omitempty" yaml:"address_list,omitempty"`
	Database                  *StringValue     `json:"database" yaml:"database"`
	User                      *StringValue     `json:"user,omitempty" yaml:"user,omitempty"`
	Password                  *StringValue     `json:"password,omitempty" yaml:"password,omitempty"`
	Protocol                  *string          `json:"protocol,omitempty" yaml:"protocol,omitempty"`
	AutoMigrate               bool             `json:"auto_migrate,omitempty" yaml:"auto_migrate,omitempty"`
	AutoMigrationLockDuration *HumanDuration   `json:"auto_migration_lock_duration,omitempty" yaml:"auto_migration_lock_duration,omitempty"`
}

DatabaseClickhouse holds configuration for using ClickHouse as a database.

func (*DatabaseClickhouse) GetAddresses

func (d *DatabaseClickhouse) GetAddresses(ctx context.Context) ([]string, error)

func (*DatabaseClickhouse) GetAutoMigrate

func (d *DatabaseClickhouse) GetAutoMigrate() bool

func (*DatabaseClickhouse) GetAutoMigrationLockDuration

func (d *DatabaseClickhouse) GetAutoMigrationLockDuration() time.Duration

func (*DatabaseClickhouse) GetDriver

func (d *DatabaseClickhouse) GetDriver() string

func (*DatabaseClickhouse) GetDsn

func (d *DatabaseClickhouse) GetDsn() string

GetDsn gets the Data Source Name

func (*DatabaseClickhouse) GetPlaceholderFormat

func (d *DatabaseClickhouse) GetPlaceholderFormat() sq.PlaceholderFormat

func (*DatabaseClickhouse) GetProtocol

func (d *DatabaseClickhouse) GetProtocol() clickhouse.Protocol

GetProtocol returns the ClickHouse connection protocol. Defaults to HTTP if not set.

func (*DatabaseClickhouse) GetProvider

func (d *DatabaseClickhouse) GetProvider() DatabaseProvider

func (*DatabaseClickhouse) GetSoftDeleteRetention

func (d *DatabaseClickhouse) GetSoftDeleteRetention() *time.Duration

func (*DatabaseClickhouse) GetUri

func (d *DatabaseClickhouse) GetUri() string

func (*DatabaseClickhouse) ToClickhouseOptions

func (d *DatabaseClickhouse) ToClickhouseOptions() (*clickhouse.Options, error)

func (*DatabaseClickhouse) Validate

type DatabaseImpl

type DatabaseImpl interface {
	GetProvider() DatabaseProvider
	GetAutoMigrate() bool
	GetAutoMigrationLockDuration() time.Duration
	GetSoftDeleteRetention() *time.Duration
	GetUri() string
	GetDsn() string
	GetDriver() string
	GetPlaceholderFormat() sq.PlaceholderFormat
	Validate(vc *common.ValidationContext) error
}

DatabaseImpl is the interface implemented by concrete database configurations.

type DatabasePostgres

type DatabasePostgres struct {
	Provider                  DatabaseProvider  `json:"provider" yaml:"provider"`
	Host                      *StringValue      `json:"host" yaml:"host"`
	Port                      *IntegerValue     `json:"port,omitempty" yaml:"port,omitempty"`
	User                      *StringValue      `json:"user,omitempty" yaml:"user,omitempty"`
	Password                  *StringValue      `json:"password,omitempty" yaml:"password,omitempty"`
	Database                  *StringValue      `json:"database" yaml:"database"`
	SSLMode                   *StringValue      `json:"sslmode,omitempty" yaml:"sslmode,omitempty"`
	Params                    map[string]string `json:"params,omitempty" yaml:"params,omitempty"`
	MaxOpenConns              *IntegerValue     `json:"max_open_conns,omitempty" yaml:"max_open_conns,omitempty"`
	MaxIdleConns              *IntegerValue     `json:"max_idle_conns,omitempty" yaml:"max_idle_conns,omitempty"`
	ConnMaxLifetime           *HumanDuration    `json:"conn_max_lifetime,omitempty" yaml:"conn_max_lifetime,omitempty"`
	ConnMaxIdleTime           *HumanDuration    `json:"conn_max_idle_time,omitempty" yaml:"conn_max_idle_time,omitempty"`
	AutoMigrate               bool              `json:"auto_migrate,omitempty" yaml:"auto_migrate,omitempty"`
	AutoMigrationLockDuration *HumanDuration    `json:"auto_migration_lock_duration,omitempty" yaml:"auto_migration_lock_duration,omitempty"`
	SoftDeleteRetention       *HumanDuration    `json:"soft_delete_retention,omitempty" yaml:"soft_delete_retention,omitempty"`
}

func (*DatabasePostgres) GetAutoMigrate

func (d *DatabasePostgres) GetAutoMigrate() bool

func (*DatabasePostgres) GetAutoMigrationLockDuration

func (d *DatabasePostgres) GetAutoMigrationLockDuration() time.Duration

func (*DatabasePostgres) GetDriver

func (d *DatabasePostgres) GetDriver() string

func (*DatabasePostgres) GetDsn

func (d *DatabasePostgres) GetDsn() string

GetDsn gets the Data Source Name

func (*DatabasePostgres) GetPlaceholderFormat

func (d *DatabasePostgres) GetPlaceholderFormat() sq.PlaceholderFormat

func (*DatabasePostgres) GetProvider

func (d *DatabasePostgres) GetProvider() DatabaseProvider

func (*DatabasePostgres) GetSoftDeleteRetention

func (d *DatabasePostgres) GetSoftDeleteRetention() *time.Duration

func (*DatabasePostgres) GetUri

func (d *DatabasePostgres) GetUri() string

func (*DatabasePostgres) Validate

type DatabaseProvider

type DatabaseProvider string
const (
	DatabaseProviderSqlite     DatabaseProvider = "sqlite"
	DatabaseProviderPostgres   DatabaseProvider = "postgres"
	DatabaseProviderClickhouse DatabaseProvider = "clickhouse"
)

type DatabaseSqlite

type DatabaseSqlite struct {
	Provider                  DatabaseProvider `json:"provider" yaml:"provider"`
	Path                      string           `json:"path" yaml:"path"`
	AutoMigrate               bool             `json:"auto_migrate,omitempty" yaml:"auto_migrate,omitempty"`
	AutoMigrationLockDuration *HumanDuration   `json:"auto_migration_lock_duration,omitempty" yaml:"auto_migration_lock_duration,omitempty"`
	SoftDeleteRetention       *HumanDuration   `json:"soft_delete_retention,omitempty" yaml:"soft_delete_retention,omitempty"`
}

func (*DatabaseSqlite) GetAutoMigrate

func (d *DatabaseSqlite) GetAutoMigrate() bool

func (*DatabaseSqlite) GetAutoMigrationLockDuration

func (d *DatabaseSqlite) GetAutoMigrationLockDuration() time.Duration

func (*DatabaseSqlite) GetDriver

func (d *DatabaseSqlite) GetDriver() string

func (*DatabaseSqlite) GetDsn

func (d *DatabaseSqlite) GetDsn() string

GetDsn gets the Data Source Name

func (*DatabaseSqlite) GetPlaceholderFormat

func (d *DatabaseSqlite) GetPlaceholderFormat() sq.PlaceholderFormat

func (*DatabaseSqlite) GetProvider

func (d *DatabaseSqlite) GetProvider() DatabaseProvider

func (*DatabaseSqlite) GetSoftDeleteRetention

func (d *DatabaseSqlite) GetSoftDeleteRetention() *time.Duration

func (*DatabaseSqlite) GetUri

func (d *DatabaseSqlite) GetUri() string

func (*DatabaseSqlite) Validate

func (d *DatabaseSqlite) Validate(vc *common.ValidationContext) error

type DevSettings

type DevSettings struct {
	Enabled                  bool `json:"enabled" yaml:"enabled"`
	FakeEncryption           bool `json:"fake_encryption" yaml:"fake_encryption"`
	FakeEncryptionSkipBase64 bool `json:"fake_encryption_skip_base64" yaml:"fake_encryption_skip_base64"`
}

DevSettings are flags that can be set to turn auth proxy into developer mode to make it easer to test and see what is going on in the system. These settings should not be enabled in production.

func (*DevSettings) IsEnabled

func (d *DevSettings) IsEnabled() bool

func (*DevSettings) IsFakeEncryptionEnabled

func (d *DevSettings) IsFakeEncryptionEnabled() bool

func (*DevSettings) IsFakeEncryptionSkipBase64Enabled

func (d *DevSettings) IsFakeEncryptionSkipBase64Enabled() bool

type ErrorPage

type ErrorPage string
const (
	ErrorPageNotFound      ErrorPage = "not_found"
	ErrorPageUnauthorized  ErrorPage = "unauthorized"
	ErrorPageInternalError ErrorPage = "internal_error"
)

type ErrorPages

type ErrorPages struct {
	NotFound      string       `json:"not_found,omitempty" yaml:"not_found,omitempty"`
	Unauthorized  string       `json:"unauthorized,omitempty" yaml:"unauthorized,omitempty"`
	InternalError string       `json:"internal_error,omitempty" yaml:"internal_error,omitempty"`
	Template      *StringValue `json:"template,omitempty" yaml:"template,omitempty"`
}

func (*ErrorPages) RenderErrorOrRedirect

func (ep *ErrorPages) RenderErrorOrRedirect(gctx *gin.Context, vals ErrorTemplateValues, err error)

func (*ErrorPages) RenderErrorPage

func (ep *ErrorPages) RenderErrorPage(gctx *gin.Context, vals ErrorTemplateValues)

func (*ErrorPages) UrlForError

func (ep *ErrorPages) UrlForError(error ErrorPage, publicBaseUrl string) string

type ErrorTemplateValues

type ErrorTemplateValues struct {
	Error       ErrorPage
	Title       string
	Description string
}

type FullRequestRecording

type FullRequestRecording string
const (
	FullRequestRecordingNever  FullRequestRecording = "never"
	FullRequestRecordingAlways FullRequestRecording = "always"
)

type GeneratedDataEncryptionKey

type GeneratedDataEncryptionKey = keyschema.GeneratedDataEncryptionKey

Re-export types from the key resource sub-package

type HostApplication

type HostApplication struct {
	// InitiateSessionUrl is the URL that will be redirected to in order to establish a session for an actor. This
	// happens if the marketplace portal is accessed without coming from a pre-authorized context. This URL should
	// take a `redirect_url` query parameter where the actor should be redirected to following successful authentication.
	// When redirecting to `redirect_url`, the host application should append an `auth_token` query param with a signed
	// JWT for authenticating the user. This JWT should use a nonce and expiration to protect against session
	// hijacking
	InitiateSessionUrl *StringValue `json:"initiate_session_url" yaml:"initiate_session_url"`
}

func (*HostApplication) GetInitiateSessionUrl

func (ha *HostApplication) GetInitiateSessionUrl(returnTo string) string

func (*HostApplication) Validate

func (ha *HostApplication) Validate(vc *common.ValidationContext) error

type HttpService

type HttpService interface {
	Service
	Port() uint64
	IsHttps() bool
	TlsConfig() (*tls.Config, error)
	Domain() string
	GetBaseUrl() string
	SupportsSession() bool
	GetServerAndHealthChecker(
		server http.Handler,
		healthChecker http.Handler,
	) (httpServer *http.Server, httpHealthChecker *http.Server, err error)
}

type HttpServiceLike

type HttpServiceLike interface {
	Domain() string
	GetBaseUrl() string
}

type HttpServiceWithSession

type HttpServiceWithSession interface {
	HttpService
	SessionTimeout() time.Duration
	CookieDomain() string
	CookieSameSite() http.SameSite
	XsrfRequestQueueDepth() int
}

type HumanByteSize

type HumanByteSize = common.HumanByteSize

Re-export types from the common sub-package

type HumanDuration

type HumanDuration = common.HumanDuration

Re-export types from the common sub-package

type Image

type Image = common.Image

Re-export types from the common sub-package

type ImageBase64

type ImageBase64 = common.ImageBase64

Re-export types from the common sub-package

type ImagePublicUrl

type ImagePublicUrl = common.ImagePublicUrl

Re-export types from the common sub-package

type IntegerValue

type IntegerValue = common.IntegerValue

Re-export types from the common sub-package

type IntegerValueDirect

type IntegerValueDirect = common.IntegerValueDirect

Re-export types from the common sub-package

type IntegerValueEnvVar

type IntegerValueEnvVar = common.IntegerValueEnvVar

Re-export types from the common sub-package

type Key

type Key = keyschema.Key

Re-export types from the key resource sub-package

type KeyData

type KeyData = keyschema.KeyData

Re-export types from the key resource sub-package

type KeyDataAwsKMS

type KeyDataAwsKMS = keyschema.KeyDataAwsKMS

Re-export types from the key resource sub-package

type KeyDataAwsSecret

type KeyDataAwsSecret = keyschema.KeyDataAwsSecret

Re-export types from the key resource sub-package

type KeyDataBase64Val

type KeyDataBase64Val = keyschema.KeyDataBase64Val

Re-export types from the key resource sub-package

type KeyDataEnvBase64Var

type KeyDataEnvBase64Var = keyschema.KeyDataEnvBase64Var

Re-export types from the key resource sub-package

type KeyDataEnvVar

type KeyDataEnvVar = keyschema.KeyDataEnvVar

Re-export types from the key resource sub-package

type KeyDataFile

type KeyDataFile = keyschema.KeyDataFile

Re-export types from the key resource sub-package

type KeyDataGcpKMS

type KeyDataGcpKMS = keyschema.KeyDataGcpKMS

Re-export types from the key resource sub-package

type KeyDataGcpSecret

type KeyDataGcpSecret = keyschema.KeyDataGcpSecret

Re-export types from the key resource sub-package

type KeyDataGeneratesDataEncryptionKeys

type KeyDataGeneratesDataEncryptionKeys = keyschema.KeyDataGeneratesDataEncryptionKeys

Re-export types from the key resource sub-package

type KeyDataMock

type KeyDataMock = keyschema.KeyDataMock

Re-export types from the key resource sub-package

type KeyDataMockKMS

type KeyDataMockKMS = keyschema.KeyDataMockKMS

Re-export types from the key resource sub-package

type KeyDataRandomBytes

type KeyDataRandomBytes = keyschema.KeyDataRandomBytes

Re-export types from the key resource sub-package

type KeyDataRawVal

type KeyDataRawVal = keyschema.KeyDataRawVal

Re-export types from the key resource sub-package

type KeyDataRequiresDataEncryptionKeys

type KeyDataRequiresDataEncryptionKeys = keyschema.KeyDataRequiresDataEncryptionKeys

Re-export types from the key resource sub-package

type KeyDataType

type KeyDataType = keyschema.KeyDataType

Re-export types from the key resource sub-package

type KeyDataValue

type KeyDataValue = keyschema.KeyDataValue

Re-export types from the key resource sub-package

type KeyDataVault

type KeyDataVault = keyschema.KeyDataVault

Re-export types from the key resource sub-package

type KeyDataVaultTransit

type KeyDataVaultTransit = keyschema.KeyDataVaultTransit

Re-export types from the key resource sub-package

type KeyDataWrapsDataEncryptionKeys

type KeyDataWrapsDataEncryptionKeys = keyschema.KeyDataWrapsDataEncryptionKeys

Re-export types from the key resource sub-package

type KeyPublicPrivate

type KeyPublicPrivate = keyschema.KeyPublicPrivate

Re-export types from the key resource sub-package

type KeyShared

type KeyShared = keyschema.KeyShared

Re-export types from the key resource sub-package

type KeyType

type KeyType = keyschema.KeyType

Re-export types from the key resource sub-package

type KeyVersionInfo

type KeyVersionInfo = keyschema.KeyVersionInfo

Re-export types from the key resource sub-package

type KeyVersionProtectedData

type KeyVersionProtectedData = keyschema.KeyVersionProtectedData

Re-export types from the key resource sub-package

type KeyWrappingKeyInfo

type KeyWrappingKeyInfo = keyschema.KeyWrappingKeyInfo

Re-export types from the key resource sub-package

type LoggingConfig

type LoggingConfig struct {
	InnerVal LoggingImpl `json:"-" yaml:"-"`
}

LoggingConfig is the holder for a LoggingImpl instance.

func (*LoggingConfig) GetRootLogger

func (l *LoggingConfig) GetRootLogger() *slog.Logger

func (*LoggingConfig) GetType

func (l *LoggingConfig) GetType() LoggingConfigType

func (*LoggingConfig) MarshalJSON

func (l *LoggingConfig) MarshalJSON() ([]byte, error)

func (*LoggingConfig) MarshalYAML

func (l *LoggingConfig) MarshalYAML() (interface{}, error)

func (*LoggingConfig) UnmarshalJSON

func (l *LoggingConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON handles unmarshalling from JSON while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

func (*LoggingConfig) UnmarshalYAML

func (l *LoggingConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML handles unmarshalling from YAML while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

type LoggingConfigJson

type LoggingConfigJson struct {
	Type   LoggingConfigType   `json:"type" yaml:"type"`
	To     LoggingConfigOutput `json:"to,omitempty" yaml:"to,omitempty"`
	Level  LoggingConfigLevel  `json:"level,omitempty" yaml:"level,omitempty"`
	Source bool                `json:"source,omitempty" yaml:"source,omitempty"`
}

func (*LoggingConfigJson) GetRootLogger

func (l *LoggingConfigJson) GetRootLogger() *slog.Logger

func (*LoggingConfigJson) GetType

func (l *LoggingConfigJson) GetType() LoggingConfigType

type LoggingConfigLevel

type LoggingConfigLevel string
const (
	LevelDebug LoggingConfigLevel = "debug"
	LevelInfo  LoggingConfigLevel = "info"
	LevelWarn  LoggingConfigLevel = "warn"
	LevelError LoggingConfigLevel = "error"
)

func (LoggingConfigLevel) Level

func (l LoggingConfigLevel) Level() slog.Level

func (LoggingConfigLevel) String

func (l LoggingConfigLevel) String() string

type LoggingConfigNone

type LoggingConfigNone struct {
	Type LoggingConfigType `json:"type" yaml:"type"`
}

func (*LoggingConfigNone) GetRootLogger

func (l *LoggingConfigNone) GetRootLogger() *slog.Logger

func (*LoggingConfigNone) GetType

func (l *LoggingConfigNone) GetType() LoggingConfigType

type LoggingConfigOutput

type LoggingConfigOutput string
const (
	OutputStdout LoggingConfigOutput = "stdout"
	OutputStderr LoggingConfigOutput = "stderr"
)

func (LoggingConfigOutput) Output

func (l LoggingConfigOutput) Output() *os.File

type LoggingConfigText

type LoggingConfigText struct {
	Type   LoggingConfigType   `json:"type" yaml:"type"`
	To     LoggingConfigOutput `json:"to,omitempty" yaml:"to,omitempty"`
	Level  LoggingConfigLevel  `json:"level,omitempty" yaml:"level,omitempty"`
	Source bool                `json:"source,omitempty" yaml:"source,omitempty"`
}

func (*LoggingConfigText) GetRootLogger

func (l *LoggingConfigText) GetRootLogger() *slog.Logger

func (*LoggingConfigText) GetType

func (l *LoggingConfigText) GetType() LoggingConfigType

type LoggingConfigTint

type LoggingConfigTint struct {
	Type       LoggingConfigType   `json:"type" yaml:"type"`
	To         LoggingConfigOutput `json:"to,omitempty" yaml:"to,omitempty"`
	Level      LoggingConfigLevel  `json:"level,omitempty" yaml:"level,omitempty"`
	Source     bool                `json:"source,omitempty" yaml:"source,omitempty"`
	NoColor    *bool               `json:"no_color,omitempty" yaml:"no_color,omitempty"`
	TimeFormat *string             `json:"time_format,omitempty" yaml:"time_format,omitempty"`
}

func (*LoggingConfigTint) GetRootLogger

func (l *LoggingConfigTint) GetRootLogger() *slog.Logger

func (*LoggingConfigTint) GetType

func (l *LoggingConfigTint) GetType() LoggingConfigType

type LoggingConfigType

type LoggingConfigType string
const (
	LoggingConfigTypeText LoggingConfigType = "text"
	LoggingConfigTypeJson LoggingConfigType = "json"
	LoggingConfigTypeTint LoggingConfigType = "tint"
	LoggingConfigTypeNone LoggingConfigType = "none"
)

type LoggingImpl

type LoggingImpl interface {
	GetRootLogger() *slog.Logger
	GetType() LoggingConfigType
}

LoggingImpl is the interface implemented by concrete logging configurations.

type Marketplace

type Marketplace struct {
	BaseUrl *StringValue `json:"base_url,omitempty" yaml:"base_url,omitempty"`
}

type OAuth

type OAuth struct {
	// InitiateToRedirectTtl is the time allowed between the oauth initiate API call, and the time when the browser
	// completes the redirect from the auth proxy public service. This value must be less than RoundTripTtl. This value
	// should be as small as possible as the handoff from the API to the redirect involves a one-time-use auth token
	// in the query parameters, which could be used to steal the session.
	InitiateToRedirectTtl HumanDuration `json:"initiate_to_redirect_ttl" yaml:"initiate_to_redirect_ttl"`

	// RoundTripTtl is the time we allow for the user to go through the oauth flow, from the initiate call, all the
	// way back to returning to AuthProxy to exchange the auth token for an access token. The purpose of this timeout
	// is to reduce the time that a redirect link from auth proxy would be valid for the purposes of phishing other
	// peoples credentials using this link as the basis.
	RoundTripTtl HumanDuration `json:"round_trip_ttl" yaml:"round_trip_ttl"`

	// RefreshTokensInBackground controls if the system should proactively refresh tokens in the background. Default
	// value is `true`. If set to false, tokens will not be refreshed until they are detected to be expired when used.
	RefreshTokensInBackground *bool `json:"refresh_tokens_in_background" yaml:"refresh_tokens_in_background"`

	// RefreshTokensTimeBeforeExpiry is the default time prior to token expiry to refresh the tokens. This value can be
	// overridden on a per-connector basis, but the granularity of this value is limited by the cron for running refresh.
	// If not specified the default value is 10 minutes.
	RefreshTokensTimeBeforeExpiry *HumanDuration `json:"refresh_tokens_time_before_expiry" yaml:"refresh_tokens_time_before_expiry"`

	// RefreshTokensCronSchedule is the schedule at which the background job to refresh oauth tokens will run. If not
	// specified, runs every 10 minutes.
	RefreshTokensCronSchedule string `json:"refresh_tokens_cron_schedule" yaml:"refresh_tokens_cron_schedule"`
}

func (*OAuth) GetInitiateToRedirectTtlOrDefault

func (o *OAuth) GetInitiateToRedirectTtlOrDefault() time.Duration

func (*OAuth) GetRefreshTokensCronScheduleOrDefault

func (o *OAuth) GetRefreshTokensCronScheduleOrDefault() string

func (*OAuth) GetRefreshTokensInBackgroundOrDefault

func (o *OAuth) GetRefreshTokensInBackgroundOrDefault() bool

func (*OAuth) GetRefreshTokensTimeBeforeExpiryOrDefault

func (o *OAuth) GetRefreshTokensTimeBeforeExpiryOrDefault() time.Duration

func (*OAuth) GetRoundTripTtlOrDefault

func (o *OAuth) GetRoundTripTtlOrDefault() time.Duration

type OAuth2GrantType

type OAuth2GrantType = connectors.OAuth2GrantType

Re-export types from the connectors sub-package

type PKCEMethod

type PKCEMethod = connectors.PKCEMethod

Re-export types from the connectors sub-package

type Predicate

type Predicate = common.Predicate

Re-export types from the connectors sub-package

type ProviderType

type ProviderType = keyschema.ProviderType

Re-export types from the key resource sub-package

type Redis

type Redis struct {
	InnerVal RedisImpl `json:"-" yaml:"-"`
}

Redis is the holder for a RedisImpl instance.

func (*Redis) GetProvider

func (r *Redis) GetProvider() RedisProvider

func (*Redis) MarshalJSON

func (r *Redis) MarshalJSON() ([]byte, error)

func (*Redis) MarshalYAML

func (r *Redis) MarshalYAML() (interface{}, error)

func (*Redis) UnmarshalJSON

func (r *Redis) UnmarshalJSON(data []byte) error

UnmarshalJSON handles unmarshalling from JSON while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

func (*Redis) UnmarshalYAML

func (r *Redis) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML handles unmarshalling from YAML while allowing us to make decisions about how the data is unmarshalled based on the concrete type being represented

type RedisImpl

type RedisImpl interface {
	GetProvider() RedisProvider
}

RedisImpl is the interface implemented by concrete Redis configurations.

type RedisMiniredis

type RedisMiniredis struct {
	Provider RedisProvider `json:"provider" yaml:"provider"`
}

func (*RedisMiniredis) GetProvider

func (d *RedisMiniredis) GetProvider() RedisProvider

type RedisProvider

type RedisProvider string
const (
	RedisProviderMiniredis RedisProvider = "miniredis"
	RedisProviderRedis     RedisProvider = "redis"
)

type RedisReal

type RedisReal struct {
	Provider RedisProvider `json:"provider" yaml:"provider"`

	// The network type, either tcp or unix.
	// Default is tcp.
	Network string `json:"network" yaml:"network"`

	// host:port address.
	Address string `json:"address" yaml:"address"`

	// Protocol 2 or 3. Use the version to negotiate RESP version with redis-server.
	// Default is 3.
	Protocol int `json:"protocol" yaml:"protocol"`

	// Use the specified Username to authenticate the current connection
	// with one of the connections defined in the ACL list when connecting
	// to a Redis 6.0 instance, or greater, that is using the Redis ACL system.
	Username *StringValue `json:"username" yaml:"username"`

	// Optional password. Must match the password specified in the
	// requirepass server configuration option (if connecting to a Redis 5.0 instance, or lower),
	// or the User Password when connecting to a Redis 6.0 instance, or greater,
	// that is using the Redis ACL system.
	Password *StringValue `json:"password" yaml:"password"`

	// Database to be selected after connecting to the server.
	DB int `json:"db" yaml:"db"`
}

func (*RedisReal) GetProvider

func (d *RedisReal) GetProvider() RedisProvider

func (*RedisReal) ToRedisOptions

func (d *RedisReal) ToRedisOptions(ctx context.Context) (*redis.Options, error)

type Root

type Root struct {
	AdminApi        ServiceAdminApi `json:"admin_api" yaml:"admin_api"`
	Api             ServiceApi      `json:"api" yaml:"api"`
	Public          ServicePublic   `json:"public" yaml:"public"`
	Worker          ServiceWorker   `json:"worker" yaml:"worker"`
	Marketplace     *Marketplace    `json:"marketplace,omitempty" yaml:"marketplace,omitempty"`
	HostApplication HostApplication `json:"host_application" yaml:"host_application"`
	SystemAuth      SystemAuth      `json:"system_auth" yaml:"system_auth"`
	Database        *Database       `json:"database" yaml:"database"`
	Logging         *LoggingConfig  `json:"logging,omitempty" yaml:"logging,omitempty"`
	Redis           *Redis          `json:"redis" yaml:"redis"`
	Oauth           OAuth           `json:"oauth" yaml:"oauth"`
	ErrorPages      ErrorPages      `json:"error_pages,omitempty" yaml:"error_pages,omitempty"`
	Connectors      *Connectors     `json:"connectors" yaml:"connectors"`
	AppMetrics      *AppMetrics     `json:"app_metrics,omitempty" yaml:"app_metrics,omitempty"`
	Connections     *Connections    `json:"connections,omitempty" yaml:"connections,omitempty"`
	Tasks           *Tasks          `json:"tasks,omitempty" yaml:"tasks,omitempty"`
	Telemetry       *Telemetry      `json:"telemetry,omitempty" yaml:"telemetry,omitempty"`
	DevSettings     *DevSettings    `json:"dev_settings,omitempty" yaml:"dev_settings,omitempty"`
}

func (*Root) GetRootLogger

func (r *Root) GetRootLogger() *slog.Logger

func (*Root) MustGetService

func (r *Root) MustGetService(serviceId ServiceId) Service

func (*Root) Validate

func (r *Root) Validate() error

type Scope

type Scope = connectors.Scope

Re-export types from the connectors sub-package

type ScopeRequired

type ScopeRequired = connectors.ScopeRequired

Re-export types from the connectors sub-package

type Service

type Service interface {
	GetId() ServiceId
	HealthCheckPort() uint64
}

type ServiceAdminApi

type ServiceAdminApi struct {
	ServiceHttp
	Ui                       *ServiceAdminUi                   `json:"ui" yaml:"ui"`
	SessionTimeoutVal        *HumanDuration                    `json:"session_timeout" yaml:"session_timeout"`
	XsrfRequestQueueDepthVal *int                              `json:"xsrf_request_queue_depth" yaml:"xsrf_request_queue_depth"`
	StaticVal                *ServicePublicStaticContentConfig `json:"static,omitempty" yaml:"static,omitempty"`
	CookieVal                *CookieConfig                     `json:"cookie,omitempty" yaml:"cookie,omitempty"`
}

func (*ServiceAdminApi) CookieDomain

func (s *ServiceAdminApi) CookieDomain() string

func (*ServiceAdminApi) CookieSameSite

func (s *ServiceAdminApi) CookieSameSite() http.SameSite

func (*ServiceAdminApi) GetId

func (s *ServiceAdminApi) GetId() ServiceId

func (*ServiceAdminApi) SessionTimeout

func (s *ServiceAdminApi) SessionTimeout() time.Duration

func (*ServiceAdminApi) SupportsSession

func (s *ServiceAdminApi) SupportsSession() bool

func (*ServiceAdminApi) SupportsUi

func (s *ServiceAdminApi) SupportsUi() bool

func (*ServiceAdminApi) UiBaseUrl

func (s *ServiceAdminApi) UiBaseUrl() string

func (*ServiceAdminApi) UnmarshalYAML

func (s *ServiceAdminApi) UnmarshalYAML(value *yaml.Node) error

func (*ServiceAdminApi) XsrfRequestQueueDepth

func (s *ServiceAdminApi) XsrfRequestQueueDepth() int

type ServiceAdminUi

type ServiceAdminUi struct {
	Enabled bool         `json:"enabled" yaml:"enabled"`
	BaseUrl *StringValue `json:"base_url" yaml:"base_url"`

	// InitiateSessionUrl is the URL that will be redirected to in order to establish a session for an actor. This
	// happens if the admin portal is accessed without coming from a pre-authorized context. This URL should
	// take a `redirect_url` query parameter where the actor should be redirected to following successful authentication.
	// When redirecting to `redirect_url`, the host application should append an `auth_token` query param with a signed
	// JWT for authenticating the user. This JWT should use a nonce and expiration to protect against session
	// hijacking
	InitiateSessionUrl *StringValue `json:"initiate_session_url" yaml:"initiate_session_url"`
}

func (*ServiceAdminUi) GetInitiateSessionUrl

func (s *ServiceAdminUi) GetInitiateSessionUrl(returnTo string) string

type ServiceApi

type ServiceApi struct {
	ServiceHttp
}

func (*ServiceApi) GetId

func (s *ServiceApi) GetId() ServiceId

func (*ServiceApi) SupportsSession

func (s *ServiceApi) SupportsSession() bool

func (*ServiceApi) UnmarshalYAML

func (s *ServiceApi) UnmarshalYAML(value *yaml.Node) error

type ServiceCommon

type ServiceCommon struct {
	HealthCheckPortVal *IntegerValue `json:"health_check_port,omitempty" yaml:"health_check_port,omitempty"`
}

type ServiceHttp

type ServiceHttp struct {
	ServiceCommon `json:",inline" yaml:",inline"`
	PortVal       *IntegerValue `json:"port" yaml:"port"`
	BaseUrl       *StringValue  `json:"base_url,omitempty" yaml:"base_url,omitempty"`
	DomainVal     string        `json:"domain" yaml:"domain"`
	IsHttpsVal    bool          `json:"https" yaml:"https"`
	CorsVal       *CorsConfig   `json:"cors,omitempty" yaml:"cors,omitempty"`
	TlsVal        TlsConfig     `json:"tls,omitempty" yaml:"tls,omitempty"`
}

func (*ServiceHttp) Domain

func (s *ServiceHttp) Domain() string

func (*ServiceHttp) GetBaseUrl

func (s *ServiceHttp) GetBaseUrl() string

func (*ServiceHttp) GetServerAndHealthChecker

func (s *ServiceHttp) GetServerAndHealthChecker(
	server http.Handler,
	healthChecker http.Handler,
) (httpServer *http.Server, httpHealthChecker *http.Server, err error)

GetServerAndHealthChecker returns a configured HTTP server based on the handler provided along with the configuration specified in this object. Outside logic should combine the health checker into the server if they share the same port.

func (*ServiceHttp) HealthCheckPort

func (s *ServiceHttp) HealthCheckPort() uint64

func (*ServiceHttp) IsHttps

func (s *ServiceHttp) IsHttps() bool

func (*ServiceHttp) Port

func (s *ServiceHttp) Port() uint64

func (*ServiceHttp) TlsConfig

func (s *ServiceHttp) TlsConfig() (*tls.Config, error)

type ServiceId

type ServiceId string
const (
	ServiceIdAdminApi ServiceId = "admin-api"
	ServiceIdApi      ServiceId = "api"
	ServiceIdPublic   ServiceId = "public"
	ServiceIdWorker   ServiceId = "worker"
)

func AllServiceIds

func AllServiceIds() []ServiceId

type ServicePublic

type ServicePublic struct {
	ServiceHttp
	SessionTimeoutVal        *HumanDuration                    `json:"session_timeout" yaml:"session_timeout"`
	XsrfRequestQueueDepthVal *int                              `json:"xsrf_request_queue_depth" yaml:"xsrf_request_queue_depth"`
	EnableMarketplaceApisVal *bool                             `json:"enable_marketplace_apis,omitempty" yaml:"enable_marketplace_apis,omitempty"`
	EnableProxyVal           *bool                             `json:"enable_proxy,omitempty" yaml:"enable_proxy,omitempty"`
	StaticVal                *ServicePublicStaticContentConfig `json:"static,omitempty" yaml:"static,omitempty"`
	CookieVal                *CookieConfig                     `json:"cookie,omitempty" yaml:"cookie,omitempty"`
}

func (*ServicePublic) CookieDomain

func (s *ServicePublic) CookieDomain() string

func (*ServicePublic) CookieSameSite

func (s *ServicePublic) CookieSameSite() http.SameSite

func (*ServicePublic) EnableMarketplaceApis

func (s *ServicePublic) EnableMarketplaceApis() bool

EnableMarketplaceApis determines if the APIs to support the marketplace are exposed on the public API to make them available via session. Defaults to true if not set. Disable this feature if the host application is wrapping the API service directly with its own custom marketplace app.

func (*ServicePublic) EnableProxy

func (s *ServicePublic) EnableProxy() bool

EnableProxy determines if proxying to 3rd parties is enabled on the public service. Defaults to false if unspecified. Enabling the 3rd party proxy on public can allow custom logic in the marketplace where the client makes calls directly to the 3rd party. This increases the surface area for security risks, however.

func (*ServicePublic) GetId

func (s *ServicePublic) GetId() ServiceId

func (*ServicePublic) SessionTimeout

func (s *ServicePublic) SessionTimeout() time.Duration

func (*ServicePublic) SupportsSession

func (s *ServicePublic) SupportsSession() bool

func (*ServicePublic) UnmarshalYAML

func (s *ServicePublic) UnmarshalYAML(value *yaml.Node) error

func (*ServicePublic) XsrfRequestQueueDepth

func (s *ServicePublic) XsrfRequestQueueDepth() int

type ServicePublicStaticContentConfig

type ServicePublicStaticContentConfig struct {
	MountAtPath   string `json:"mount_at" yaml:"mount_at"`
	ServeFromPath string `json:"serve_from" yaml:"serve_from"`
}

ServicePublicStaticContentConfig is a configuration to have the public service serve static content in addition to its other functions. This can be used to serve the marketplace SPA directly.

When ServeFromPath is empty, the service serves the UI from its compiled-in embedded filesystem (built by `vite build` and bundled via //go:embed). Set ServeFromPath to override with an on-disk build for local iteration or custom branding.

func (*ServicePublicStaticContentConfig) IsEmbedded

func (c *ServicePublicStaticContentConfig) IsEmbedded() bool

IsEmbedded reports whether the static handler should serve from the service's compiled-in UI assets rather than an on-disk directory.

type ServiceWorker

type ServiceWorker struct {
	ServiceCommon             `json:",inline" yaml:",inline"`
	ConcurrencyVal            *StringValue   `json:"concurrency" yaml:"concurrency"`
	CronSyncInterval          *HumanDuration `json:"cron_sync_interval,omitempty" yaml:"cron_sync_interval,omitempty"`
	WorkflowPollers           *StringValue   `json:"workflow_pollers,omitempty" yaml:"workflow_pollers,omitempty"`
	ActivityPollers           *StringValue   `json:"activity_pollers,omitempty" yaml:"activity_pollers,omitempty"`
	MaxParallelWorkflowTasks  *StringValue   `json:"max_parallel_workflow_tasks,omitempty" yaml:"max_parallel_workflow_tasks,omitempty"`
	MaxParallelActivityTasks  *StringValue   `json:"max_parallel_activity_tasks,omitempty" yaml:"max_parallel_activity_tasks,omitempty"`
	WorkflowHeartbeatInterval *HumanDuration `json:"workflow_heartbeat_interval,omitempty" yaml:"workflow_heartbeat_interval,omitempty"`
}

func (*ServiceWorker) GetActivityPollers

func (s *ServiceWorker) GetActivityPollers(ctx context.Context) *int

func (*ServiceWorker) GetConcurrency

func (s *ServiceWorker) GetConcurrency(ctx context.Context) int

func (*ServiceWorker) GetCronSyncInterval

func (s *ServiceWorker) GetCronSyncInterval() time.Duration

func (*ServiceWorker) GetId

func (s *ServiceWorker) GetId() ServiceId

func (*ServiceWorker) GetMaxParallelActivityTasks

func (s *ServiceWorker) GetMaxParallelActivityTasks(ctx context.Context) *int

func (*ServiceWorker) GetMaxParallelWorkflowTasks

func (s *ServiceWorker) GetMaxParallelWorkflowTasks(ctx context.Context) *int

func (*ServiceWorker) GetWorkflowHeartbeatInterval

func (s *ServiceWorker) GetWorkflowHeartbeatInterval() *time.Duration

func (*ServiceWorker) GetWorkflowPollers

func (s *ServiceWorker) GetWorkflowPollers(ctx context.Context) *int

func (*ServiceWorker) HealthCheckPort

func (s *ServiceWorker) HealthCheckPort() uint64

type StringValue

type StringValue = common.StringValue

Re-export types from the common sub-package

type StringValueBase64

type StringValueBase64 = common.StringValueBase64

Re-export types from the common sub-package

type StringValueDirect

type StringValueDirect = common.StringValueDirect

Re-export types from the common sub-package

type StringValueEnvVar

type StringValueEnvVar = common.StringValueEnvVar

Re-export types from the common sub-package

type StringValueEnvVarBase64

type StringValueEnvVarBase64 = common.StringValueEnvVarBase64

Re-export types from the common sub-package

type StringValueFile

type StringValueFile = common.StringValueFile

Re-export types from the common sub-package

type SystemAuth

type SystemAuth struct {
	JwtSigningKey       *Key                `json:"jwt_signing_key" yaml:"jwt_signing_key"`
	JwtIssuerVal        string              `json:"jwt_issuer" yaml:"jwt_issuer"`
	JwtTokenDurationVal time.Duration       `json:"jwt_token_duration" yaml:"jwt_token_duration"`
	DisableXSRF         bool                `json:"disable_xsrf" yaml:"disable_xsrf"`
	Actors              *ConfiguredActors   `json:"actors" yaml:"actors"`
	GlobalAESKey        *KeyData            `json:"global_aes_key" yaml:"global_aes_key"`
	DataEncryptionKeys  *DataEncryptionKeys `json:"data_encryption_keys,omitempty" yaml:"data_encryption_keys,omitempty"`
}

func (*SystemAuth) JwtIssuer

func (sa *SystemAuth) JwtIssuer() string

func (*SystemAuth) JwtTokenDuration

func (sa *SystemAuth) JwtTokenDuration() time.Duration

type Tasks

type Tasks struct {
	// Default retention for tasks unless a value is explicitly set
	DefaultRetention *HumanDuration `json:"default_retention,omitempty" yaml:"default_retention,omitempty"`
}

type Telemetry

type Telemetry struct {
	// Enabled controls whether OpenTelemetry is initialised at all. When
	// nil or false, no exporter is started and no resource is initialised
	// beyond SDK defaults; the application receives no-op providers.
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`

	// Exporter configures the OTLP exporter destination.
	Exporter *TelemetryExporter `json:"exporter,omitempty" yaml:"exporter,omitempty"`

	// Resource configures the OTel resource attributes attached to every
	// emitted telemetry signal.
	Resource *TelemetryResource `json:"resource,omitempty" yaml:"resource,omitempty"`

	// Sampling controls trace sampling behaviour.
	Sampling *TelemetrySampling `json:"sampling,omitempty" yaml:"sampling,omitempty"`

	// Signals controls which OTel signals are emitted.
	Signals *TelemetrySignals `json:"signals,omitempty" yaml:"signals,omitempty"`

	// HTTP configures behaviour of inbound HTTP instrumentation (used by
	// later instrumentation tickets; carried in this config block so the
	// schema is complete).
	HTTP *TelemetryHTTP `json:"http,omitempty" yaml:"http,omitempty"`

	// Proxy configures label projection for proxy telemetry. The two
	// allowlists are applied independently against the request's already-
	// computed effective label set; telemetry does no merging of its own.
	Proxy *TelemetryProxy `json:"proxy,omitempty" yaml:"proxy,omitempty"`

	// Propagation configures W3C trace context injection on outbound calls.
	// Outbound propagation is opt-in.
	Propagation *TelemetryPropagation `json:"propagation,omitempty" yaml:"propagation,omitempty"`
}

Telemetry configures OpenTelemetry signals (traces, metrics, logs) for all AuthProxy services. When the block is absent or Enabled is false, all OTel providers are no-op and the SDK is not initialised.

func (*Telemetry) GetExporter

func (t *Telemetry) GetExporter() *TelemetryExporter

GetExporter returns the exporter sub-block, or a zero value if unset.

func (*Telemetry) GetHTTPExcludedPaths

func (t *Telemetry) GetHTTPExcludedPaths() []string

GetHTTPExcludedPaths returns the configured exclusion list, falling back to DefaultTelemetryHTTPExcludedPaths when nil. An explicitly empty slice in config disables exclusion entirely.

func (*Telemetry) GetProxy

func (t *Telemetry) GetProxy() *TelemetryProxy

GetProxy returns the proxy sub-block, or a zero value if unset.

func (*Telemetry) GetResource

func (t *Telemetry) GetResource() *TelemetryResource

GetResource returns the resource sub-block, or a zero value if unset.

func (*Telemetry) GetSamplingRatio

func (t *Telemetry) GetSamplingRatio() float64

GetSamplingRatio returns the configured sampling ratio, falling back to DefaultTelemetrySamplingRatio when unset. Bounded to [0, 1].

func (*Telemetry) InjectOutboundDefault

func (t *Telemetry) InjectOutboundDefault() bool

InjectOutboundDefault reports the global default for outbound trace context injection. Defaults to false (opt-in).

func (*Telemetry) IsEnabled

func (t *Telemetry) IsEnabled() bool

IsEnabled reports whether the telemetry block is set and Enabled is true. Treats nil and explicit false as disabled.

func (*Telemetry) LogsEnabled

func (t *Telemetry) LogsEnabled() bool

LogsEnabled reports whether log emission is enabled. Defaults to true when telemetry is enabled and the signals block is absent.

func (*Telemetry) MetricsEnabled

func (t *Telemetry) MetricsEnabled() bool

MetricsEnabled reports whether metric emission is enabled. Defaults to true when telemetry is enabled and the signals block is absent.

func (*Telemetry) TracesEnabled

func (t *Telemetry) TracesEnabled() bool

TracesEnabled reports whether trace emission is enabled. Defaults to true when telemetry is enabled and the signals block is absent.

func (*Telemetry) Validate

func (t *Telemetry) Validate(vc *common.ValidationContext) error

Validate checks the telemetry block. Validation is permissive when the block is disabled; only fields that affect runtime behaviour when enabled are strictly checked.

type TelemetryExporter

type TelemetryExporter struct {
	// Protocol selects the OTLP transport. One of "grpc" or "http/protobuf".
	Protocol *TelemetryExporterProtocol `json:"protocol,omitempty" yaml:"protocol,omitempty"`

	// Endpoint is the OTLP endpoint URL. Honors env-var fallthrough; falls
	// back to OTEL_EXPORTER_OTLP_ENDPOINT when unset.
	Endpoint *StringValue `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`

	// Headers are additional headers sent with every OTLP request (e.g.
	// auth tokens). Each value supports env-var fallthrough.
	Headers map[string]*StringValue `json:"headers,omitempty" yaml:"headers,omitempty"`

	// Insecure disables TLS on the OTLP connection. Defaults to false.
	Insecure *bool `json:"insecure,omitempty" yaml:"insecure,omitempty"`
}

TelemetryExporter configures the OTLP exporter destination shared by all signals. The Collector is expected to fan out to backends.

func (*TelemetryExporter) GetInsecure

func (e *TelemetryExporter) GetInsecure() bool

GetInsecure returns the configured insecure flag, defaulting to false.

func (*TelemetryExporter) GetProtocol

GetProtocol returns the OTLP protocol, defaulting to grpc.

func (*TelemetryExporter) Validate

Validate checks the exporter block.

type TelemetryExporterProtocol

type TelemetryExporterProtocol string

TelemetryExporterProtocol identifies the OTLP transport used by the exporter.

const (
	TelemetryExporterProtocolGRPC         TelemetryExporterProtocol = "grpc"
	TelemetryExporterProtocolHTTPProtobuf TelemetryExporterProtocol = "http/protobuf"
)

type TelemetryHTTP

type TelemetryHTTP struct {
	// ExcludedPaths is the list of HTTP request paths to exclude from
	// spans and metrics. Defaults to /ping and /healthz when nil. An empty
	// slice (explicitly configured) disables exclusion entirely.
	ExcludedPaths []string `json:"excluded_paths,omitempty" yaml:"excluded_paths,omitempty"`
}

TelemetryHTTP configures inbound HTTP instrumentation behaviour.

type TelemetryPropagation

type TelemetryPropagation struct {
	// InjectOutboundDefault is the global default for injecting W3C
	// traceparent/tracestate on outbound proxy requests. Defaults to false
	// (opt-in). Per-connector settings override this default.
	InjectOutboundDefault *bool `json:"inject_outbound_default,omitempty" yaml:"inject_outbound_default,omitempty"`
}

TelemetryPropagation configures outbound trace context injection.

type TelemetryProxy

type TelemetryProxy struct {
	// SpanAttributeLabels are label keys whose values are projected as
	// attributes on the proxy span. Cheap; can tolerate higher cardinality.
	SpanAttributeLabels []string `json:"span_attribute_labels,omitempty" yaml:"span_attribute_labels,omitempty"`

	// MetricDimensionLabels are label keys whose values become metric
	// dimensions on proxy metrics. Strictly bounded to control cardinality.
	MetricDimensionLabels []string `json:"metric_dimension_labels,omitempty" yaml:"metric_dimension_labels,omitempty"`

	// MetricDimensionValueCap, when > 0, caps the number of distinct values
	// per metric dimension key. Values beyond the cap collapse to "other"
	// to bound cardinality. Off by default.
	MetricDimensionValueCap *int `json:"metric_dimension_value_cap,omitempty" yaml:"metric_dimension_value_cap,omitempty"`
}

TelemetryProxy configures label projection for outbound proxy telemetry.

The two allowlists are independent. Telemetry reads from the request's already-computed effective label set (httpf.RequestInfo.Labels) and filters by allowlist; it does no merging.

type TelemetryResource

type TelemetryResource struct {
	// ServiceNamePrefix is prepended (with a hyphen) to the service id to
	// produce the OTel service.name. Defaults to "authproxy" so services
	// appear as "authproxy-api", "authproxy-admin-api", etc.
	ServiceNamePrefix *string `json:"service_name_prefix,omitempty" yaml:"service_name_prefix,omitempty"`

	// Attributes are user-supplied resource attributes merged into the
	// resource. OTEL_RESOURCE_ATTRIBUTES env var entries are merged in
	// addition to these (SDK behaviour).
	Attributes map[string]string `json:"attributes,omitempty" yaml:"attributes,omitempty"`
}

TelemetryResource configures static resource attributes attached to every emitted signal.

func (*TelemetryResource) GetServiceNamePrefix

func (r *TelemetryResource) GetServiceNamePrefix() string

GetServiceNamePrefix returns the configured prefix, falling back to DefaultTelemetryServiceNamePrefix.

type TelemetrySampling

type TelemetrySampling struct {
	// Ratio is the parent-based head-sampling ratio in [0, 1]. Sampling
	// decisions made by upstream callers are honored; this ratio applies
	// when there is no parent context.
	Ratio *float64 `json:"ratio,omitempty" yaml:"ratio,omitempty"`
}

TelemetrySampling configures the sampler used for traces.

type TelemetrySignals

type TelemetrySignals struct {
	Traces  *bool `json:"traces,omitempty" yaml:"traces,omitempty"`
	Metrics *bool `json:"metrics,omitempty" yaml:"metrics,omitempty"`
	Logs    *bool `json:"logs,omitempty" yaml:"logs,omitempty"`
}

TelemetrySignals enables or disables individual OTel signals.

type TlsConfig

type TlsConfig interface {
	TlsConfig(ctx context.Context, s HttpServiceLike) (*tls.Config, error)
}

func UnmarshallYamlTlsConfig

func UnmarshallYamlTlsConfig(data []byte) (TlsConfig, error)

func UnmarshallYamlTlsConfigString

func UnmarshallYamlTlsConfigString(data string) (TlsConfig, error)

type TlsConfigLetsEncrypt

type TlsConfigLetsEncrypt struct {
	AcceptTos     bool           `json:"accept_tos" yaml:"accept_tos"`
	Email         string         `json:"email" yaml:"email"`
	HostWhitelist []string       `json:"host_whitelist" yaml:"host_whitelist"`
	RenewBefore   *HumanDuration `json:"renew_before,omitempty" yaml:"renew_before,omitempty"`
	CacheDir      string         `json:"cache_dir" yaml:"cache_dir"`
}

func (*TlsConfigLetsEncrypt) TlsConfig

func (tle *TlsConfigLetsEncrypt) TlsConfig(ctx context.Context, s HttpServiceLike) (*tls.Config, error)

type TlsConfigSelfSignedAutogen

type TlsConfigSelfSignedAutogen struct {
	AutoGenPath string `json:"auto_gen_path" yaml:"auto_gen_path"`
}

func (*TlsConfigSelfSignedAutogen) TlsConfig

type TlsConfigVals

type TlsConfigVals struct {
	Cert *KeyData `json:"cert" yaml:"cert"`
	Key  *KeyData `json:"key" yaml:"key"`
}

func (*TlsConfigVals) TlsConfig

func (tcv *TlsConfigVals) TlsConfig(ctx context.Context, s HttpServiceLike) (*tls.Config, error)

type TokenEndpointAuthMethod

type TokenEndpointAuthMethod = connectors.TokenEndpointAuthMethod

Re-export types from the connectors sub-package

Jump to

Keyboard shortcuts

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