config

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultAccessTokenTTL  = time.Minute * 15
	DefaultRefreshTokenTTL = time.Hour * 24
	DefaultProviderTimeout = time.Minute * 1
)
View Source
const (
	DefaultKubernetesAuthorizationAllowTTL = time.Minute * 5
	DefaultKubernetesAuthorizationDenyTTL  = time.Second * 30
	DefaultKubernetesAuthenticationTTL     = time.Minute * 2
)
View Source
const (
	// SchemeHTTP and SchemeHTTPS are the URL schemes supported by the proxy of the datasources of kind HTTPProxy.
	SchemeHTTP  = "http"
	SchemeHTTPS = "https"

	DefaultHTTPProxyMaxIdleConns        = 100
	DefaultHTTPProxyMaxIdleConnsPerHost = 10
	// DefaultHTTPProxyTimeout is the default maximum amount of time allowed to establish a connection to a datasource.
	DefaultHTTPProxyTimeout = common.Duration(30 * time.Second)
)
View Source
const (
	DefaultPanelsPath      = "schemas/panels"
	DefaultQueriesPath     = "schemas/queries"
	DefaultDatasourcesPath = "schemas/datasources"
	DefaultVariablesPath   = "schemas/variables"
)
View Source
const (
	SameSiteLaxMode    string = "lax"
	SameSiteStrictMode string = "strict"
	SameSiteNoneMode   string = "none"
)

Variables

View Source
var (
	DefaultPluginPath                   = "plugins"
	DefaultPluginPathInContainer        = "/etc/perses/plugins"
	DefaultArchivePluginPath            = "plugins-archive"
	DefaultArchivePluginPathInContainer = "/etc/perses/plugins-archive"
)

These constants are actually defined as variables to allow overriding them at build time using the -ldflags option. It is useful for the Linux distribution that has different conventions for the location of the data files. See https://github.com/perses/perses/issues/2947 for more context.

Functions

func NormalizeHostPattern added in v0.55.0

func NormalizeHostPattern(pattern string) (string, error)

NormalizeHostPattern validates and normalizes an entry of DatasourceProxyConfig.AllowedHosts.

func ParseNetwork added in v0.55.0

func ParseNetwork(network string) (netip.Prefix, error)

ParseNetwork parses an IP address or a CIDR and returns the corresponding (masked) prefix. IPv4-mapped IPv6 networks are converted to their IPv4 equivalent.

Types

type AuthenticationConfig

type AuthenticationConfig struct {
	// AccessTokenTTL is the time to live of the access token. By default, it is 15 minutes.
	AccessTokenTTL common.Duration `json:"access_token_ttl,omitempty" yaml:"access_token_ttl,omitempty"`
	// RefreshTokenTTL is the time to live of the refresh token.
	// The refresh token is used to get a new access token when it is expired.
	// By default, it is 24 hours.
	RefreshTokenTTL common.Duration `json:"refresh_token_ttl,omitempty" yaml:"refresh_token_ttl,omitempty"`
	// DisableSignUp deactivates the Sign-up page in the UI.
	// It also disables the endpoint that gives the possibility to create a user.
	DisableSignUp bool `json:"disable_sign_up" yaml:"disable_sign_up"`
	// Providers configure the different authentication providers
	Providers AuthenticationProviders `json:"providers" yaml:"providers"`
}

func (*AuthenticationConfig) Verify

func (a *AuthenticationConfig) Verify() error

type AuthenticationProviders added in v0.53.0

type AuthenticationProviders struct {
	EnableNative bool `json:"enable_native" yaml:"enable_native"`
	// +optional
	KubernetesProvider K8sAuthnProvider `json:"kubernetes,omitzero" yaml:"kubernetes,omitempty"`
	OAuth              []OAuthProvider  `json:"oauth,omitempty" yaml:"oauth,omitempty"`
	OIDC               []OIDCProvider   `json:"oidc,omitempty" yaml:"oidc,omitempty"`
}

func (*AuthenticationProviders) Verify added in v0.53.0

func (p *AuthenticationProviders) Verify() error

type AuthorizationConfig

type AuthorizationConfig struct {
	// DEPRECATED: use NativeAuthorizationProvider.CheckLatestUpdateInterval instead.
	CheckLatestUpdateInterval common.Duration `json:"check_latest_update_interval,omitempty" yaml:"check_latest_update_interval,omitempty"`
	// DEPRECATED: use NativeAuthorizationProvider.GuestPermissions instead.
	GuestPermissions []*role.Permission `json:"guest_permissions,omitempty" yaml:"guest_permissions,omitempty"`
	// +optional
	Provider AuthorizationProvider `json:"provider,omitzero" yaml:"provider,omitempty"`
}

func (*AuthorizationConfig) Verify

func (a *AuthorizationConfig) Verify() error

type AuthorizationProvider added in v0.53.0

type AuthorizationProvider struct {
	// +optional
	Kubernetes KubernetesAuthorizationProvider `json:"kubernetes,omitzero" yaml:"kubernetes,omitempty"`
	// +optional
	Native NativeAuthorizationProvider `json:"native,omitzero" yaml:"native,omitempty"`
}

type AutoRefresh added in v0.55.0

type AutoRefresh struct {
	Disable bool                    `json:"disable,omitempty" yaml:"disable,omitempty"`
	Options []common.DurationString `json:"options,omitempty" yaml:"options,omitempty"`
}

func (*AutoRefresh) Verify added in v0.55.0

func (p *AutoRefresh) Verify() error
type Banner struct {
	Severity string `json:"severity" yaml:"severity"`
	Message  string `json:"message" yaml:"message"`
}

func (*Banner) Verify added in v0.53.0

func (b *Banner) Verify() error

type CORSConfig added in v0.51.0

type CORSConfig struct {
	Enable           bool     `json:"enable" yaml:"enable"`
	AllowOrigins     []string `json:"allow_origins,omitempty" yaml:"allow_origins,omitempty"`
	AllowMethods     []string `json:"allow_methods,omitempty" yaml:"allow_methods,omitempty"`
	AllowHeaders     []string `json:"allow_headers,omitempty" yaml:"allow_headers,omitempty"`
	AllowCredentials bool     `json:"allow_credentials,omitempty" yaml:"allow_credentials,omitempty"`
	ExposeHeaders    []string `json:"expose_headers,omitempty" yaml:"expose_headers,omitempty"`
	MaxAge           int      `json:"max_age,omitempty" yaml:"max_age,omitempty"`
}

