auth_check

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const NIterations = 25000

NIterations is the number of iterations that pbkdf2 hasing will use

Variables

View Source
var BaseServerUrl string
View Source
var DB *sql.DB
View Source
var DbFlag = make(map[string]bool)
View Source
var GitCommit string
View Source
var QueryConfig = []ymux.CrudQueryConfig{
	{
		CrudBaseConfig: ymux.CrudBaseConfig{
			URIPath:       "/api/v2/list-sub-acct",
			AuthKey:       false,
			JWTKey:        true,
			TableNameList: []string{"t_ymux_user"},
			AuthPrivs:     []string{"user:admin"},
			ParameterList: []ymux.ParamListItem{
				{ReqVar: "user_id"},
			},
			DocTag: "<h2>/api/v2/list-sub-acct",
		},

		QueryString: `
select 
	"id",
	"username",
	"acct_expire",
	"acct_type",
	"auth_token",
	"config",
	"created",
	"default_image",
	"default_title",
	"email",
	"org_user_id",
	"parent_user_id",
	"real_name",
	"realm",
	"user_role",
	"roles_privs"
from "t_ymux_user" 
where "parent_user_id" = $1 
order by "real_name"
`,
	},

	{
		CrudBaseConfig: ymux.CrudBaseConfig{
			URIPath:       "/api/v2/list-registration-tokens",
			AuthKey:       false,
			JWTKey:        true,
			TableNameList: []string{"t_ymux_registration_token"},
			AuthPrivs:     []string{"user"},
			ParameterList: []ymux.ParamListItem{},
			DocTag:        "<h2>/api/v2/list-registration-tokens",
		},
		QueryString: `
select *
from "t_ymux_registration_token" 
order by "created"
`,
	},
}
View Source
var StoredProcConfig = []ymux.CrudStoredProcConfig{}
View Source
var TableConfig = []ymux.CrudConfig{}

Functions

func AddCookie

func AddCookie(w http.ResponseWriter, name, value string, inDays int)

addCookie will apply a new cookie to the response of a http request, with the key/value this method is passed.

func AddSecureCookie

func AddSecureCookie(w http.ResponseWriter, name, value string, inDays int)

func CheckPassword

func CheckPassword(pw string, ignore bool) bool

CheckPassword if ignore is false will use remote site to validate password. ignore should be true for things like the old password when chaning passwords (so you can upgrade a password).

Documented: https://haveibeenpwned.com/API/v2#PwnedPasswords GET https://api.pwnedpasswords.com/range/{first 5 hash chars}

Examlple Call:

if CheckPassword(newPhrase, isOldPassword) == false {
	Fatalf(3, "Password is a known to be leaked (pwned) password - you will need to use a different password\n")
}

func GenPassword

func GenPassword() string

func GenRedisQRKey

func GenRedisQRKey(qr_id string) (rv string)

func GenUUID

func GenUUID() string

func GenerateQRCodeURL

func GenerateQRCodeURL(qr_id string, ty string) (qr_url string)

convert from a qr_id to the URL for the QR image.

func GenerateSecret

func GenerateSecret() string

func GetRedisValues

func GetRedisValues(key string) (rv string, err error)

GetRedisValue looks in redis for the `key` and gets back the value from that key or it returns an error.

func Handle2FADevSetup

func Handle2FADevSetup(www http.ResponseWriter, req *http.Request)

func Handle2FAGetMoreDevOtk

func Handle2FAGetMoreDevOtk(www http.ResponseWriter, req *http.Request)

