Documentation
¶
Index ¶
- Variables
- func GetAllInAppTrails(w http.ResponseWriter, r *http.Request)
- func GetLiveSessions(params models.ConnectionParams, uc models.UserContext, ws *websocket.Conn)
- func GetLoginEvents(w http.ResponseWriter, r *http.Request)
- func GetLoginEventsByPage(w http.ResponseWriter, r *http.Request)
- func GetRawLog(w http.ResponseWriter, r *http.Request)
- func GetVideoLog(w http.ResponseWriter, r *http.Request)
- func InitStore(con *global.State)
- func InitStoreMock() *logsMock
- type ActiveSession
- type AuthLog
Constants ¶
This section is empty.
Variables ¶
var Store adapter
Store is the package state variable which contains database connections
Functions ¶
func GetAllInAppTrails ¶
func GetAllInAppTrails(w http.ResponseWriter, r *http.Request)
GetAllInAppTrails returns all inapp trails
func GetLiveSessions ¶
func GetLiveSessions(params models.ConnectionParams, uc models.UserContext, ws *websocket.Conn)
GetLiveSessions serves live sessions through web socket
func GetLoginEvents ¶
func GetLoginEvents(w http.ResponseWriter, r *http.Request)
GetLoginEvents returns every loging events (failed and passed) with detailed log values. we can either check for idor here or query elasticsearch with both orgID and serviceID. opting to check idor here based on orgID.
func GetLoginEventsByPage ¶
func GetLoginEventsByPage(w http.ResponseWriter, r *http.Request)
GetLoginEventsByPage returns login events with pagination
func GetRawLog ¶
func GetRawLog(w http.ResponseWriter, r *http.Request)
GetRawLog returns recorded text log of a certain session
func GetVideoLog ¶
func GetVideoLog(w http.ResponseWriter, r *http.Request)
GetVideoLog serves recorded video log of a certain session
func InitStoreMock ¶
func InitStoreMock() *logsMock
InitStoreMock will init mock state of this package
Types ¶
type ActiveSession ¶
type ActiveSession struct { ConnID string `json:"connID"` ServiceName string `json:"serviceName"` ServiceType string `json:"serviceType"` ServiceID string `json:"serviceID"` ServerIP string `json:"serverIP"` Email string `json:"email"` LoginTime int64 `json:"loginTime"` UserAgent string `json:"userAgent"` Privilege string `json:"privilege"` UserIP string `json:"userIP"` }
ActiveSession is a struct which represents data stored in redis as active session
type AuthLog ¶
type AuthLog struct { EventID string `json:"eventID"` SessionID string `json:"sessionID"` OrgID string `json:"orgID"` ServiceName string `json:"serviceName"` ServiceID string `json:"serviceID"` ServiceType string `json:"serviceType"` ServerIP string `json:"serverIP"` Privilege string `json:"privilege"` Email string `json:"email"` UserID string `json:"userID"` UserAgent string `json:"userAgent"` AccessDeviceID string `json:"accessDeviceID"` TfaDeviceID string `json:"tfaDeviceID"` BrowserID string `json:"browserID"` DeviceType string `json:"deviceType"` UserIP string `json:"userIP"` GeoLocation models.GeoLocation `json:"geoLocation"` Status bool `json:"status"` LoginTime int64 `json:"loginTime"` LogoutTime int64 `json:"logoutTime"` SessionDuration string `json:"sessionDuration"` SessionRecord bool `json:"sessionRecord"` FailedReason consts.FailedReason `json:"failedReason"` Guests []string `json:"guests"` }
TODO Move this to models
func NewEmptyLog ¶
func (*AuthLog) UpdateAddr ¶
func (*AuthLog) UpdateService ¶
func (*AuthLog) UpdateUser ¶
func (l *AuthLog) UpdateUser(user *models.UserWithPass)