type ClaimMapping added in v0.55.0

type ClaimMapping struct {
	ClaimValue string `json:"claim_value" yaml:"claim_value"`
	RoleName   string `json:"role_name" yaml:"role_name"`
	// Project is optional. When set, maps the claim value to a project-scoped Role.
	// When empty, maps to a GlobalRole.
	// +optional
	Project string `json:"project,omitempty" yaml:"project,omitempty"`
}

ClaimMapping maps a single upstream token claim value to a Perses role. When Project is empty, RoleName is resolved as a GlobalRole (global permissions). When Project is non-empty, RoleName is resolved as a project-scoped Role within that project.

func (*ClaimMapping) Verify added in v0.55.0

func (c *ClaimMapping) Verify() error

type Config

type Config struct {
	// Use it in case you want to prefix the API path.
	// This can be useful if you are running Perses behind a reverse proxy.
	// By default, the API is served with the path /api.
	// With this config, it will be served with the path <api_prefix>/api
	// Example: "/perses"
	APIPrefix string `json:"api_prefix,omitempty" yaml:"api_prefix,omitempty"`
	// Security contains any configuration that changes the API behavior like the endpoints exposed or if the permissions are activated.
	Security Security `json:"security,omitempty" yaml:"security,omitempty"`
	// Database contains the different configuration depending on the database you want to use
	Database Database `json:"database,omitempty" yaml:"database,omitempty"`
	// Schemas contain the configuration to get access to the CUE schemas
	// DEPRECATED.
	// Please remove it from your config.
	Schemas *Schemas `json:"schemas,omitempty" yaml:"schemas,omitempty"`
	// Dashboard contains the configuration for the dashboard feature.
	Dashboard DashboardConfig `json:"dashboard,omitempty" yaml:"dashboard,omitempty"`
	// Provisioning contains the provisioning config that can be used if you want to provide default resources.
	Provisioning ProvisioningConfig `json:"provisioning,omitempty" yaml:"provisioning,omitempty"`
	// Datasource contains the configuration for the datasource.
	Datasource DatasourceConfig `json:"datasource,omitempty" yaml:"datasource,omitempty"`
	// Variable contains the configuration for the variable.
	Variable VariableConfig `json:"variable,omitempty" yaml:"variable,omitempty"`
	// EphemeralDashboardsCleanupInterval is the interval at which the ephemeral dashboards are cleaned up
	// DEPRECATED.
	// Please use the config EphemeralDashboard instead.
	EphemeralDashboardsCleanupInterval common.Duration `json:"ephemeral_dashboards_cleanup_interval,omitempty" yaml:"ephemeral_dashboards_cleanup_interval,omitempty"`
	// EphemeralDashboard contains the config about the ephemeral dashboard feature
	EphemeralDashboard EphemeralDashboard `json:"ephemeral_dashboard,omitempty" yaml:"ephemeral_dashboard,omitempty"`
	// Frontend contains any config that will be used by the frontend itself.
	Frontend Frontend `json:"frontend,omitempty" yaml:"frontend,omitempty"`
	// Plugin contains the config for runtime plugins.
	Plugin Plugin `json:"plugin,omitempty" yaml:"plugin,omitempty"`
	// Search contains the config for the search engine and the index in memory.
	Search Search `json:"search,omitempty" yaml:"search,omitempty"`
}

func Resolve

func Resolve(configFile string) (Config, error)

func (*Config) Verify

func (c *Config) Verify() error
type Cookie struct {
	// Set the SameSite cookie attribute and prevents the browser from sending the cookie along with cross-site requests.
	// The main goal is to mitigate the risk of cross-origin information leakage.
	// This setting also provides some protection against cross-site request forgery attacks (CSRF)
	SameSite SameSite `json:"same_site,omitempty" yaml:"same_site,omitempty"`
	// Set to true if you host Perses behind HTTPS. Default is false
	Secure bool `json:"secure" yaml:"secure"`
}

type CustomLintRule added in v0.51.0

type CustomLintRule struct {
	// Name of the rule
	Name string `json:"name" yaml:"name"`
	// Target is a JSONPath expression to extract the relevant portion of the dashboard data.
	// Refer to https://goessner.net/articles/JsonPath/ for the syntax.
	Target string `json:"target" yaml:"target"`

	// Assertion is a CEL expression that validates the extracted value.
	// Refer to https://github.com/google/cel-spec/blob/master/doc/langdef.md for the syntax.
	Assertion string `json:"assertion" yaml:"assertion"`

	// Message is displayed if the assertion fails.
	Message string `json:"message" yaml:"message"`
	// Disable is a flag to disable the rule.
	Disable bool `json:"disable" yaml:"disable"`
	// contains filtered or unexported fields
}

func (*CustomLintRule) Evaluate added in v0.51.0

func (c *CustomLintRule) Evaluate(data map[string]any) error

func (*CustomLintRule) Verify added in v0.51.0

func (c *CustomLintRule) Verify() error

type DashboardConfig added in v0.51.0

type DashboardConfig struct {
	CustomLintRules []*CustomLintRule `json:"custom_lint_rules,omitempty" yaml:"custom_lint_rules,omitempty"`
}

func (*DashboardConfig) Verify added in v0.51.0

func (c *DashboardConfig) Verify() error

type DashboardSelector added in v0.55.0

type DashboardSelector struct {
	// Project is the name of the project (dashboard.metadata.project)
	Project string `json:"project" yaml:"project"`
	// Dashboard is the name of the dashboard (dashboard.metadata.name).
	// When omitted, all dashboards from the project are considered important.
	Dashboard string `json:"dashboard,omitempty" yaml:"dashboard,omitempty"`
}

type Database

type Database struct {
	File *File `json:"file,omitempty" yaml:"file,omitempty"`
	SQL  *SQL  `json:"sql,omitempty" yaml:"sql,omitempty"`
}

func (*Database) Verify

func (d *Database) Verify() error

type DatasourceConfig added in v0.51.0

type DatasourceConfig struct {
	Global  GlobalDatasourceConfig  `json:"global" yaml:"global"`
	Project ProjectDatasourceConfig `json:"project" yaml:"project"`
	// DisableLocal when used is preventing the possibility to add a datasource directly in the dashboard spec.
	// It will also disable the associated proxy.
	DisableLocal bool `json:"disable_local" yaml:"disable_local"`
	// Proxy contains the configuration of the datasource proxy: the destinations it is allowed to reach (whatever the kind of proxy),
	// and the configuration specific to each kind of proxy.
	Proxy DatasourceProxyConfig `json:"proxy" yaml:"proxy"`
}

