Documentation
¶
Index ¶
- Variables
- func DoGet(uri string, args ...string) (status int, rv string)
- func GenRandBytes(nRandBytes int) (buf []byte, err error)
- func GenRandBytesOracle() (buf []byte, ttl, epoc int, err error)
- func GenRandNumber(nDigits int) (buf string, err error)
- func IsValid2fa(hdlr *X2faType, rw *goftlmux.MidBuffer, www http.ResponseWriter, ...)
- type RanData
- type RedisData
- type X2faType
- func (hdlr *X2faType) Get2MinHashFunc() (hash string, ttlLeft int, err error)
- func (hdlr *X2faType) GetPerDeviceHash(user_id, t2faId string) (user_hash, fp string, err error)
- func (hdlr *X2faType) GetUserIDFromAuthToken(auth_token string) (user_id string, err error)
- func (hdlr *X2faType) GetValidList(user_id string) (list []string, err error)
- func (hdlr *X2faType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error)
- func (hdlr *X2faType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error)
- func (hdlr *X2faType) PullQRFromDB(tag string) (qr_enc_id string, err error)
- func (hdlr *X2faType) PullQRURLFromDB() (qr_enc_id, qr_url string, err error)
- func (hdlr *X2faType) ServeHTTP(www http.ResponseWriter, req *http.Request)
- func (hdlr *X2faType) UpdateQRMarkAsUsed(qrId string) error
Constants ¶
This section is empty.
Variables ¶
var FirstRequest bool = true
============================================================================================================================================
var LastResut []byte
var ThisEpoc int
var TimeRemain int
Functions ¶
func DoGet ¶
Modified to send Header!
--------------------------------------------- // Xyzzy101 - Setup QR Redirect ---------------------------------------------
export QR_SHORT_AUTH_TOKEN="w4h0wvtb1zk4uf8Xv.Ns9Q7j8" wget -o out/,list1 -O out/,list2 \ --header "X-Qr-Auth: ${QR_SHORT_AUTH_TOKEN}" \ "http://t432z.com/upd/?url=http://test.test.com&id=5c" -- 1. DoGet - change to create a header -- 2. Example Call to set this
func GenRandBytes ¶
============================================================================================================================================ Should move to aesccm package
func GenRandBytesOracle ¶
============================================================================================================================================ Should move to aesccm package
func GenRandNumber ¶
Generate a random number, 0..N, returned as a string with 6 to 8 non-zero digits.
Types ¶
type X2faType ¶
type X2faType struct { Next http.Handler // Paths []string // RedisPrefix string // TemplatePath string // 1stRedirct.tmpl QRPath string // QRURLPath string // DisplayURL string // URL of the 2fa Appliation TimeoutCodes int // duration for a hash value stored in redis (2-min hash) - how long a "code" is valid for. In seconds. AuthKey string // Server2faURL string // http://t432z.com LineNo int // // contains filtered or unexported fields }
func NewX2faTypeServer ¶
NewX2faTypeServer will create a copy of the server for testing.
func (*X2faType) Get2MinHashFunc ¶
func (*X2faType) GetPerDeviceHash ¶
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
func (*X2faType) GetUserIDFromAuthToken ¶
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
func (*X2faType) GetValidList ¶
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ GetValidList get list of convened to string int values for valid 2fa
func (*X2faType) InitializeWithConfigData ¶
func (*X2faType) PreValidate ¶
func (*X2faType) PullQRFromDB ¶
err = hdlr.PullQRFromDB(rr.Tag)
func (*X2faType) PullQRURLFromDB ¶
err = hdlr.PullQRFromDB(rr.Tag)
func (*X2faType) ServeHTTP ¶
func (hdlr *X2faType) ServeHTTP(www http.ResponseWriter, req *http.Request)