appinfo

package
v0.0.0-...-8a398ea Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetAppInfo(c *gin.Context)
	UpdateUserInterface(c *gin.Context)
}

func NewApi

func NewApi(store Store) API

type AppInfoResponse

type AppInfoResponse struct {
	UserInterfaceConf
	GlobalConf
	VersionConf
	Login       LoginConf        `json:"login"`
	Remediation *RemediationConf `json:"remediation,omitempty"`

	DefaultColorTheme colortheme.Response `json:"default_color_theme"`
	Maintenance       bool                `json:"maintenance"`

	SerialName string `json:"serial_name"`
}

type GlobalConf

type GlobalConf struct {
	Timezone          string `json:"timezone,omitempty"`
	FileUploadMaxSize int64  `json:"file_upload_max_size"`

	EventsCountTriggerDefaultThreshold int `json:"events_count_trigger_default_threshold"`
}

type JobConfigType

type JobConfigType struct {
	Name      string `json:"name"`
	AuthType  string `json:"auth_type"`
	WithBody  bool   `json:"with_body"`
	WithQuery bool   `json:"with_query"`
}

type LoginConf

type LoginConf struct {
	BasicConfig  LoginConfigMethod       `json:"basic,omitempty"`
	CasConfig    LoginConfigMethod       `json:"casconfig,omitempty"`
	LdapConfig   LoginConfigMethod       `json:"ldapconfig,omitempty"`
	SamlConfig   LoginConfigMethod       `json:"saml2config,omitempty"`
	OAuth2Config Oauth2LoginConfigMethod `json:"oauth2config,omitempty"`
}

type LoginConfigMethod

type LoginConfigMethod struct {
	Title  string `json:"title,omitempty"`
	Enable bool   `json:"enable"`
}

type Oauth2LoginConfigMethod

type Oauth2LoginConfigMethod struct {
	Providers []string `json:"providers,omitempty"`
	Enable    bool     `json:"enable"`
}

type PopupTimeout

type PopupTimeout struct {
	Info  *datetime.DurationWithUnit `json:"info,omitempty" bson:"info,omitempty"`
	Error *datetime.DurationWithUnit `json:"error,omitempty" bson:"error,omitempty"`
}

type RemediationConf

type RemediationConf struct {
	JobConfigTypes []JobConfigType `json:"job_config_types"`
}

type Store

type Store interface {
	RetrieveLoginConfig() LoginConf
	RetrieveUserInterfaceConfig(ctx context.Context) (UserInterfaceConf, error)
	RetrieveVersionConfig(ctx context.Context) (VersionConf, error)
	RetrieveGlobalConfig(ctx context.Context) (GlobalConf, error)
	RetrieveRemediationConfig(ctx context.Context) (RemediationConf, error)
	UpdateUserInterfaceConfig(ctx context.Context, conf *UserInterfaceConf) error
	RetrieveMaintenanceState(ctx context.Context) (bool, error)
	RetrieveDefaultColorTheme(ctx context.Context, id string) (colortheme.Response, error)
	RetrieveSerialName(ctx context.Context) (string, error)
}

func NewStore

func NewStore(db mongo.DbClient, maintenanceAdapter config.MaintenanceAdapter,
	pgPoolProvider postgres.PoolProvider, securityConfig security.Config, authorProvider author.Provider) Store

NewStore instantiates configuration store.

type UserInterfaceConf

type UserInterfaceConf struct {
	AppTitle                   string        `json:"app_title,omitempty" bson:"app_title,omitempty"`
	Footer                     string        `json:"footer,omitempty" bson:"footer,omitempty"`
	LoginPageDescription       string        `json:"login_page_description,omitempty" bson:"login_page_description,omitempty"`
	Language                   string        `json:"language,omitempty" bson:"language,omitempty" binding:"oneoforempty=fr en"`
	PopupTimeout               *PopupTimeout `json:"popup_timeout,omitempty" bson:"popup_timeout,omitempty"`
	AllowChangeSeverityToInfo  bool          `json:"allow_change_severity_to_info" bson:"allow_change_severity_to_info"`
	MaxMatchedItems            int64         `json:"max_matched_items" bson:"max_matched_items" binding:"gt=0"`
	CheckCountRequestTimeout   int64         `json:"check_count_request_timeout" bson:"check_count_request_timeout" binding:"gt=0"`
	ShowHeaderOnKioskMode      bool          `json:"show_header_on_kiosk_mode" bson:"show_header_on_kiosk_mode"`
	RequiredInstructionApprove bool          `json:"required_instruction_approve" bson:"required_instruction_approve"`
	DisabledTransitions        bool          `json:"disabled_transitions" bson:"disabled_transitions"`
	AutoSuggestPbehaviorName   bool          `json:"auto_suggest_pbehavior_name" bson:"auto_suggest_pbehavior_name"`
	DefaultColorTheme          string        `json:"default_color_theme" bson:"default_color_theme"`
}

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(dbClient mongo.DbClient) *Validator

func (*Validator) ValidateRequest

func (v *Validator) ValidateRequest(ctx context.Context, sl validator.StructLevel)

type VersionConf

type VersionConf struct {
	Edition string `json:"edition" bson:"edition"`
	Stack   string `json:"stack" bson:"stack"`

	Version        string            `json:"version" bson:"version"`
	VersionUpdated *datetime.CpsTime `json:"version_updated" bson:"version_updated" swaggertype:"integer"`
}

Jump to

Keyboard shortcuts

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