Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfigBatchSize() int
- func GetConfigBool(key string) bool
- func GetConfigDataSourceName() string
- func GetConfigInt64(key string) (int64, error)
- func GetConfigString(key string) string
- func GetLanguage(language string) string
- func IsProduction() bool
- func ReplaceDataSourceNameByDocker(dataSourceName string) string
- func SandboxOTPEnabled() bool
- type Quota
- type WebConfig
Constants ¶
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 ¶
var ( AdminOrg = requiredEnvOrDefault("IAM_ADMIN_ORG", DefaultAdminOrg) AdminApp = requiredEnvOrDefault("IAM_ADMIN_APP", DefaultAdminApp) AdminUser = requiredEnvOrDefault("IAM_ADMIN_USER", DefaultAdminUser) )
var WafConf string
Functions ¶
func GetConfigBatchSize ¶
func GetConfigBatchSize() int
func GetConfigBool ¶
func GetConfigDataSourceName ¶
func GetConfigDataSourceName() string
func GetConfigInt64 ¶
func GetConfigString ¶
func GetLanguage ¶
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 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