conf

package
v1.14.26 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAdminOrg  = "admin"
	DefaultAdminApp  = "iam"
	DefaultAdminUser = "root"
)

Admin identity. Three orthogonal slots:

AdminOrg   organization that owns IAM itself          (default "admin")
AdminApp   the IAM application inside that org        (default "iam")
AdminUser  bootstrap admin user inside that org       (default "root")

Resolved once at package init. In production each may be overridden via env; if unset in production, requiredEnvOrDefault panics so a misconfig fails loud at boot rather than silently bootstrapping with weak names.

Variables

View Source
var (
	AdminOrg  = requiredEnvOrDefault("IAM_ADMIN_ORG", DefaultAdminOrg)
	AdminApp  = requiredEnvOrDefault("IAM_ADMIN_APP", DefaultAdminApp)
	AdminUser = requiredEnvOrDefault("IAM_ADMIN_USER", DefaultAdminUser)
)
View Source
var WafConf string

Functions

func GetConfigBatchSize

func GetConfigBatchSize() int

func GetConfigBool

func GetConfigBool(key string) bool

func GetConfigDataSourceName

func GetConfigDataSourceName() string

func GetConfigInt64

func GetConfigInt64(key string) (int64, error)

func GetConfigString

func GetConfigString(key string) string

func GetLanguage

func GetLanguage(language string) string

func IsProduction added in v1.14.21

func IsProduction() bool

IsProduction reports whether the runtime environment is production-grade. Checks $ENV, $ENVIRONMENT, $GO_ENV, $BEEGO_RUNMODE, $RUN_MODE and the `environment` key in app.conf.

func ReplaceDataSourceNameByDocker

func ReplaceDataSourceNameByDocker(dataSourceName string) string

func SandboxOTPEnabled added in v1.14.18

func SandboxOTPEnabled() bool

SandboxOTPEnabled gates the phone-OTP shortcut: when true, non-E.164 phone numbers are accepted on signin (the country-code prefix is added inline) so seed scripts using sandbox phones like 1337000007 can complete OTP login. Enabled in any non-prod env. Read from ENV first (sandbox infra usually sets this), then `environment` in app.conf.

Production envs (production / prod / main / mainnet) hard-disable this — real phones MUST parse as E.164 or signin fails clearly.

(Replaces the older IsDemoMode() which braided two concerns — the OTP shortcut and the original demo-site UI hijack — into one boolean. The UI hijack is ripped; this function keeps only the OTP semantics under a name that reflects what it does.)

Types

type Quota

type Quota struct {
	Organization int `json:"organization"`
	User         int `json:"user"`
	Application  int `json:"application"`
	Provider     int `json:"provider"`
}

func GetConfigQuota

func GetConfigQuota() *Quota

type WebConfig

type WebConfig struct {
	ShowGithubCorner bool   `json:"showGithubCorner"`
	ForceLanguage    string `json:"forceLanguage"`
	DefaultLanguage  string `json:"defaultLanguage"`
	StaticBaseUrl    string `json:"staticBaseUrl"`
	AiAssistantUrl   string `json:"aiAssistantUrl"`
}

func GetWebConfig

func GetWebConfig() *WebConfig

Jump to

Keyboard shortcuts

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