tenant

package
v0.0.0-...-58bd1cf Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthMethodPassword = "P"
	AuthMethodSSOSaml  = "S"
)
View Source
const TENANT_CTXKEY = "TENANT"

Variables

This section is empty.

Functions

func AuthFailed

func AuthFailed(c *xin.Context)

func AuthPassed

func AuthPassed(c *xin.Context)

func AuthUser

func AuthUser(c *xin.Context) *models.User

AuthUser get authenticated user

func BasicAuthFailed

func BasicAuthFailed(c *xin.Context)

func BasicAuthPassed

func BasicAuthPassed(c *xin.Context)

func CheckClientAndFindUser

func CheckClientAndFindUser(c *xin.Context, username string) (xmw.AuthUser, error)

func CheckClientIP

func CheckClientIP(c *xin.Context, u *models.User) bool

func Create

func Create(name string, comment string) error

func DeleteAuthUser

func DeleteAuthUser(c *xin.Context)

func FindUser

func FindUser(c *xin.Context, username string) (xmw.AuthUser, error)

func GetAuthUser

func GetAuthUser(c *xin.Context) *models.User

func GetSubdomain

func GetSubdomain(c *xin.Context) (string, bool)

func IsClientBlocked

func IsClientBlocked(c *xin.Context) bool

func IsHostnameError

func IsHostnameError(err error) bool

func IsMultiTenant

func IsMultiTenant() bool

func Iterate

func Iterate(itf func(tt *Tenant) error) error

Types

type HostnameError

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

func (*HostnameError) Error

func (he *HostnameError) Error() string

type PasswordPolicy

type PasswordPolicy struct {
	Locale    string
	MinLength int
	MaxLength int
	Strengths []string
	Strengthm *linkedhashmap.LinkedHashMap[string, string]
}

func (*PasswordPolicy) ValidatePassword

func (pp *PasswordPolicy) ValidatePassword(pwd string) (vs []string)

type Tenant

type Tenant struct {
	schema.Schema
	// contains filtered or unexported fields
}

func FindAndSetTenant

func FindAndSetTenant(c *xin.Context) (*Tenant, error)

func FromCtx

func FromCtx(c *xin.Context) *Tenant

func NewTenant

func NewTenant(name string) *Tenant

func (*Tenant) CacheUser

func (tt *Tenant) CacheUser(u *models.User)

func (*Tenant) ConfigMap

func (tt *Tenant) ConfigMap() map[string]string

func (*Tenant) ConfigValue

func (tt *Tenant) ConfigValue(k string) string

func (*Tenant) ConfigValues

func (tt *Tenant) ConfigValues(k string) []string

func (*Tenant) FindUser

func (tt *Tenant) FindUser(username string) (xmw.AuthUser, error)

func (*Tenant) GetCIDRs

func (tt *Tenant) GetCIDRs() []*net.IPNet

func (*Tenant) GetPasswordPolicy

func (tt *Tenant) GetPasswordPolicy(loc string) *PasswordPolicy

func (*Tenant) IsSAMLLogin

func (tt *Tenant) IsSAMLLogin() bool

func (*Tenant) RevokeUser

func (tt *Tenant) RevokeUser(username string)

func (*Tenant) ValidatePassword

func (tt *Tenant) ValidatePassword(loc, pwd string) []string

Jump to

Keyboard shortcuts

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