type DatasourceProxyConfig added in v0.55.0

type DatasourceProxyConfig struct {
	// AllowedHosts, when not empty, is the exhaustive list of hosts the proxy can reach.
	// An entry is either an exact hostname (e.g. "prometheus.example.com"), a wildcard matching any subdomain
	// (e.g. "*.example.com") or an IP address. The port must not be provided.
	AllowedHosts []string `json:"allowed_hosts,omitempty" yaml:"allowed_hosts,omitempty"`
	// AllowedNetworks is a list of IP addresses or CIDRs that are allowed.
	// When an IP address is part of both an allowed and a denied network (the built-in ones, DeniedNetworks and
	// DenyPrivateNetworks), the most specific network wins (on equal prefix lengths, the allowed network wins).
	// For example, allowing 10.0.0.0/8 doesn't allow the Kubernetes API service IP, and allowing 169.254.0.0/16 doesn't
	// allow 169.254.169.254 (both denied as single IP addresses), while allowing these IP addresses explicitly does.
	// Use ["127.0.0.0/8", "::1/128"] if your datasources are running on the same host as Perses.
	AllowedNetworks []string `json:"allowed_networks,omitempty" yaml:"allowed_networks,omitempty"`
	// DeniedNetworks is a list of IP addresses or CIDRs that are denied, in addition to the built-in ones.
	DeniedNetworks []string `json:"denied_networks,omitempty" yaml:"denied_networks,omitempty"`
	// DenyPrivateNetworks when true denies the private networks as well:
	// 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, fc00::/7 and fec0::/10.
	DenyPrivateNetworks bool `json:"deny_private_networks" yaml:"deny_private_networks"`
	// HTTP contains the configuration specific to the proxy of the datasources of kind HTTPProxy.
	// +optional
	HTTP HTTPProxyConfig `json:"http,omitzero" yaml:"http,omitempty"`
}

DatasourceProxyConfig contains the configuration of the datasource proxy.

The root fields restrict the destinations the proxy is allowed to reach, and apply to every kind of proxy (HTTP and SQL). Without restriction, anyone allowed to create a datasource (or to use the unsaved proxy endpoints) could use Perses to reach any service accessible from the Perses server (Server-Side Request Forgery): the Perses API itself through the loopback interface, the cloud metadata endpoints, the Kubernetes API, etc.

Regardless of this configuration, the following networks are always denied, unless an allowed network at least as specific covers the IP address (see AllowedNetworks): loopback (127.0.0.0/8, ::1), "this" network (0.0.0.0/8), link-local (169.254.0.0/16, fe80::/10), the known cloud metadata endpoints (169.254.169.254, 169.254.170.2, 169.254.170.23, 100.100.100.200, 168.63.129.16, 192.0.0.192, fd00:ec2::254, fd00:ec2::23), multicast, reserved and deprecated ranges, and the Kubernetes API service IP when Perses is running in a Kubernetes cluster.

The configuration specific to a kind of proxy lives in a dedicated struct (e.g. HTTP).

func (*DatasourceProxyConfig) Verify added in v0.55.0

func (c *DatasourceProxyConfig) Verify() error

Verify validates the configuration and normalizes its values, so they can be used as is afterward: the hosts are normalized (see NormalizeHostPattern) and the networks are converted to their canonical CIDR form (see ParseNetwork).

type DefaultUserPreferences added in v0.55.0

type DefaultUserPreferences struct {
	Timezone    string        `json:"timezone,omitempty" yaml:"timezone,omitempty"`
	RowsPerPage uint8         `json:"rows_per_page,omitempty" yaml:"rows_per_page,omitempty"`
	Theme       FrontendTheme `json:"theme,omitempty" yaml:"theme,omitempty"`
}

DefaultUserPreferences contains the preferences used when the user has not stored an explicit preference in their browser.

func (*DefaultUserPreferences) Verify added in v0.55.0

func (p *DefaultUserPreferences) Verify() error

type DiscoveryDefault added in v0.55.0

type DiscoveryDefault struct {
	Enable      bool              `json:"enable,omitempty" yaml:"enable,omitempty"`
	Labels      map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}

type EphemeralDashboard added in v0.47.0

type EphemeralDashboard struct {
	// When true user will be able to use the ephemeral dashboard at project level.
	Enable bool `json:"enable" yaml:"enable"`
	// The interval at which to trigger the cleanup of ephemeral dashboards, based on their TTLs.
	CleanupInterval common.Duration `json:"cleanup_interval" yaml:"cleanup_interval"`
}

func (*EphemeralDashboard) Verify added in v0.47.0

func (e *EphemeralDashboard) Verify() error

type Explorer added in v0.47.0

type Explorer struct {
	Enable bool `json:"enable" yaml:"enable"`
}

type File

type File struct {
	Folder string `json:"folder" yaml:"folder"`
	// +kubebuilder:validation:Optional
	Extension FileExtension `json:"extension" yaml:"extension"`
	// +kubebuilder:validation:Optional
	CaseSensitive bool `json:"case_sensitive" yaml:"case_sensitive"`
}

func (*File) Verify

func (f *File) Verify() error

type FileExtension

type FileExtension string
const (
	YAMLExtension FileExtension = "yaml"
	JSONExtension FileExtension = "json"
)

type Frontend added in v0.46.0

type Frontend struct {
	// When it is true, Perses won't serve the frontend anymore, and any other config set here will be ignored
	Disable bool `json:"disable" yaml:"disable"`
	// EnableKeyboardShortcuts enables keyboard shortcuts in the UI. Defaults to true when omitted.
	EnableKeyboardShortcuts *bool `json:"enable_keyboard_shortcuts,omitempty" yaml:"enable_keyboard_shortcuts,omitempty"`
	// EnablePluginVersioning enables the dashboard "lock" button that pins every plugin to its latest available
	// version. Defaults to false (feature hidden) when omitted.
	EnableLockMode bool `json:"enable_lock_mode,omitempty" yaml:"enable_lock_mode,omitempty"`
	// Explorer is activating the different kind of explorer supported.
	// Be sure you have installed an associated plugin for each explorer type.
	Explorer Explorer `json:"explorer" yaml:"explorer"`
	// Information contains Markdown content to be display on the home page
	Information string `json:"information,omitempty" yaml:"information,omitempty"`
	// ImportantDashboards contains grouped important dashboard selectors.
	// Each selector can target one dashboard or an entire project when dashboard is omitted.
	ImportantDashboards ImportantDashboards `json:"important_dashboards,omitempty" yaml:"important_dashboards,omitempty"`
	// TimeRange contains the time range configuration for the dropdown
	TimeRange *TimeRange `json:"time_range,omitempty" yaml:"time_range,omitempty"`
	// AutoRefresh contains the auto-refresh configuration for dashboards
	AutoRefresh AutoRefresh `json:"auto_refresh,omitempty" yaml:"auto_refresh,omitempty"`
	// BannerInfo contains the content to be display in a banner at the top of each page along with the severity of the information
	Banner *Banner `json:"banner,omitempty" yaml:"banner,omitempty"`
	// DefaultUserPreferences contains server-wide defaults for user preferences.
	DefaultUserPreferences *DefaultUserPreferences `json:"default_user_preferences,omitempty" yaml:"default_user_preferences,omitempty"`
}

