s

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockTimePerIncident

type BlockTimePerIncident struct {
	IllegalAccessAttempt     base2.Count `json:"illegalAccessAttempt"`     // 1.
	FakeToken                base2.Count `json:"fakeToken"`                // 2.
	VerificationCodeMismatch base2.Count `json:"verificationCodeMismatch"` // 3.
	DoubleLogInAttempt       base2.Count `json:"doubleLogInAttempt"`       // 4.
	PreSessionHacking        base2.Count `json:"preSessionHacking"`        // 5.
	CaptchaAnswerMismatch    base2.Count `json:"captchaAnswerMismatch"`    // 6.
	PasswordMismatch         base2.Count `json:"passwordMismatch"`         // 7.
	PasswordChangeHacking    base2.Count `json:"passwordChangeHacking"`    // 8.
	EmailChangeHacking       base2.Count `json:"emailChangeHacking"`       // 9.
	FakeIPA                  base2.Count `json:"fakeIPA"`                  // 10.
}

BlockTimePerIncident is block time in seconds for each type of incident.

type CaptchaImageSettings

type CaptchaImageSettings struct {
	// Images Server.
	Schema string `json:"schema"`
	Host   string `json:"host"`
	Port   uint16 `json:"port"`
	Path   string `json:"path"`
}

CaptchaImageSettings are settings of captcha images.

func (CaptchaImageSettings) Check

func (s CaptchaImageSettings) Check() (err error)

type DbSettings

type DbSettings = cs.DbSettings

DbSettings are parameters of the database.

type HttpsSettings

type HttpsSettings = cs.HttpsSettings

HttpsSettings are settings of an HTTPS server for incoming requests.

type JWTSettings

type JWTSettings struct {
	PrivateKeyFilePath cm.Path `json:"privateKeyFilePath"`
	PublicKeyFilePath  cm.Path `json:"publicKeyFilePath"`
	SigningMethod      string  `json:"signingMethod"`
}

JWTSettings are settings for JSON web tokens.

func (JWTSettings) Check

func (s JWTSettings) Check() (err error)

type MessageSettings

type MessageSettings struct {
	SubjectTemplateForRegVCode cmb.Text `json:"subjectTemplateForRegVCode"`
	SubjectTemplateForReg      cmb.Text `json:"subjectTemplateForReg"`
	BodyTemplateForRegVCode    cmb.Text `json:"bodyTemplateForRegVCode"`
	BodyTemplateForReg         cmb.Text `json:"bodyTemplateForReg"`
	BodyTemplateForLogIn       cmb.Text `json:"bodyTemplateForLogIn"`
	BodyTemplateForPwdChange   cmb.Text `json:"bodyTemplateForPwdChange"`
	BodyTemplateForEmailChange cmb.Text `json:"bodyTemplateForEmailChange"`
}

MessageSettings are settings of e-mail messages.

func (MessageSettings) Check

func (s MessageSettings) Check() (err error)

type Settings

type Settings struct {
	// Path to the file with these settings.
	FilePath cm.Path `json:"-"`

	// Program versioning information.
	VersionInfo *ver.Versioneer `json:"-"`

	HttpsSettings    `json:"https"`
	DbSettings       `json:"db"`
	SystemSettings   `json:"system"`
	JWTSettings      `json:"jwt"`
	UserRoleSettings `json:"role"`
	MessageSettings  `json:"message"`

	// Settings of host storing captcha images.
	CaptchaImageSettings `json:"captcha"`

	// External services.
	GwmSettings  s.ServiceClientSettings `json:"gwm"`
	SmtpSettings s.ServiceClientSettings `json:"smtp"`
	RcsSettings  s.ServiceClientSettings `json:"rcs"`
}

Settings is Server's settings.

func NewSettingsFromFile

func NewSettingsFromFile(filePath string, versionInfo *ver.Versioneer) (stn *Settings, err error)

func (*Settings) Check

func (stn *Settings) Check() (err error)

func (*Settings) UseConstructor

func (stn *Settings) UseConstructor(filePath string, versionInfo *ver.Versioneer) (cmi.ISettings, error)

type SystemSettings

type SystemSettings struct {
	SiteName                     base2.Text  `json:"siteName"`
	SiteDomain                   base2.Text  `json:"siteDomain"`
	VerificationCodeLength       base2.Count `json:"verificationCodeLength"`
	UserNameMaxLenInBytes        base2.Count `json:"userNameMaxLenInBytes"`
	UserPasswordMaxLenInBytes    base2.Count `json:"userPasswordMaxLenInBytes"`
	PreRegUserExpirationTime     base2.Count `json:"preRegUserExpirationTime"`
	IsAdminApprovalRequired      base2.Flag  `json:"isAdminApprovalRequired"`
	LogInRequestIdLength         base2.Count `json:"logInRequestIdLength"`
	LogInTryTimeout              base2.Count `json:"logInTryTimeout"`
	PreSessionExpirationTime     base2.Count `json:"preSessionExpirationTime"`
	SessionMaxDuration           base2.Count `json:"sessionMaxDuration"`
	PasswordChangeExpirationTime base2.Count `json:"passwordChangeExpirationTime"`
	EmailChangeExpirationTime    base2.Count `json:"emailChangeExpirationTime"`
	ActionTryTimeout             base2.Count `json:"actionTryTimeout"`
	PageSize                     base2.Count `json:"pageSize"`

	// This setting must be synchronised with settings of the Gateway module.
	IsTableOfIncidentsUsed base2.Flag `json:"isTableOfIncidentsUsed"`

	// This setting is used only when a table of incidents is enabled.
	BlockTimePerIncident BlockTimePerIncident `json:"blockTimePerIncident"`

	IsDebugMode bool `json:"isDebugMode"`
}

SystemSettings are system settings.

func (SystemSettings) Check

func (s SystemSettings) Check() (err error)

type UserRoleSettings

type UserRoleSettings struct {
	// List of IDs of users having a moderator role.
	ModeratorIds []cmb.Id `json:"moderatorIds"`

	// List of IDs of users having an administrator role.
	AdministratorIds []cmb.Id `json:"administratorIds"`
}

UserRoleSettings are settings for special user roles.

func (UserRoleSettings) Check

func (s UserRoleSettings) Check() (err error)

Jump to

Keyboard shortcuts

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