Documentation ¶
Index ¶
- func CreateJWTToken(user *repo.DataModel) string
- func NewConfiguration(manager *scs.SessionManager, repo *repo.DBRepo)
- type AppConf
- func (conf *AppConf) CheckStatusHandler(w http.ResponseWriter, r *http.Request)
- func (conf *AppConf) EnableCORS(next http.Handler) http.Handler
- func (conf *AppConf) GetAndCheckHmacToken(w http.ResponseWriter, r *http.Request)
- func (conf *AppConf) LoadSession(next http.Handler) http.Handler
- func (conf *AppConf) ParseJWTToken(w http.ResponseWriter, r *http.Request)
- func (conf *AppConf) SaveHmacToken(w http.ResponseWriter, r *http.Request)
- func (conf *AppConf) SaveJWTToken(w http.ResponseWriter, r *http.Request)
- func (conf *AppConf) SignWithHmac(userMail string, key string) (string, error)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJWTToken ¶
CreateJWTToken a helper function for creating JWT token
func NewConfiguration ¶
NewConfiguration use for creating a new configuration for our handlers
Types ¶
type AppConf ¶
type AppConf struct { ScsManager *scs.SessionManager DRepo *repo.DBRepo HashFunction func() hash.Hash }
var Conf *AppConf
func (*AppConf) CheckStatusHandler ¶
func (conf *AppConf) CheckStatusHandler(w http.ResponseWriter, r *http.Request)
CheckStatusHandler just for checking the API handlers
func (*AppConf) EnableCORS ¶
EnableCORS use for enabling cors for the client
func (*AppConf) GetAndCheckHmacToken ¶
func (conf *AppConf) GetAndCheckHmacToken(w http.ResponseWriter, r *http.Request)
GetAndCheckHmacToken use for getting and checking the HMAC token that we store it in cookies
func (*AppConf) LoadSession ¶
LoadSession use for loading and saving user session in client
func (*AppConf) ParseJWTToken ¶
func (conf *AppConf) ParseJWTToken(w http.ResponseWriter, r *http.Request)
ParseJWTToken use for parsing JWT token with claims
func (*AppConf) SaveHmacToken ¶
func (conf *AppConf) SaveHmacToken(w http.ResponseWriter, r *http.Request)
SaveHmacToken use for saving HMAC token based on sha hash functions for user
func (*AppConf) SaveJWTToken ¶
func (conf *AppConf) SaveJWTToken(w http.ResponseWriter, r *http.Request)
SaveJWTToken use for store JWT token in scs.Session
Click to show internal directories.
Click to hide internal directories.