type FrontendTheme added in v0.55.0

type FrontendTheme string
const (
	DarkTheme  FrontendTheme = "dark"
	LightTheme FrontendTheme = "light"
)

type GlobalDatasourceConfig added in v0.51.0

type GlobalDatasourceConfig struct {
	// Disable is used to disable the global datasource feature.
	// It will also remove the associated proxy.
	// Also, since the global variable depends on the global datasource, it will also disable the global variable feature.
	Disable bool `json:"disable" yaml:"disable"`
	// Discovery is the configuration that helps to generate a list of global datasource based on the discovery chosen.
	// Be careful: the data coming from the discovery will totally override what exists in the database.
	// Note that this is an experimental feature. Behavior and config may change in the future.
	Discovery []GlobalDatasourceDiscovery `json:"discovery,omitempty" yaml:"discovery,omitempty"`
}

func (*GlobalDatasourceConfig) Verify added in v0.51.0

func (c *GlobalDatasourceConfig) Verify() error

type GlobalDatasourceDiscovery added in v0.47.0

type GlobalDatasourceDiscovery struct {
	// The name of the discovery config. It is used for logging purposes only
	Name string `json:"name" yaml:"name"`
	// Refresh interval to re-query the endpoint.
	RefreshInterval common.Duration `json:"refresh_interval,omitempty" yaml:"refresh_interval,omitempty"`
	// HTTP-based service discovery provides a more generic way to generate a set of global datasource and serves as an interface to plug in custom service discovery mechanisms.
	// It fetches an HTTP endpoint containing a list of zero or more global datasources.
	// The target must reply with an HTTP 200 response.
	// The HTTP header Content-Type must be application/json, and the body must be valid array of JSON.
	HTTPDiscovery *HTTPDiscovery `json:"http_sd,omitempty" yaml:"http_sd,omitempty"`
	// Kubernetes SD configurations allow retrieving global datasource from Kubernetes' REST API
	// and always staying synchronized with the cluster state.
	KubernetesDiscovery *KubernetesDiscovery `json:"kubernetes_sd,omitempty" yaml:"kubernetes_sd,omitempty"`
}

func (*GlobalDatasourceDiscovery) Verify added in v0.47.0

func (g *GlobalDatasourceDiscovery) Verify() error

type GlobalVariableConfig added in v0.51.0

type GlobalVariableConfig struct {
	// Disable is used to disable the global variable feature.
	// Note that if the global datasource is disabled, the global variable will also be disabled.
	Disable bool `json:"disable" yaml:"disable"`
}

type HTTP added in v0.48.0

type HTTP struct {
	Timeout   common.Duration   `json:"timeout" yaml:"timeout"`
	TLSConfig *secret.TLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
}

func (HTTP) MarshalJSON added in v0.53.0

func (h HTTP) MarshalJSON() ([]byte, error)

func (HTTP) MarshalYAML added in v0.53.0

func (h HTTP) MarshalYAML() (any, error)

func (*HTTP) Verify added in v0.48.0

func (h *HTTP) Verify() error

type HTTPDiscovery added in v0.47.0

type HTTPDiscovery struct {
	config.RestConfigClient `json:",inline" yaml:",inline"`
}

func (HTTPDiscovery) MarshalJSON added in v0.51.0

func (d HTTPDiscovery) MarshalJSON() ([]byte, error)

func (HTTPDiscovery) MarshalYAML added in v0.51.0

func (d HTTPDiscovery) MarshalYAML() (any, error)

type HTTPProxyConfig added in v0.55.0

type HTTPProxyConfig struct {
	// AllowedSchemes is the list of URL schemes an HTTP datasource is allowed to use.
	// Accepted values are "http" and "https". Default: ["http", "https"].
	AllowedSchemes []string `json:"allowed_schemes,omitempty" yaml:"allowed_schemes,omitempty"`
	// MaxConnsPerHost limits the total number of connections (in use and idle) that Perses opens,
	// for a given datasource, to a given host.
	// Once the limit is reached, the new requests wait until a connection is available,
	// or until they are canceled.
	// It can be used to protect Perses (file descriptors) and the datasources from a burst of queries.
	// Zero means no limit.
	MaxConnsPerHost int `json:"max_conns_per_host,omitempty" yaml:"max_conns_per_host,omitempty"`
	// MaxIdleConns limits the number of idle connections kept open, for a given datasource, across all hosts.
	// Idle connections are reused by the next requests, saving the TCP and TLS handshakes,
	// but each of them holds a socket and some memory.
	// Default: 100
	MaxIdleConns int `json:"max_idle_conns,omitempty" yaml:"max_idle_conns,omitempty"`
	// MaxIdleConnsPerHost limits the number of idle connections kept open, for a given datasource, to a given host.
	// A datasource usually talks to a single host, so it is in practice the number of idle connections kept per datasource.
	// Default: 10
	MaxIdleConnsPerHost int `json:"max_idle_conns_per_host,omitempty" yaml:"max_idle_conns_per_host,omitempty"`
	// DefaultTimeout is the maximum amount of time allowed to establish a connection to a datasource,
	// when the datasource doesn't define its own timeout (or sets it to 0).
	// Default: 30s, or MaxTimeout if it is lower
	DefaultTimeout common.Duration `json:"default_timeout,omitempty" yaml:"default_timeout,omitempty"`
	// MaxTimeout is the highest timeout a datasource can define. A datasource can only lower the timeout, never go beyond it.
	// A long timeout keeps goroutines and sockets busy against unreachable hosts,
	// so letting the users increase it freely would expose Perses to resource exhaustion.
	// Default: the value of DefaultTimeout
	MaxTimeout common.Duration `json:"max_timeout,omitempty" yaml:"max_timeout,omitempty"`
}

