Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultPanelsPath = "schemas/panels" DefaultQueriesPath = "schemas/queries" DefaultDatasourcesPath = "schemas/datasources" DefaultVariablesPath = "schemas/variables" )
View Source
const ( DefaultAccessTokenTTL = time.Minute * 15 DefaultRefreshTokenTTL = time.Hour * 24 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationConfig ¶ added in v0.42.0
type AuthenticationConfig struct {
// AccessTokenTTL is the time to live of the access token. By default, it is 15 minutes.
AccessTokenTTL time.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 time.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"`
}
func (AuthenticationConfig) MarshalJSON ¶ added in v0.42.0
func (a AuthenticationConfig) MarshalJSON() ([]byte, error)
func (*AuthenticationConfig) Verify ¶ added in v0.42.0
func (a *AuthenticationConfig) Verify() error
type AuthorizationConfig ¶ added in v0.42.0
type AuthorizationConfig struct {
// CheckLatestUpdateInterval that check if the RBAC cache need to be refreshed with db content. Only for SQL database setup.
CheckLatestUpdateInterval time.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) MarshalJSON ¶ added in v0.42.0
func (a AuthorizationConfig) MarshalJSON() ([]byte, error)
func (*AuthorizationConfig) Verify ¶ added in v0.42.0
func (a *AuthorizationConfig) Verify() error
type Config ¶
type Config struct {
// Security contains any configuration that changes the API behavior like the endpoints exposed or if the permissions are activated.
Security Security `json:"security" yaml:"security"`
// Database contains the different configuration depending on the database you want to use
Database Database `json:"database" yaml:"database"`
// Schemas contain the configuration to get access to the CUE schemas
Schemas Schemas `json:"schemas" yaml:"schemas"`
// ImportantDashboards contains important dashboard selectors
ImportantDashboards []dashboardSelector `json:"important_dashboards,omitempty" yaml:"important_dashboards,omitempty"`
// Information contains markdown content to be display on the home page
Information string `json:"information,omitempty" yaml:"information,omitempty"`
Provisioning ProvisioningConfig `json:"provisioning,omitempty" yaml:"provisioning,omitempty"`
}
type Database ¶
type File ¶
type File struct {
Folder string `json:"folder" yaml:"folder"`
Extension FileExtension `json:"extension" yaml:"extension"`
}
type FileExtension ¶
type FileExtension string
const ( YAMLExtension FileExtension = "yaml" JSONExtension FileExtension = "json" )
type ProvisioningConfig ¶ added in v0.42.0
type ProvisioningConfig struct {
Folders []string `json:"folders" yaml:"folders"`
// Interval is the refresh frequency
Interval time.Duration `json:"interval" yaml:"interval"`
}
func (ProvisioningConfig) MarshalJSON ¶ added in v0.42.0
func (p ProvisioningConfig) MarshalJSON() ([]byte, error)
func (*ProvisioningConfig) Verify ¶ added in v0.42.0
func (p *ProvisioningConfig) Verify() error
type SQL ¶ added in v0.24.0
type SQL struct {
// TLS configuration
TLSConfig *config.TLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
// Username
User config.Secret `json:"user,omitempty" yaml:"user,omitempty"`
// Password (requires User)
Password config.Secret `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 config.Secret `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 time.Duration `json:"timeout" yaml:"timeout"`
// I/O read timeout
ReadTimeout time.Duration `json:"read_timeout" yaml:"read_timeout"`
// I/O write timeout
WriteTimeout time.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"`
}
type Schemas ¶
type Schemas struct {
PanelsPath string `yaml:"panels_path,omitempty"`
QueriesPath string `yaml:"queries_path,omitempty"`
DatasourcesPath string `yaml:"datasources_path,omitempty"`
VariablesPath string `yaml:"variables_path,omitempty"`
Interval time.Duration `yaml:"interval,omitempty"`
}
func (Schemas) MarshalJSON ¶ added in v0.13.0
type Security ¶ added in v0.42.0
type Security struct {
// Readonly will deactivate any HTTP POST, PUT, DELETE endpoint
Readonly bool `json:"readonly" yaml:"readonly"`
// 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.
// When Perses is used in a multi instance mode, you should provide the key.
// Otherwise, each instance will have a different key and therefore won't be able to decrypt what the other is encrypting.
// Also note the key must be at least 32 bytes long.
EncryptionKey promConfig.Secret `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 the time to live of the access/refresh token
Authentication AuthenticationConfig `json:"authentication,omitempty" yaml:"authentication,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.