Versions in this module Expand all Collapse all v1 v1.0.0 Nov 7, 2021 Changes in this version + const CtxUserInfoKey + const PermAdmin + const PermEditor + const PermGuest + const PermMember + const PermOwner + const PermViewer + type AccessGuest interface + GetSource func() string + GetSourceID func() string + func NewAccessGuest(host, source, sid, acc, name, db, perm string) AccessGuest + type CompanyUser interface + GetComp func() string + GetCompID func() string + func GetCompUserInfo(req *http.Request) CompanyUser + func NewCompUser(host, uid, acc, name, compID, comp, perm string) CompanyUser + type JwtConf struct + Claims struct{ ... } + Header struct{ ... } + PrivateKeyFile string + PublicKeyFile string + func (j *JwtConf) GetCompanyToken(host, compID, compName, userID, acc, userName string, perm UserPerm) (*string, error) + func (j *JwtConf) GetJwtAccessToken(host string, source string, id interface{}, db string, perm UserPerm) (*string, error) + func (j *JwtConf) GetKid() string + func (j *JwtConf) GetToken(host string, data map[string]interface{}, exp uint8) (*string, error) + func (j *JwtConf) NewJwt() JwtToken + func (j *JwtConf) ParseToken(tokenStr string) (*jwt.Token, error) + type JwtDI interface + GetKid func() string + NewJwt func() JwtToken + type JwtToken interface + GetCompanyToken func(host, compID, compName, userID, acc, userName string, perm UserPerm) (*string, error) + GetJwtAccessToken func(host string, source string, id interface{}, db string, perm UserPerm) (*string, error) + GetToken func(host string, data map[string]interface{}, exp uint8) (*string, error) + ParseToken func(tokenStr string) (*jwt.Token, error) + type ReqUser interface + GetDB func() string + GetId func() string + GetPerm func() string + Host func() string + func GetUserInfo(req *http.Request) ReqUser + func NewGuestUser(host, ip string) ReqUser + func NewReqUser(host, uid, acc, name, perm string) ReqUser + type Totp interface + GenerateCode func() (string, error) + ShowInfo func() error + ValidateCode func(code string) (valid bool, err error) + WriteQRCode func(w io.Writer) error + func NewTotp(host, account, secret string) Totp + type TransmitSecurity interface + GetAccessToken func(code, redirect string) (string, error) + GetAuthUrl func(redirect string) string + GetUserInfo func(accessToken string) (string, error) + type TransmitSecurityConf struct + ClientId string + Host string + Secret string + func (c *TransmitSecurityConf) GetAccessToken(code, redirect string) (string, error) + func (c *TransmitSecurityConf) GetAuthUrl(redirect string) string + func (c *TransmitSecurityConf) GetUserInfo(accessToken string) (string, error) + type UserPerm string + func (up UserPerm) Validate() bool