HTTPProxyConfig contains the configuration specific to the proxy used to forward the requests to the datasources of kind HTTPProxy. Each datasource has its own pool of connections, so every limit below applies per datasource.

func (*HTTPProxyConfig) EffectiveTimeout added in v0.55.0

func (c *HTTPProxyConfig) EffectiveTimeout(timeout common.DurationString) time.Duration

EffectiveTimeout returns the maximum amount of time allowed to establish a connection to a datasource defining the given timeout in its spec: min(timeout, MaxTimeout), or DefaultTimeout when the timeout is not set (or 0).

The timeout is clamped at runtime, even though it is already validated when the datasource is saved (see ValidateTimeout), because MaxTimeout can have been lowered since the datasource has been saved.

func (*HTTPProxyConfig) ValidateTimeout added in v0.55.0

func (c *HTTPProxyConfig) ValidateTimeout(timeout common.DurationString) error

ValidateTimeout verifies that the timeout defined in the spec of a datasource is allowed by the server configuration. It is meant to be used when the datasource is saved. An empty or zero timeout is valid: it means the datasource uses DefaultTimeout. A negative timeout is rejected as an invalid duration, since ParseDuration doesn't accept any sign.

func (*HTTPProxyConfig) Verify added in v0.55.0

func (c *HTTPProxyConfig) Verify() error

type ImportantDashboardGroup added in v0.55.0

type ImportantDashboardGroup struct {
	Title       string              `json:"title,omitempty" yaml:"title,omitempty"`
	Description string              `json:"description,omitempty" yaml:"description,omitempty"`
	Dashboards  []DashboardSelector `json:"dashboards,omitempty" yaml:"dashboards,omitempty"`
}

type ImportantDashboards added in v0.55.0

type ImportantDashboards []ImportantDashboardGroup

ImportantDashboards also accepts the deprecated flat list of DashboardSelector, converted into a single untitled group.

func (*ImportantDashboards) UnmarshalJSON added in v0.55.0

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

func (*ImportantDashboards) UnmarshalYAML added in v0.55.0

func (d *ImportantDashboards) UnmarshalYAML(unmarshal func(any) error) error

func (*ImportantDashboards) Verify added in v0.55.0

func (d *ImportantDashboards) Verify() error

type IndexKeys added in v0.55.0

type IndexKeys struct {
	Dashboard []string `json:"dashboard,omitempty" yaml:"dashboard,omitempty"`
}

type K8sAuthnProvider added in v0.53.0

type K8sAuthnProvider struct {
	Enable bool `json:"enable" yaml:"enable"`
}

type KubePodDiscovery added in v0.47.0

type KubePodDiscovery struct {
	// If set to true, Perses server will discovery the pod
	Enable bool `json:"enable,omitempty" yaml:"enable,omitempty"`
	// Name of the container the target address points to.
	ContainerName string `json:"container_name,omitempty" yaml:"container_name,omitempty"`
	// Name of the container port.
	ContainerPortName string `json:"container_port_name,omitempty" yaml:"container_port_name,omitempty"`
	// Number of the container port.
	ContainerPortNumber int32 `json:"container_port_number,omitempty" yaml:"container_port_number,omitempty"`
}

type KubeServiceDiscovery added in v0.47.0

type KubeServiceDiscovery struct {
	// If set to true, Perses server will discovery the service
	Enable bool `json:"enable,omitempty" yaml:"enable,omitempty"`
	// Name of the service port for the target.
	PortName string `json:"port_name,omitempty" yaml:"port_name,omitempty"`
	// Number of the service port for the target.
	PortNumber int32 `json:"port_number,omitempty" yaml:"port_number,omitempty"`
	// The type of the service.
	ServiceType string `json:"service_type,omitempty" yaml:"service_type,omitempty"`
}

type KubernetesAuthorizationProvider added in v0.53.0

type KubernetesAuthorizationProvider struct {
	Enable bool `json:"enable,omitempty" yaml:"enable,omitempty"`
	// The active user in the kubeconfig should have "create" permissions for the `TokenReview` and
	// `SubjectAccessReview` resources. If the kubeconfig parameter isn't available the pods service
	// account token will be used
	Kubeconfig string `json:"kubeconfig,omitempty" yaml:"kubeconfig,omitempty"`
	// query per second (QPS) the k8s client will use with the apiserver. Default: 500 qps
	QPS int `json:"qps,omitempty" yaml:"qps,omitempty"`
	// burst QPS the k8s client will use with the apiserver. Default: 1000 qps
	Burst int `json:"burst,omitempty" yaml:"burst,omitempty"`
	// time an authorizer allow response will be cached for. Default: 5m
	AuthorizerAllowTTL common.Duration `json:"authorizer_allow_ttl,omitempty" yaml:"authorizer_allow_ttl,omitempty"`
	// time an authorizer denied will be cached for. Default: 30s
	AuthorizerDenyTTL common.Duration `json:"authorizer_deny_ttl,omitempty" yaml:"authorizer_deny_ttl,omitempty"`
	// time an authenticator response will be cached for. Default: 2m
	AuthenticatorTTL common.Duration `json:"authenticator_ttl,omitempty" yaml:"authenticator_ttl,omitempty"`
}

func (*KubernetesAuthorizationProvider) Verify added in v0.53.0

type KubernetesDiscovery added in v0.47.0

type KubernetesDiscovery struct {
	// DatasourcePluginKind is the name of the datasource plugin that should be filled when creating datasources found.
	DatasourcePluginKind string `json:"datasource_plugin_kind" yaml:"datasource_plugin_kind"`
	// Kubernetes namespace to constraint the query to only one namespace.
	// Leave empty if you are looking for datasource cross-namespace.
	Namespace string `json:"namespace" yaml:"namespace"`
	// Configuration when you want to discover the services in Kubernetes
	ServiceConfiguration KubeServiceDiscovery `json:"service_configuration,omitempty" yaml:"service_configuration,omitempty"`
	// Configuration when you want to discover the pods in Kubernetes
	PodConfiguration KubePodDiscovery `json:"pod_configuration,omitempty" yaml:"pod_configuration,omitempty"`
	// The labels used to filter the list of resource when contacting the Kubernetes API.
	Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	// Marks the discovered datasource as default
	Default DiscoveryDefault `json:"default,omitempty" yaml:"default,omitempty"`
}

