config

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultAccessTokenTTL  = time.Minute * 15
	DefaultRefreshTokenTTL = time.Hour * 24
	DefaultProviderTimeout = time.Minute * 1
)
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

This section is empty.

Types

type AuthProviders

type AuthProviders struct {
	EnableNative bool            `json:"enable_native" yaml:"enable_native"`
	OAuth        []OAuthProvider `json:"oauth,omitempty" yaml:"oauth,omitempty"`
	OIDC         []OIDCProvider  `json:"oidc,omitempty" yaml:"oidc,omitempty"`
}

func (*AuthProviders) Verify

func (p *AuthProviders) Verify() error

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 AuthProviders `json:"providers" yaml:"providers"`
}

func (*AuthenticationConfig) Verify

func (a *AuthenticationConfig) Verify() error

type AuthorizationConfig

type AuthorizationConfig struct {
	// 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 (*AuthorizationConfig) Verify

func (a *AuthorizationConfig) 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 Config

type Config struct {
	// Use it in case you want to prefix the API path.
	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"`
}

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 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"`
}

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"`
	// 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 important dashboard selectors
	ImportantDashboards []dashboardSelector `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"`
}

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" yaml:"tls_config"`
}

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 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 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"`
}

func (*KubernetesDiscovery) Verify added in v0.47.0

func (d *KubernetesDiscovery) 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" yaml:"client_secret"`
	Scopes       []string      `json:"scopes" yaml:"scopes"`
}

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 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"`
}

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.
	ArchivePath string `json:"archive_path,omitempty" yaml:"archive_path,omitempty"`
	// DevEnvironment is the configuration to use when developing a plugin
	EnableDev bool `json:"enable_dev" yaml:"enable_dev"`
}

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"`
	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"`
}

func (*Provider) Verify

func (p *Provider) 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"`
}

func (*ProvisioningConfig) Verify

func (p *ProvisioningConfig) Verify() error

type SQL

type SQL struct {
	// TLS configuration
	TLSConfig *config.TLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
	// Username
	User secret.Hidden `json:"user,omitempty" yaml:"user,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"`
	// 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:"maxAllowedPacket"`
	// 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
	AllowNativePasswords bool `json:"allow_native_passwords" yaml:"allow_native_passwords"`
	// Allows the old insecure password method
	AllowOldPasswords bool `json:"allow_old_passwords" yaml:"allow_old_passwords"`
	// Check connections for liveness before using them
	CheckConnLiveness bool `json:"check_conn_liveness" yaml:"check_conn_liveness"`
	// 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"`
}

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 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.
	// Note that if it is not provided, it will use a default value.
	// On a production instance, you should set this key.
	// 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"`
}

func (*Security) Verify

func (s *Security) Verify() error

type TimeRange added in v0.47.0

type TimeRange struct {
	DisableCustomTimeRange bool              `json:"disable_custom" yaml:"disable_custom"`
	DisableZoomTimeRange   bool              `json:"disable_zoom" yaml:"disable_zoom"`
	Options                []common.Duration `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