logs

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MPL-2.0, MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 InitStore

func InitStore(con *global.State)

InitStore initialises package state

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 NewEmptyLog(sType string) AuthLog

func NewLog

func NewLog(r *http.Request, sType string) AuthLog

func (*AuthLog) UpdateAddr

func (l *AuthLog) UpdateAddr(addr net.Addr)

func (*AuthLog) UpdateIP

func (l *AuthLog) UpdateIP(ip string)

func (*AuthLog) UpdateService

func (l *AuthLog) UpdateService(service *models.Service)

func (*AuthLog) UpdateUser

func (l *AuthLog) UpdateUser(user *models.UserWithPass)

Jump to

Keyboard shortcuts

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