func (*KubernetesDiscovery) Verify added in v0.47.0

func (d *KubernetesDiscovery) Verify() error

type LoginProperty added in v0.55.0

type LoginProperty string

LoginProperty is the name of a userinfo property that can be used as the OIDC "login" of the user.

const (
	LoginPropertyName              LoginProperty = "name"
	LoginPropertyGivenName         LoginProperty = "given_name"
	LoginPropertyFamilyName        LoginProperty = "family_name"
	LoginPropertyMiddleName        LoginProperty = "middle_name"
	LoginPropertyNickname          LoginProperty = "nickname"
	LoginPropertyPreferredUsername LoginProperty = "preferred_username"
	LoginPropertyEmail             LoginProperty = "email"
)

func (*LoginProperty) Verify added in v0.55.0

func (p *LoginProperty) Verify() error

type NativeAuthorizationProvider added in v0.53.0

type NativeAuthorizationProvider struct {
	Enable bool `json:"enable,omitempty" yaml:"enable,omitempty"`
	// CheckLatestUpdateInterval that checks if the RBAC cache needs to be refreshed with db content. Only for SQL database setup.
	CheckLatestUpdateInterval common.Duration `json:"check_latest_update_interval,omitempty" yaml:"check_latest_update_interval,omitempty"`
	// Default permissions for guest users (logged-in users)
	GuestPermissions []*role.Permission `json:"guest_permissions,omitempty" yaml:"guest_permissions,omitempty"`
}

func (*NativeAuthorizationProvider) Verify added in v0.53.0

func (n *NativeAuthorizationProvider) Verify() error

type OAuthOverride added in v0.44.0

type OAuthOverride struct {
	ClientID         secret.Hidden `json:"client_id" yaml:"client_id"`
	ClientSecret     secret.Hidden `json:"client_secret,omitempty" yaml:"client_secret,omitempty"`
	ClientSecretFile string        `json:"client_secret_file,omitempty" yaml:"client_secret_file,omitempty"`
	Scopes           []string      `json:"scopes" yaml:"scopes"`
}

func (*OAuthOverride) Verify added in v0.53.0

func (o *OAuthOverride) Verify() error

type OAuthProvider

type OAuthProvider struct {
	Provider            `json:",inline" yaml:",inline"`
	AuthURL             common.URL `json:"auth_url" yaml:"auth_url"`
	TokenURL            common.URL `json:"token_url" yaml:"token_url"`
	UserInfosURL        common.URL `json:"user_infos_url" yaml:"user_infos_url"`
	DeviceAuthURL       common.URL `json:"device_auth_url" yaml:"device_auth_url"`
	CustomLoginProperty string     `json:"custom_login_property,omitempty" yaml:"custom_login_property,omitempty"`
}

func (*OAuthProvider) Verify

func (p *OAuthProvider) Verify() error

type OIDCLogout added in v0.53.0

type OIDCLogout struct {
	Enabled                 bool   `json:"enabled" yaml:"enabled"`
	LogoutRedirectParamName string `json:"logout_redirect_param_name,omitempty" yaml:"logout_redirect_param_name,omitempty"`
}

type OIDCProvider

type OIDCProvider struct {
	Provider     `json:",inline" yaml:",inline"`
	Issuer       common.URL        `json:"issuer" yaml:"issuer"`
	DiscoveryURL common.URL        `json:"discovery_url,omitempty" yaml:"discovery_url,omitempty"`
	URLParams    map[string]string `json:"url_params,omitempty" yaml:"url_params,omitempty"`
	DisablePKCE  bool              `json:"disable_pkce" yaml:"disable_pkce"`
	Logout       OIDCLogout        `json:"logout" yaml:"logout"`
	// CustomLoginProperty is the name of the userinfo property to use as the "login" of the user
	// (e.g. "preferred_username"). It must be one of the properties Perses already extracts from
	// the userinfo response. If not set or not found in the response, it falls back to the email,
	// then to the subject.
	CustomLoginProperty LoginProperty `json:"custom_login_property,omitempty" yaml:"custom_login_property,omitempty"`
}

func (*OIDCProvider) Verify

func (p *OIDCProvider) Verify() error

type Plugin added in v0.51.0