xyzzy555 - Implement this - mux.Handle("/api/v2/2fa-get-more-dev-otk", http.HandlerFunc(Handle2FAGetMoreDevOtk)).DocTag("<h2>/api/v2/2fa-get-more-dev-otk").Inputs([]*ymux.MuxInput{

func Handle2FASetup

func Handle2FASetup(www http.ResponseWriter, req *http.Request)

Handle2FASetup takes the email_token and returns the .PNG and the set of one-time-keys (OTK) to the client to display for the user.

func Handle2FAValidatePin

func Handle2FAValidatePin(www http.ResponseWriter, req *http.Request)
mux.Handle("/api/v2/2fa-validate-pin", http.HandlerFunc(Handle2FAValidatePin)).DocTag("<h2>/api/v2/2fa-setup").Inputs([]*ymux.MuxInput{
	   	  "username"		: g_username
		, "user_id"			: g_user_id
		, "pin2fa"			: $("#pin2fa").val()

func HandleAdminChangePassword

func HandleAdminChangePassword(www http.ResponseWriter, req *http.Request)

mux.Handle("/api/v2/admin-change-password", http.HandlerFunc(HandleChangePassword)).Method("GET", "POST").AuthRequired().NoDoc().Inputs([]*ymux.MuxInput{ change password - from an admin account. user_id has to be passed.

func HandleChangePassword

func HandleChangePassword(www http.ResponseWriter, req *http.Request)

mux.Handle("/api/v2/change-password", http.HandlerFunc(HandleChangePassword)).Method("GET", "POST").AuthRequired().NoDoc().Inputs([]*ymux.MuxInput{ change password

func HandleComplete2FASetup

func HandleComplete2FASetup(www http.ResponseWriter, req *http.Request)
mux.Handle("/api/v2/complete-2fa-setup", http.HandlerFunc(HandleComplete2FASetup)).DocTag("<h2>/api/v2/complete-2fa-setup").Inputs([]*ymux.MuxInput{
	{Name: "email_token", Required: true, Lable: "Email Token", MinLen: 1, Type: "s"},
	{Name: "callback", Required: false, Lable: "(optional) Callback", MinLen: 1, Type: "s"},
})

Purpose - set the "setup_2fa_complete" for this user to 'y'

func HandleConfirmEmail

func HandleConfirmEmail(www http.ResponseWriter, req *http.Request)

HandleConfirmEmail takes an email confirmation token and updates the user to mark that they have confirmed the email address.

Request Inputs:

token			Requred - and must not be expired.

func HandleCreateRegistrationToken

func HandleCreateRegistrationToken(www http.ResponseWriter, req *http.Request)
mux.Handle("/api/v2/create-registration-token", http.HandlerFunc(HandleCreateRegistrationToken)).DocTag("<h2>/api/v2/create-registration-token").NoDoc(setDocFlag).Inputs([]*ymux.MuxInput{
		{Name: "email_to", Required: true, Lable: "Email Adddress", MinLen: 1, Type: "s"},
	})

nfcauth=# \d t_ymux_registration_token

                    Table "public.t_ymux_registration_token"
Column  |            Type             | Collation | Nullable |      Default

---------+-----------------------------+-----------+----------+--------------------

id      | character varying(40)       |           | not null | uuid_generate_v4()
user_id | character varying(40)       |           |          |
token   | character varying(40)       |           | not null |
updated | timestamp without time zone |           |          |
created | timestamp without time zone |           | not null | CURRENT_TIMESTAMP

Indexes:

"t_ymux_registration_token_pkey" PRIMARY KEY, btree (id)
"t_ymux_registration_token_p1" btree (token)

Triggers:

t_ymux_registration_token_trig BEFORE UPDATE ON t_ymux_registration_token FOR EACH ROW EXECUTE PROCEDURE t_ymux_registration_token_upd()

func HandleDeleteDevUnPwOrTokenAcct

func HandleDeleteDevUnPwOrTokenAcct(www http.ResponseWriter, req *http.Request)

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

func HandleDevUnPwLogin

func HandleDevUnPwLogin(www http.ResponseWriter, req *http.Request)

HandleDevUnPwLogin is a login handler for dev-un-pw-acct types. It checks the username/password and if the hashed password matches then success is achieved. This type of an account will not use 2fa - so a jwt_token is returned. This is most likely aliased to /api/v2/token API end point.

This calls `PgGetUser` and that will call the stored procedure `c_login_user` to acces the database info on this user.

func HandleIs2FASetup

func HandleIs2FASetup(www http.ResponseWriter, req *http.Request)

HandleIs2FASetup will return success - this is for a call after registation to get the rest of login.

func HandleIsEmailUsed

func HandleIsEmailUsed(www http.ResponseWriter, req *http.Request)

func HandleIsPasswordValid

func HandleIsPasswordValid(www http.ResponseWriter, req *http.Request)

func HandleIsUsernameUsed

func HandleIsUsernameUsed(www http.ResponseWriter, req *http.Request)

func HandleLogin

func HandleLogin(www http.ResponseWriter, req *http.Request)

HandleLogin is a login handler. It checks the username/password and if the hashed password matches then success is achieved. If 2FA is enabled then this will not return a jwt_token. The 2fa device must be activated before the token is returned.

This calls `PgGetUser` and that will call the stored procedure `c_login_user` to acces the database info on this user.

func HandleLogin_v2

func HandleLogin_v2(www http.ResponseWriter, req *http.Request)

HandleLogin is a login handler. It checks the username/password and if the hashed password matches then success is achieved. If 2FA is enabled then this will not return a jwt_token. The 2fa device must be activated before the token is returned.

This calls `PgGetUser` and that will call the stored procedure `c_login_user_enc` to acces the database info on this user.

func HandleLogout

func HandleLogout(www http.ResponseWriter, req *http.Request)

HandleLogout is the server side of a logout operation. The `auth_token` is deleted. This will invalidate any JWT tokens that depend on it.

func HandleQRCodeGenerate

func HandleQRCodeGenerate(www http.ResponseWriter, req *http.Request)

func HandleQRCodeRawGenerate

func HandleQRCodeRawGenerate(www http.ResponseWriter, req *http.Request)

func HandleReValidateLogin

func HandleReValidateLogin(www http.ResponseWriter, req *http.Request)

mux.Handle("/api/v2/validate-login", http.HandlerFunc(HandleReValidateLogin)).DocTag("<h2>/api/v2/is-password-valid").NoDoc(setDocFlag).Inputs([]*ymux.MuxInput{ // xyzzy - re-validate a login and update (after 1 week)

func HandleRecoverPassword_pt1

func HandleRecoverPassword_pt1(www http.ResponseWriter, req *http.Request)

recover password pt1/pt2/pt3 Request Recovery Email, Set token and timeout in d.b.

func HandleRecoverPassword_pt2

func HandleRecoverPassword_pt2(www http.ResponseWriter, req *http.Request)

HandleRecoverPassword_pt2 takes you to the page with the input boxes for the new password.

func HandleRecoverPassword_pt3

func HandleRecoverPassword_pt3(www http.ResponseWriter, req *http.Request)

Using Token - and new password - update password, Send email that it is being changed gCfg.RecoverPW_pt3_URI

func HandleRegister

func HandleRegister(www http.ResponseWriter, req *http.Request)

HandleRegister registered a new user.

Request Inputs:

username
password
again
real_name
email

Debug Flag: "HandleRegister"

func HandleRegisterDevUnPw

func HandleRegisterDevUnPw(www http.ResponseWriter, req *http.Request)

func HandleRegisterTokenUser

func HandleRegisterTokenUser(www http.ResponseWriter, req *http.Request)

HandleRegisterTokenUser

Description: Create an account that logins with a single token. The only identificaiton for the account is the token. The token should be kept secret - it is the password.

Request Inputs:

user_id is form the login/authenciation JWT token and can not be passed in.
app_name is a user specificad application name string - it serves to identify the account but is not used in the login process to the account.

func HandleStatus

func HandleStatus(www http.ResponseWriter, req *http.Request)

HandleStatus - server to respond with a working message if up.

func HaveCookie

func HaveCookie(www http.ResponseWriter, req *http.Request, cookieName string) bool

func NewAuthCheckerHandler

func NewAuthCheckerHandler(handler http.Handler, mux *ymux.ServeMux, out io.Writer, cfg *ymux.BaseConfigType) http.Handler

NewAuthCheckerHandler returns a new http.Handler that checks authenticaiton.

func PgCreateNewAuthTokenForUser

func PgCreateNewAuthTokenForUser(user_id string) (auth_token string, err error)

claims["auth_token"] = PgCreateNewAuthTokenForUser ( user_id )

func PgCreateNewAuthTokenUser

func PgCreateNewAuthTokenUser(www http.ResponseWriter, req *http.Request, realm, un, pw, real_name, email_addr, parent_user_id string) (user_id, raw string, err error)

func PgCreateNewUser

func PgCreateNewUser(www http.ResponseWriter, req *http.Request, realm, un, pw, real_name, email_addr, registration_token string) (user_id, email_recovery_token, auth_token, setup_2fa_token, raw, qr_id string, err error)

func PgCreateNewUser(www http.ResponseWriter, req *http.Request, realm, un, pw, real_name, email_addr string) (user_id, email_recovery_token, auth_token, setup_2fa_token, raw string, qq ymux.QRMsGetQrDataType, err error) {

func PgCreateNewUserDevUnPw

func PgCreateNewUserDevUnPw(www http.ResponseWriter, req *http.Request, realm, un, pw, real_name, email_addr, parent_user_id string) (user_id, raw string, err error)

func PgFinializeUser

func PgFinializeUser(user_id string)

func PgGetUser

func PgGetUser(www http.ResponseWriter, req *http.Request, realm, un, pw string) (userID, auth_token, raw string, err error)

func PgGetUserDevUnPw

func PgGetUserDevUnPw(www http.ResponseWriter, req *http.Request, realm, un, pw string) (userID, auth_token, raw string, err error)

user_id, auth_token, raw, err := PgGetUserDevUnPw(www, req, gCfg.AuthRealm, un, pw)

func PgGetUserFromAuthToken

func PgGetUserFromAuthToken(www http.ResponseWriter, req *http.Request, realm, auth_token, pw string) (userID, un, real_name, emailaddr string, err error)

user_id, un, err := PgGetUserFromAuthToken(www, req, gCfg.AuthRealm, auth_token, old_pw)

func PgGetUserFromEmailAddr

func PgGetUserFromEmailAddr(www http.ResponseWriter, req *http.Request, email string) (user_id, un, real_name, emailaddr string, err error)

PgGetUserFromEmailAddr looks up a user and returns information on that user iff the user is email_conirmed and if 2fa setup in use and complete.

func PgGetUserFromRecoveryToken

func PgGetUserFromRecoveryToken(www http.ResponseWriter, req *http.Request, realm, token string) (userID, un, real_name, emailaddr string, err error)

user_id, un, err := PgGetUserFromAuthToken(www, req, gCfg.AuthRealm, auth_token, old_pw)

func PgUpdateUserPassword

func PgUpdateUserPassword(www http.ResponseWriter, req *http.Request, realm, user_id, un, pw string) (err error)

func QRCodeSaveToRedis

func QRCodeSaveToRedis(qr_id, un, user_id, secret string)

QRCodeSaveToRedis will push the QR data to redis with TTL

func SetCookie

func SetCookie(www http.ResponseWriter, req *http.Request, cookieName, value string, expireInDays int)

func SetJsonHdr

func SetJsonHdr(www http.ResponseWriter, req *http.Request)

func SetJsonPHdr

func SetJsonPHdr(www http.ResponseWriter, req *http.Request)

func SetRedisSesionState

func SetRedisSesionState(key, data string)

SetRedisSesionState Sets `key` to value `data` in redis.

func SetSecureCookie

func SetSecureCookie(www http.ResponseWriter, req *http.Request, cookieName, value string, expireInDays int)

func Setup

func Setup(gcfg *ymux.BaseConfigType, dbf map[string]bool, f *os.File, base string, gitCommit string)

func SetupCall

func SetupCall()

func SetupMux

func SetupMux(mux *ymux.ServeMux)

func SetupNoDoc

func SetupNoDoc(b bool)

true turns off documents

func SetupProcCheck

func SetupProcCheck()

func Sha1String

func Sha1String(s string) []byte

Sha1String takes the sha1 has of a string and returns it.

func TestSetLogFilePtr

func TestSetLogFilePtr()

func UpdateTOMarkAs2faSetup

func UpdateTOMarkAs2faSetup(user_id, secret string) (err error)

update user to mark as 2fa Setup complete

Types

type AuthCheckHandler

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

func (*AuthCheckHandler) IsAuthRequired

func (h *AuthCheckHandler) IsAuthRequired(www http.ResponseWriter, req *http.Request) (bool, []string)

IsAuthRequired will return true if the mux has AuthRequired set to true.

func (*AuthCheckHandler) ServeHTTP

func (h *AuthCheckHandler) ServeHTTP(www http.ResponseWriter, req *http.Request)

ServeHTTP is a standard http.Handler that checks to see if this path requires authentication. If authentication is required then it is checked before going to the next layer down.

type CCreateAuthTokenUser

type CCreateAuthTokenUser struct {
	Status  string
	Success *CCreateAuthTokenUserSuccess
	Error   *CCreateAuthTokenUserError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCCreateAuthTokenUser

func CallCCreateAuthTokenUser(plist ...interface{}) (TyRet CCreateAuthTokenUser, err error)

CallCCreateAuthTokenUser calls c_create_auth_token_user stored procedure and returns typed data.

type CCreateAuthTokenUserEnc

type CCreateAuthTokenUserEnc struct {
	Status  string
	Success *CCreateAuthTokenUserEncSuccess
	Error   *CCreateAuthTokenUserEncError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCCreateAuthTokenUserEnc

func CallCCreateAuthTokenUserEnc(plist ...interface{}) (TyRet CCreateAuthTokenUserEnc, err error)

CallCCreateAuthTokenUserEnc calls c_create_auth_token_user_enc stored procedure and returns typed data.

type CCreateAuthTokenUserEncError

type CCreateAuthTokenUserEncError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CCreateAuthTokenUserEncSuccess

type CCreateAuthTokenUserEncSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	AuthToken           string `json:"auth_token"`
	Setup2FaToken       string `json:"setup_2fa_token"`
	X2FaId              string `json:"x2fa_id"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CCreateAuthTokenUserError

type CCreateAuthTokenUserError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CCreateAuthTokenUserSuccess

type CCreateAuthTokenUserSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	AuthToken           string `json:"auth_token"`
	Setup2FaToken       string `json:"setup_2fa_token"`
	X2FaId              string `json:"x2fa_id"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CCreateDevUnPwUser

type CCreateDevUnPwUser struct {
	Status  string
	Success *CCreateDevUnPwUserSuccess
	Error   *CCreateDevUnPwUserError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCCreateDevUnPwUser

func CallCCreateDevUnPwUser(plist ...interface{}) (TyRet CCreateDevUnPwUser, err error)

CallCCreateDevUnPwUser calls c_create_dev_un_pw_user stored procedure and returns typed data.

type CCreateDevUnPwUserEnc

type CCreateDevUnPwUserEnc struct {
	Status  string
	Success *CCreateDevUnPwUserEncSuccess
	Error   *CCreateDevUnPwUserEncError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCCreateDevUnPwUserEnc

func CallCCreateDevUnPwUserEnc(plist ...interface{}) (TyRet CCreateDevUnPwUserEnc, err error)

CallCCreateDevUnPwUserEnc calls c_create_dev_un_pw_user_enc stored procedure and returns typed data.

type CCreateDevUnPwUserEncError

type CCreateDevUnPwUserEncError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CCreateDevUnPwUserEncSuccess

type CCreateDevUnPwUserEncSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	AuthToken           string `json:"auth_token"`
	Setup2FaToken       string `json:"setup_2fa_token"`
	X2FaId              string `json:"x2fa_id"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CCreateDevUnPwUserError

type CCreateDevUnPwUserError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CCreateDevUnPwUserSuccess

type CCreateDevUnPwUserSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	AuthToken           string `json:"auth_token"`
	Setup2FaToken       string `json:"setup_2fa_token"`
	X2FaId              string `json:"x2fa_id"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CGetConfig

type CGetConfig struct {
	Status  string
	Success *CGetConfigSuccess
	Raw     string
	MapOf   map[string]interface{}
}

func CallCGetConfig

func CallCGetConfig(plist ...interface{}) (TyRet CGetConfig, err error)

CallCGetConfig calls c_get_config stored procedure and returns typed data.

type CGetConfigSuccess

type CGetConfigSuccess struct {
}

type CLoginUser

type CLoginUser struct {
	Status  string
	Success *CLoginUserSuccess
	Error   *CLoginUserError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCLoginUser

func CallCLoginUser(plist ...interface{}) (TyRet CLoginUser, err error)

CallCLoginUser calls c_login_user stored procedure and returns typed data.

type CLoginUserEnc

type CLoginUserEnc struct {
	Status  string
	Success *CLoginUserEncSuccess
	Error   *CLoginUserEncError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCLoginUserEnc

func CallCLoginUserEnc(plist ...interface{}) (TyRet CLoginUserEnc, err error)

CallCLoginUserEnc calls c_login_user_enc stored procedure and returns typed data.

func PgGetUser_v2

func PgGetUser_v2(www http.ResponseWriter, req *http.Request, realm, un, pw string) (Ty CLoginUserEnc, err error)

type CLoginUserEncError

type CLoginUserEncError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CLoginUserEncSuccess

type CLoginUserEncSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	EmailConfirmed      string `json:"email_confirmed"`
	Email               string `json:"email"`
	RealName            string `json:"real_name"`
	Pwh                 string `json:"pwh"`
	Salt                string `json:"salt"`
	AuthToken           string `json:"auth_token"`
	AcctType            string `json:"acct_type"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
	RFC6238Secret       string `json:"RFC6238Secret"`
}

type CLoginUserError

type CLoginUserError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CLoginUserSuccess

type CLoginUserSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	EmailConfirmed      string `json:"email_confirmed"`
	Email               string `json:"email"`
	RealName            string `json:"real_name"`
	Pwh                 string `json:"pwh"`
	Salt                string `json:"salt"`
	AuthToken           string `json:"auth_token"`
	AcctType            string `json:"acct_type"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
	RFC6238Secret       string `json:"RFC6238Secret"`
}

type CRandomString

type CRandomString struct {
	Status  string
	Success *CRandomStringSuccess
	Error   *CRandomStringError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCRandomString

func CallCRandomString(plist ...interface{}) (TyRet CRandomString, err error)

CallCRandomString calls c_random_string stored procedure and returns typed data.

type CRandomStringError

type CRandomStringError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CRandomStringSuccess

type CRandomStringSuccess struct {
	Status      string `json:"status"`
	RandomValue string `json:"random_value"`
}

type CRegisterUser

type CRegisterUser struct {
	Status  string
	Success *CRegisterUserSuccess
	Error   *CRegisterUserError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCRegisterUser

func CallCRegisterUser(plist ...interface{}) (TyRet CRegisterUser, err error)

CallCRegisterUser calls c_register_user stored procedure and returns typed data.

type CRegisterUserEnc

type CRegisterUserEnc struct {
	Status  string
	Success *CRegisterUserEncSuccess
	Error   *CRegisterUserEncError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCRegisterUserEnc

func CallCRegisterUserEnc(plist ...interface{}) (TyRet CRegisterUserEnc, err error)

CallCRegisterUserEnc calls c_register_user_enc stored procedure and returns typed data.

type CRegisterUserEncError

type CRegisterUserEncError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CRegisterUserEncSuccess

type CRegisterUserEncSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	AuthToken           string `json:"auth_token"`
	Setup2FaToken       string `json:"setup_2fa_token"`
	X2FaId              string `json:"x2fa_id"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CRegisterUserError

type CRegisterUserError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CRegisterUserSuccess

type CRegisterUserSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	AuthToken           string `json:"auth_token"`
	Setup2FaToken       string `json:"setup_2fa_token"`
	X2FaId              string `json:"x2fa_id"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CSetup2FaTables

type CSetup2FaTables struct {
	Status  string
	Success *CSetup2FaTablesSuccess
	Error   *CSetup2FaTablesError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCSetup2FaTables

func CallCSetup2FaTables(plist ...interface{}) (TyRet CSetup2FaTables, err error)

CallCSetup2FaTables calls c_setup_2fa_tables stored procedure and returns typed data.

type CSetup2FaTablesError

type CSetup2FaTablesError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CSetup2FaTablesSuccess

type CSetup2FaTablesSuccess struct {
	Status string `json:"status"`
}

type CValidate2FaPin

type CValidate2FaPin struct {
	Status  string
	Success *CValidate2FaPinSuccess
	Error   *CValidate2FaPinError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCValidate2FaPin

func CallCValidate2FaPin(plist ...interface{}) (TyRet CValidate2FaPin, err error)

CallCValidate2FaPin calls c_validate_2fa_pin stored procedure and returns typed data.

type CValidate2FaPinEnc

type CValidate2FaPinEnc struct {
	Status  string
	Success *CValidate2FaPinEncSuccess
	Error   *CValidate2FaPinEncError
	Raw     string
	MapOf   map[string]interface{}
}

func CallCValidate2FaPinEnc

func CallCValidate2FaPinEnc(plist ...interface{}) (TyRet CValidate2FaPinEnc, err error)

CallCValidate2FaPinEnc calls c_validate_2fa_pin_enc stored procedure and returns typed data.

type CValidate2FaPinEncError

type CValidate2FaPinEncError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CValidate2FaPinEncSuccess

type CValidate2FaPinEncSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	FoundOtk            string `json:"found_otk"`
	Secret              string `json:"secret"`
	AuthToken           string `json:"auth_token"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type CValidate2FaPinError

type CValidate2FaPinError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type CValidate2FaPinSuccess

type CValidate2FaPinSuccess struct {
	Status              string `json:"status"`
	UserId              string `json:"user_id"`
	FoundOtk            string `json:"found_otk"`
	Secret              string `json:"secret"`
	AuthToken           string `json:"auth_token"`
	Auth2FaEnabled      string `json:"Auth2faEnabled"`
	AuthLoginOnRegister string `json:"AuthLoginOnRegister"`
	AuthEmailConfirm    string `json:"AuthEmailConfirm"`
}

type QRData

type QRData struct {
	QRUrl    string
	UserID   string
	Username string
	Secret   string
}

func QRCodeGetFromRedis

func QRCodeGetFromRedis(qr_id string) (rv QRData)

QRCodeGetFromRedis fetches back the data from Redis for the specified qr_id. Data is parsed and returned.

type SCheckPriv

type SCheckPriv struct {
	Status  string
	Success *SCheckPrivSuccess
	Error   *SCheckPrivError
	Raw     string
	MapOf   map[string]interface{}
}

func CallSCheckPriv

func CallSCheckPriv(plist ...interface{}) (TyRet SCheckPriv, err error)

CallSCheckPriv calls s_check_priv stored procedure and returns typed data.

type SCheckPrivError

type SCheckPrivError struct {
	Status     string `json:"status"`
	Msg        string `json:"msg"`
	Code       string `json:"code"`
	StatusCode int    `json:"status_code"`
	At         string `json:"at"`
}

type SCheckPrivSuccess

type SCheckPrivSuccess struct {
	Status string `json:"status"`
	HasPiv string `json:"has_piv"`
}

Jump to

Keyboard shortcuts

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