Versions in this module Expand all Collapse all v0 v0.7.6 Apr 28, 2019 v0.7.5 Mar 10, 2019 v0.7.4 Mar 9, 2019 v0.7.3 Mar 9, 2019 Changes in this version + const InjectionTestMode + const LoginAuthCookieLife + const LoginHashCookieLife + const SandBoxMode + var AdminReservedIDs = map[string]bool + var ApiIn2faPendingMode = map[string]bool + var DebugFlags = map[string]bool + var DebugMutex sync.Mutex + var ErrEarlyExit = errors.New("Early Exit - return") + var ErrNoSuchUser = errors.New("User not found - no such user") + var MarkPageJS = ... + var ReservedIDs = map[string]bool + var TestModeInject = map[string]bool + func AnError(hdlr *AesSrpType, www http.ResponseWriter, req *http.Request, httpCode int, ...) + func AnErrorRv(hdlr *AesSrpType, www http.ResponseWriter, req *http.Request, httpCode int, ...) (rv string) + func CheckMayAccessApi(hdlr *AesSrpType, rw *goftlmux.MidBuffer, SandBoxPrefix string, ...) (ok bool) + func CmpBackupKeys(hdlr *AesSrpType, salt string, set string, to string) (hash string, found bool, hv string) + func ConfigEmailAWS(hdlr *AesSrpType, file string) + func DbDel(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string) + func DbExpire(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, life int) (err error) + func DbFetchUser(hdlr *AesSrpType, rw *goftlmux.MidBuffer, req *http.Request, username string, ...) (salt string, verif string, mdata map[string]string, err error) + func DbFetchUserMdata(hdlr *AesSrpType, rw *goftlmux.MidBuffer, username, SandBoxPrefix string) (mdata map[string]string, err error) + func DbGetString(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string) (rkey string, err error) + func DbSandboxKey(hdlr *AesSrpType, key string) (rkey string) + func DbSetExpire(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, val string, life int) (err error) + func DbSetString(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, val string) (err error) + func DecryptData(hdlr *AesSrpType, rw *goftlmux.MidBuffer, www http.ResponseWriter, ...) (plaintext, key []byte, err error) + func EncryptData(hdlr *AesSrpType, www http.ResponseWriter, req *http.Request, ...) (rv string, err error) + func GenBackupKeys(hdlr *AesSrpType, salt string, prefix string, www http.ResponseWriter, ...) (raw string, hash string) + func GenRandBytes(nRandBytes int) (buf []byte, err error) + func GenRandNumber(nDigits int) (buf string, err error) + func GenerateEmailAuthKey() (EmailAuthKey string) + func GenerateRandomDeviceID() (DeviceID string) + func GenerateRandomOneTimeKey(initialDigit string) (OneTimeKey string) + func GenerateValidationSecret() (secret string) + func GetDebugFlag(name string) (rv bool) + func GetEmailAuth(hdlr *AesSrpType, rw *goftlmux.MidBuffer, emailAuthToken, SandBoxPrefix string) (email string, ok bool) + func GetEmailFromIamI(hdlr *AesSrpType, rw *goftlmux.MidBuffer, SandBoxPrefix string, IamI string) (email, Etag string, err error) + func GetEmailFromRegKey(regKey string) (email string, err error) + func GetKeyData(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string) (pw string, salt string, key string, iter int, keysize int, email string, ...) + func GetKeyDataRaw(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string) (key string, email string, ss map[string]interface{}) + func GetSalt(hdlr *AesSrpType, www http.ResponseWriter, req *http.Request, ...) (salt string, v string) + func IsLoggedIn(hdlr *AesSrpType, rw *goftlmux.MidBuffer, ps goftlmux.Params) (rv bool) + func SandBoxKey(pre, sandbox, key string) (rKey string) + func Save2FactorAuth(hdlr *AesSrpType, rw *goftlmux.MidBuffer, ...) + func SaveAsList(orig string, item string) (rv string) + func SaveCookieAuth(hdlr *AesSrpType, rw *goftlmux.MidBuffer, ...) + func SaveEmailAuth(hdlr *AesSrpType, rw *goftlmux.MidBuffer, ...) + func SaveInitData(hdlr *AesSrpType, rw *goftlmux.MidBuffer, ...) (err error) + func SaveInitFailedLogin(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string) (err error) + func SaveKeyData(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string, ...) (err error) + func SaveLogoutData(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string) (err error) + func SaveSupportMessage(rw *goftlmux.MidBuffer, fr, sub, bod string) + func SendEmailViaAWS(hdlr *AesSrpType, email_addr string, app string, tmpl string, pw string, ...) + func SendEmailViaAWS_support(hdlr *AesSrpType, email_addr string, app string, tmpl string, ...) + func SetDebugFlag(name string, to bool) + func SetDebugFlagsFromGlobal(gCfg *cfg.ServerGlobalConfigType) + func SetEmailFromIamI(hdlr *AesSrpType, rw *goftlmux.MidBuffer, SandBoxPrefix string, ...) (err error) + func SetLoggedIn(hdlr *AesSrpType, rw *goftlmux.MidBuffer, un, SandBoxPrefix, key string) + func SetSaltV(hdlr *AesSrpType, www http.ResponseWriter, req *http.Request, ...) + func SetupRoles(rolesName []string, accessLevels map[string][]string) ([]RolesWithBitMask, map[string]uint64, []RolesWithBitMask) + func UpdateNotStayLoggedIn(hdlr *AesSrpType, rw *goftlmux.MidBuffer, SandBoxPrefix string, ...) (err error) + func UpdateSessionEncryptionKey(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string, ...) (err error) + func UserGetEmail(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string) (email string, err error) + func ValidUUID(uuid string) (rv bool) + func ValidateCookies(LoginAuthCookie, LoginHashCookie, validation_secret, email string) bool + func ValidateEmail(email string) (rv bool) + func XxSaveSessionData(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string, ...) (err error) + func XxSaveUserExists(hdlr *AesSrpType, rw *goftlmux.MidBuffer, tt, SandBoxPrefix string, ...) (err error) + type AesSrpType struct + AdminPassword string + AllowReregisterDeviceID bool + AnonUserPaths []string + BackupKeyIter int + BackupKeySizeBytes int + Bits int + CookieExpireInXDays int + CookieExpireInXDays2 int + CookieSessionLife int + DbUserColAPI string + DbUserCols []string + DbUserColsDb []string + EmailApp string + EmailConfigFileName string + EncReqPaths []string + FailedLoginThreshold int + InDemoMode bool + InTestMode bool + KermitRule bool + KeyIter int + KeySessionLife int + LimitDeviceIDs int + LineNo int + MatchPaths []string + NGData Ng_struct + NewUserPrivs string + Next http.Handler + NonEmailAccts []string + PasswordSV string + Paths []string + Pre2Factor string + PreAuth string + PreEau string + PreKey string + PwExpireIn int + PwRecoverTemplate1 string + PwRecoverTemplate2 string + PwRecoverTemplate3 string + PwResetKey string + RegTemplate1 string + RegTemplate2 string + RegTemplate3 string + RegTemplate4 string + SandBoxExpreTime int + SecurityAccessLevelsName map[string][]string + SecurityConfig SecurityConfigType + SecurityPrivilages map[string][]string + SendEmail bool + SendStatusOnError bool + SessionLife int + StayLoggedInExpire int + SupportEmailTo string + TestModeInject []string + TwoFactorLife int + TwoFactorRequired string + UserNameForRegister bool + func GetRwHdlrFromWWW(www http.ResponseWriter, req *http.Request) (rw *goftlmux.MidBuffer, hdlr *AesSrpType, ok bool) + func NewAesSrpServer(n http.Handler, p []string, e []string, gCfg *cfg.ServerGlobalConfigType) *AesSrpType + func (hdlr *AesSrpType) CookieEmailMatch(rw *goftlmux.MidBuffer, email, cookie, SandBoxPrefix string) bool + func (hdlr *AesSrpType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error) + func (hdlr *AesSrpType) IsValidAnonUserPath(path string) bool + func (hdlr *AesSrpType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error) + func (hdlr *AesSrpType) ServeHTTP(www http.ResponseWriter, req *http.Request) + func (hdlr *AesSrpType) UpsertUserInfo(userId string, mdata map[string]string) + func (hdlr *AesSrpType) ValidUserName(un string) bool + type DeviceIDType struct + CreationDate string + DeviceID string + Title string + type LoginRetrunValue struct + BackupKeys string + DeviceID string + DeviceIDList []DeviceIDType + FirstLogin bool + FirstName string + HaveAnon bool + LastName string + LoginLastsSeconds int + LoginLastsTill string + M2 string + MidName string + MoreBackupKeys bool + OwnerEmail string + PhoneNo string + RealName string + Status string + TwoFactorRequired string + UserName string + UserRole RolesWithBitMask + XAttrs string + type LoginRetrunValueNo2fa struct + FirstLogin bool + FirstName string + HaveAnon bool + LastName string + LoginLastsSeconds int + LoginLastsTill string + M2 string + MidName string + OwnerEmail string + PhoneNo string + RealName string + Status string + TwoFactorRequired string + UserName string + UserRole RolesWithBitMask + XAttrs string + type Ng_struct struct + G string + N string + type RSaveToRedis struct + Pre string + Ttl uint64 + Ttl_srp_S uint64 + Ttl_srp_V uint64 + func NewRSaveToRedis(pre string) *RSaveToRedis + func (rs *RSaveToRedis) RDeSerial(s string) (rv map[string]string) + func (rs *RSaveToRedis) RGetValue(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string) (val map[string]string, ok bool) + func (rs *RSaveToRedis) RGetValueRaw(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string) (val string, ok bool) + func (rs *RSaveToRedis) RSerial(val map[string]string) (rv string) + func (rs *RSaveToRedis) RSetValue(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, val map[string]string) + func (rs *RSaveToRedis) RUpdValue(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, val map[string]string) + type RSaveToRedisInterface interface + RGetValue func(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string) (val map[string]string, ok bool) + RGetValueRaw func(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string) (val string, ok bool) + RSetValue func(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, val map[string]string) + RUpdValue func(hdlr *AesSrpType, rw *goftlmux.MidBuffer, key string, val map[string]string) + type RolesWithBitMask struct + BitMask uint64 + Name string + type SecurityConfigType struct + AccessLevels map[string][]string + MayAccessApi map[string][]string + Privilages map[string][]string + Roles []string