config

package
v0.0.0-...-6a915cc Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AuthMethodCredentials = "method_credentials"
View Source
const AuthMethodOIDC = "method_oidc"

Variables

This section is empty.

Functions

func Reload

func Reload() error

func Save

func Save() error

func Update

func Update(updateFunc func(*RuntimeConfig) error) error

Types

type AgentConfig

type AgentConfig struct {
	AutomaticallySyncListfiles bool `json:"auto_sync_listfiles"`
	SplitJobsPerAgent          int  `json:"split_jobs_per_agent"`
}

type AuthConfig

type AuthConfig struct {
	General AuthGeneralConfig `json:"general"`
	OIDC    AuthOIDCConfig    `json:"oidc"`
}

type AuthGeneralConfig

type AuthGeneralConfig struct {
	EnabledMethods                    []string `json:"enabled_methods"`
	IsMFARequired                     bool     `json:"is_mfa_required"`
	RequirePasswordChangeOnFirstLogin bool     `json:"require_password_change_on_first_login"`
}

type AuthOIDCConfig

type AuthOIDCConfig struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`

	IssuerURL   string `json:"issuer_url"`
	RedirectURL string `json:"redirect_url"`

	AutomaticUserCreation bool   `json:"automatic_user_creation"`
	UsernameClaim         string `json:"username_claim"`

	RolesClaim   string `json:"role_field"`
	RequiredRole string `json:"required_role"`
	Prompt       string `json:"prompt"`

	AdditionalScopes []string `json:"scopes"`
}

type GeneralConfig

type GeneralConfig struct {
	IsMaintenanceMode               bool  `json:"is_maintenance_mode"`
	MaximumUploadedFileSize         int64 `json:"maximum_uploaded_file_size"`
	MaximumUploadedFileLineScanSize int64 `json:"maximum_uploaded_file_line_scan_size"`
}

type RuntimeConfig

type RuntimeConfig struct {
	ConfigVersion int `json:"version"`

	IsSetupComplete bool `json:"is_setup_complete"`

	Auth    AuthConfig    `json:"auth"`
	Agent   AgentConfig   `json:"agent"`
	General GeneralConfig `json:"general"`
}

func Get

func Get() RuntimeConfig

func MakeDefaultConfig

func MakeDefaultConfig() RuntimeConfig

func (RuntimeConfig) ToAdminDTO

func (conf RuntimeConfig) ToAdminDTO() apitypes.AdminConfigResponseDTO

func (RuntimeConfig) ToPublicDTO

func (conf RuntimeConfig) ToPublicDTO() apitypes.PublicConfigDTO

Jump to

Keyboard shortcuts

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