Documentation ¶
Index ¶
- Variables
- func AddUserInfo(userInfo *auth.UserInfo) error
- func CheckUserExist(user string) *auth.UserInfo
- func InitBatchRepository(dbRef *common.Reference, dbPassword, tablename string)
- func InitStoreInfo(ref *common.Reference, password, tablename string)
- func InitUserInfo(ref *common.Reference, password, tablename string)
- func QueryUser(user string) *auth.UserInfo
- type BatchEntry
- type Context
- func (sc *Context) AddRoles(r []string)
- func (sc *Context) Deadline() (deadline time.Time, ok bool)
- func (sc *Context) Done() <-chan struct{}
- func (sc *Context) Err() error
- func (sc *Context) GetData(key string) any
- func (sc *Context) Name() string
- func (sc *Context) Remote() string
- func (sc *Context) Roles() []string
- func (sc *Context) SendAuditError(started time.Time, err error)
- func (sc *Context) Session() interface{}
- func (sc *Context) SetRemote(r string)
- func (sc *Context) SetSession(s interface{})
- func (sc *Context) StoreData(key string, value any)
- func (sc *Context) UUID() string
- func (sc *Context) UserName() string
- func (sc *Context) Value(key any) any
- type StoreJWTHandler
- func (st *StoreJWTHandler) InvalidateUUID(uuid string, elapsed time.Time) bool
- func (st *StoreJWTHandler) Range(f func(uuid, value any) bool) error
- func (st *StoreJWTHandler) Store(principal auth.PrincipalInterface, user, pass string) (err error)
- func (st *StoreJWTHandler) UUIDInfo(uuid string) (*auth.SessionInfo, error)
- func (st *StoreJWTHandler) ValidateUUID(claims *auth.JWTClaims) (auth.PrincipalInterface, bool)
Constants ¶
This section is empty.
Variables ¶
Audit callback function to be enabled
var DeleteUUID = false
DeleteUUID delete UUID after regular time frame
Functions ¶
func AddUserInfo ¶
AddUserInfo add user if not already exists and create if not available
func CheckUserExist ¶
CheckUserExist check user already exists and create if not available
func InitBatchRepository ¶
InitBatchRepository init batch repository
func InitStoreInfo ¶
InitStoreInfo init session info storage
func InitUserInfo ¶
InitUserInfo init user info evaluation
Types ¶
type BatchEntry ¶
BatchEntry entry of batch repository
func BatchSelect ¶
func BatchSelect(batchname string) (*BatchEntry, error)
BatchSelect search for batchname in an batch repository
type Context ¶
type Context struct { User *auth.UserInfo // User string Pass string Auth struct { Roles []string Remote string Session interface{} } Token string CurrentRequest *http.Request // contains filtered or unexported fields }
Context server context
func NewContext ¶
NewContext new server context with user and password
func NewContextUserInfo ¶
NewContextUserInfo new server context with user information and password
func (*Context) SendAuditError ¶
SendAuditError send audit error in context
func (*Context) Session ¶
func (sc *Context) Session() interface{}
Session session info interface function
func (*Context) SetSession ¶
func (sc *Context) SetSession(s interface{})
SetSession set session info interface function
type StoreJWTHandler ¶
type StoreJWTHandler struct { }
StoreJWTHandler store session in a database store
func (*StoreJWTHandler) InvalidateUUID ¶
func (st *StoreJWTHandler) InvalidateUUID(uuid string, elapsed time.Time) bool
InvalidateUUID invalidate UUID entry and given elapsed time
func (*StoreJWTHandler) Range ¶
func (st *StoreJWTHandler) Range(f func(uuid, value any) bool) error
Range go through all session entries
func (*StoreJWTHandler) Store ¶
func (st *StoreJWTHandler) Store(principal auth.PrincipalInterface, user, pass string) (err error)
Store store entry for given input
func (*StoreJWTHandler) UUIDInfo ¶
func (st *StoreJWTHandler) UUIDInfo(uuid string) (*auth.SessionInfo, error)
UUIDInfo get UUID info User information
func (*StoreJWTHandler) ValidateUUID ¶
func (st *StoreJWTHandler) ValidateUUID(claims *auth.JWTClaims) (auth.PrincipalInterface, bool)
ValidateUUID validate JWT claims are in UUID session list