type Plugin struct {
	// Path is the path to the directory containing the runtime plugins
	Path string `json:"path,omitempty" yaml:"path,omitempty"`
	// ArchivePath is the path to the directory containing the archived plugins
	// When Perses is starting, it will extract the content of the archive in the folder specified in the `folder` attribute.
	// DEPRECATED: This attribute is deprecated and will be removed in a future version. It is still supported for backward compatibility, but it is recommended to use the `archive_paths` attribute instead.
	ArchivePath string `json:"archive_path,omitempty" yaml:"archive_path,omitempty"`
	// ArchivePaths is the list of paths to the directories containing the archived plugins. It allows to specify multiple directories for the archived plugins.
	// When Perses is starting, it will extract any archive found in the folders specified in this attribute in the folder specified in the `path` attribute.
	ArchivePaths []string `json:"archive_paths,omitempty" yaml:"archive_paths,omitempty"`
	// DevEnvironment is the configuration to use when developing a plugin
	EnableDev bool `json:"enable_dev" yaml:"enable_dev"`
	// Enabled is a list of plugin activated. Leave empty if you want to activate all plugins found in the `path` directory.
	// If not empty, only the plugins whose name is in this list will be activated.
	// The name can be the name of the plugin or the name of the module. For example, you can put `Prometheus` to enable the Prometheus module that contains query, variables and datasource plugin.
	// Use either Enabled or Disabled. Both can not be used at the same time.
	Enabled []string `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	// Disabled is a list of plugin deactivated. Leave empty if you want to activate all plugins found in the `path` directory.
	// If not empty, the plugins whose name is in this list will be deactivated.
	// The name can be the name of the plugin or the name of the module. For example, you can put `Prometheus` to disable the Prometheus module that contains query, variables and datasource plugin.
	// Use either Enabled or Disabled. Both can not be used at the same time.
	Disabled []string `json:"disabled,omitempty" yaml:"disabled,omitempty"`
}

func (*Plugin) Verify added in v0.51.0

func (p *Plugin) Verify() error

type ProjectDatasourceConfig added in v0.51.0

type ProjectDatasourceConfig struct {
	// Disable is used to disable the project datasource feature.
	// It will also remove the associated proxy.
	Disable bool `json:"disable" yaml:"disable"`
}

type ProjectVariableConfig added in v0.51.0

type ProjectVariableConfig struct {
	// Disable is used to disable the project variable feature.
	// Note that if the global datasource and the project datasource are disabled,
	// then the project variable will also be disabled.
	Disable bool `json:"disable" yaml:"disable"`
}

type Provider

type Provider struct {
	SlugID            string         `json:"slug_id" yaml:"slug_id"`
	Name              string         `json:"name" yaml:"name"`
	ClientID          secret.Hidden  `json:"client_id" yaml:"client_id"`
	ClientSecret      secret.Hidden  `json:"client_secret,omitempty" yaml:"client_secret,omitempty"`
	ClientSecretFile  string         `json:"client_secret_file,omitempty" yaml:"client_secret_file,omitempty"`
	DeviceCode        *OAuthOverride `json:"device_code,omitempty" yaml:"device_code,omitempty"`
	ClientCredentials *OAuthOverride `json:"client_credentials,omitempty" yaml:"client_credentials,omitempty"`
	RedirectURI       common.URL     `json:"redirect_uri,omitempty" yaml:"redirect_uri,omitempty"`
	Scopes            []string       `json:"scopes,omitempty" yaml:"scopes,omitempty"`
	HTTP              HTTP           `json:"http" yaml:"http"`
	// Claims lists upstream token claim fields that Perses should persist in the
	// Perses JWT and optionally map to Perses roles.
	// +optional
	Claims []ProviderClaimConfig `json:"claims,omitempty" yaml:"claims,omitempty"`
}

func (*Provider) Verify

func (p *Provider) Verify() error

type ProviderClaimConfig added in v0.55.0

type ProviderClaimConfig struct {
	// ClaimName is the JSON field name in the upstream access token (e.g. "roles", "groups").
	ClaimName string `json:"claim_name" yaml:"claim_name"`
	// Mappings maps individual claim values to Perses roles.
	// +optional
	Mappings []ClaimMapping `json:"mappings,omitempty" yaml:"mappings,omitempty"`
}

ProviderClaimConfig describes one claim field that Perses should persist from the upstream access token, and optionally map to Perses roles.

func (*ProviderClaimConfig) Verify added in v0.55.0

func (p *ProviderClaimConfig) Verify() error

type ProvisioningConfig

type ProvisioningConfig struct {
	Folders []string `json:"folders,omitempty" yaml:"folders,omitempty"`
	// Interval is the refresh frequency
	Interval common.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
	// EnableWatch can be used to update provisioning on change instead of waiting for the configured interval.
	// Interval is still used to reconcile the state.
	EnableWatch bool `json:"enable_watch,omitempty" yaml:"enable_watch,omitempty"`
}

func (*ProvisioningConfig) Verify

func (p *ProvisioningConfig) Verify() error

type SQL

type SQL struct {
	// TLS configuration
	TLSConfig *secret.PublicTLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
	// Username
	User secret.Hidden `json:"user,omitempty" yaml:"user,omitempty"`
	// UserFile is a path to a file that contains a username
	UserFile string `json:"user_file,omitempty" yaml:"user_file,omitempty"`
	// Password (requires User)
	Password secret.Hidden `json:"password,omitempty" yaml:"password,omitempty"`
	// PasswordFile is a path to a file that contains a password
	PasswordFile string `json:"password_file,omitempty" yaml:"password_file,omitempty"`
	// Network type
	Net string `json:"net,omitempty" yaml:"net,omitempty"`
	// Network address (requires Net)
	Addr secret.Hidden `json:"addr,omitempty" yaml:"addr,omitempty"`
	// AddrFile is a path to a file that contains the network address
	AddrFile string `json:"addr_file,omitempty" yaml:"addr_file,omitempty"`
	// Database name
	DBName string `json:"db_name" yaml:"db_name"`
	// Connection collation
	Collation string `json:"collation,omitempty" yaml:"collation,omitempty"`
	// Location for time.Time values
	Loc *time.Location `json:"loc,omitempty" yaml:"loc,omitempty"`
	// Max packet size allowed
	MaxAllowedPacket int `json:"max_allowed_packet" yaml:"max_allowed_packet"`
	// Server public key name
	ServerPubKey string `json:"server_pub_key" yaml:"server_pub_key"`
	// Dial timeout
	Timeout common.Duration `json:"timeout" yaml:"timeout"`
	// I/O read timeout
	ReadTimeout common.Duration `json:"read_timeout" yaml:"read_timeout"`
	// I/O write timeout
	WriteTimeout common.Duration `json:"write_timeout" yaml:"write_timeout"`
	// Allow all files to be used with LOAD DATA LOCAL INFILE
	AllowAllFiles bool `json:"allow_all_files" yaml:"allow_all_files"`
	// Allows the cleartext client side plugin
	AllowCleartextPasswords bool `json:"allow_cleartext_passwords" yaml:"allow_cleartext_passwords"`
	// Allows fallback to unencrypted connection if server does not support TLS
	AllowFallbackToPlaintext bool `json:"allow_fallback_to_plaintext" yaml:"allow_fallback_to_plaintext"`
	// Allows the native password authentication method.
	// When unset, the driver default (true) is used.
	AllowNativePasswords *bool `json:"allow_native_passwords,omitempty" yaml:"allow_native_passwords,omitempty"`
	// Allows the old insecure password method
	AllowOldPasswords bool `json:"allow_old_passwords" yaml:"allow_old_passwords"`
	// Check connections for liveness before using them.
	// When unset, the driver default (true) is used.
	CheckConnLiveness *bool `json:"check_conn_liveness,omitempty" yaml:"check_conn_liveness,omitempty"`
	// Return number of matching rows instead of rows changed
	ClientFoundRows bool `json:"client_found_rows" yaml:"client_found_rows"`
	// Prepend table alias to column names
	ColumnsWithAlias bool `json:"columns_with_alias" yaml:"columns_with_alias"`
	// Interpolate placeholders into query string
	InterpolateParams bool `json:"interpolate_params" yaml:"interpolate_params"`
	// Allow multiple statements in one query
	MultiStatements bool `json:"multi_statements" yaml:"multi_statements"`
	// Parse time values to time.Time
	ParseTime bool `json:"parse_time" yaml:"parse_time"`
	// Reject read-only connections
	RejectReadOnly bool `json:"reject_read_only" yaml:"reject_read_only"`
	CaseSensitive  bool `json:"case_sensitive" yaml:"case_sensitive"`
	// ConnMaxLifetime is the maximum amount of time a connection may be reused.
	// It should be kept shorter than the server's wait_timeout to avoid reusing
	// connections that the server has already closed. Defaults to 3 minutes.
	ConnMaxLifetime common.Duration `json:"conn_max_lifetime,omitempty" yaml:"conn_max_lifetime,omitempty"`
	// ConnMaxIdleTime is the maximum amount of time a connection may be idle
	// before it is closed. Defaults to 1 minute.
	ConnMaxIdleTime common.Duration `json:"conn_max_idle_time,omitempty" yaml:"conn_max_idle_time,omitempty"`
	// MaxOpenConns is the maximum number of open connections to the database.
	// A value <= 0 means unlimited (the Go default).
	MaxOpenConns int `json:"max_open_conns,omitempty" yaml:"max_open_conns,omitempty"`
	// MaxIdleConns is the maximum number of connections in the idle connection
	// pool. A value <= 0 keeps the Go default (2).
	MaxIdleConns int `json:"max_idle_conns,omitempty" yaml:"max_idle_conns,omitempty"`
}

func (*SQL) Verify

func (s *SQL) Verify() error

type SameSite added in v0.47.0

type SameSite http.SameSite

func ParseSameSite added in v0.47.0

func ParseSameSite(s string) (SameSite, error)

func (SameSite) MarshalJSON added in v0.47.0

func (s SameSite) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*SameSite) MarshalText added in v0.47.0

func (s *SameSite) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (SameSite) MarshalYAML added in v0.47.0

func (s SameSite) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface.

func (SameSite) String added in v0.47.0

func (s SameSite) String() string

func (*SameSite) UnmarshalJSON added in v0.47.0

func (s *SameSite) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*SameSite) UnmarshalText added in v0.47.0

func (s *SameSite) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (*SameSite) UnmarshalYAML added in v0.47.0

func (s *SameSite) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

func (*SameSite) Verify added in v0.47.0

func (s *SameSite) Verify() error

type Schemas

type Schemas struct {
	PanelsPath      string          `json:"panels_path,omitempty" yaml:"panels_path,omitempty"`
	QueriesPath     string          `json:"queries_path,omitempty" yaml:"queries_path,omitempty"`
	DatasourcesPath string          `json:"datasources_path,omitempty" yaml:"datasources_path,omitempty"`
	VariablesPath   string          `json:"variables_path,omitempty" yaml:"variables_path,omitempty"`
	Interval        common.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
}

DEPRECATED: Schemas is depreacted

func (*Schemas) Verify

func (s *Schemas) Verify() error
type Search struct {
	// CheckLatestUpdateInterval is the interval when it checks if the index cache needs to be refreshed with db content. Only for SQL database setup.
	CheckLatestUpdateInterval common.Duration `json:"check_latest_update_interval,omitempty" yaml:"check_latest_update_interval,omitempty"`
	// ExcludedChars is the list of characters that will be excluded from the search engine.
	ExcludedChars []string  `json:"excluded_chars,omitempty" yaml:"excluded_chars,omitempty"`
	IndexKeys     IndexKeys `json:"index_keys,omitempty" yaml:"index_keys,omitempty"`
}

func (*Search) Verify added in v0.55.0

func (e *Search) Verify() error

type Security

type Security struct {
	// Readonly will deactivate any HTTP POST, PUT, DELETE endpoint
	Readonly bool `json:"readonly" yaml:"readonly"`
	// Cookie configuration
	Cookie Cookie `json:"cookie" yaml:"cookie"`
	// EncryptionKey is the secret key used to encrypt and decrypt sensitive data
	// stored in the database such as the password of the basic auth for a datasource.
	// In case authentication is enabled, it is also used to encrypt the access and refresh token used for authentication.
	// Therefore, if auth is enabled, and you did not set this key, Perses will not start and will return an error.
	// Also note the key size must be exactly 32 bytes long as we are using AES-256 to encrypt the data.
	EncryptionKey secret.Hidden `json:"encryption_key,omitempty" yaml:"encryption_key,omitempty"`
	// EncryptionKeyFile is the path to file containing the secret key
	EncryptionKeyFile string `json:"encryption_key_file,omitempty" yaml:"encryption_key_file,omitempty"`
	// When it is true, the authentication and authorization config are considered.
	// And you will need a valid JWT token to contact most of the endpoints exposed by the API
	EnableAuth bool `json:"enable_auth" yaml:"enable_auth"`
	// Authorization contains all configs around rbac (permissions and roles)
	Authorization AuthorizationConfig `json:"authorization,omitempty" yaml:"authorization,omitempty"`
	// Authentication contains configuration regarding management of access/refresh token
	Authentication AuthenticationConfig `json:"authentication,omitempty" yaml:"authentication,omitempty"`
	// Configuration for the CORS middleware.
	CORS CORSConfig `json:"cors,omitempty" yaml:"cors"`
	// SecretFileAllowedDirectories is the list of absolute directories from which the Secrets and GlobalSecrets
	// are allowed to read files (basicAuth.passwordFile, authorization.credentialsFile, oauth.clientSecretFile,
	// tlsConfig.caFile/certFile/keyFile).
	// When empty (default), any file reference in a Secret or a GlobalSecret is rejected.
	// This prevents a user allowed to create a secret from exfiltrating arbitrary files from the server.
	SecretFileAllowedDirectories []string `json:"secret_file_allowed_directories,omitempty" yaml:"secret_file_allowed_directories,omitempty"`
}

func (*Security) Verify

func (s *Security) Verify() error

type TimeRange added in v0.47.0

type TimeRange struct {
	DisableCustomTimeRange bool                    `json:"disable_custom,omitempty" yaml:"disable_custom,omitempty"`
	DisableZoomTimeRange   bool                    `json:"disable_zoom,omitempty" yaml:"disable_zoom,omitempty"`
	Options                []common.DurationString `json:"options,omitempty" yaml:"options,omitempty"`
}

func (*TimeRange) Verify added in v0.47.0

func (t *TimeRange) Verify() error

type VariableConfig added in v0.51.0

type VariableConfig struct {
	Global  GlobalVariableConfig  `json:"global" yaml:"global"`
	Project ProjectVariableConfig `json:"project" yaml:"project"`
	// DisableLocal when used is preventing the possibility to add a variable directly in the dashboard spec.
	DisableLocal bool `json:"disable_local" yaml:"disable_local"`
}

Jump to

Keyboard shortcuts

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