audit

package
v25.0.0-custom-qt-impr... Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeTypeAlpha = "alpha"
	NodeTypeZero  = "zero"
)
View Source
const (
	UnauthorisedUser = "UnauthorisedUser"
	UnknownUser      = "UnknownUser"
	UnknownNamespace = math.MaxUint64
	PoorManAuth      = "PoorManAuth"
	Grpc             = "Grpc"
	Http             = "Http"
	WebSocket        = "Websocket"
)

Variables

View Source
var CmdAudit x.SubCommand

Functions

func AuditRequestGRPC

func AuditRequestGRPC(ctx context.Context, req interface{},
	info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func AuditRequestHttp

func AuditRequestHttp(next http.Handler) http.Handler

func AuditWebSockets

func AuditWebSockets(ctx context.Context, req *schema.Request)

func Close

func Close()

Close stops the ticker and sync the pending logs in buffer. It also sets the log to nil, because its being called by zero when license expires. If license added, InitLogger will take care of the file.

func GetAuditConf

func GetAuditConf(conf string) *x.LoggerConf

func InitAuditor

func InitAuditor(conf *x.LoggerConf, gId, nId uint64) error

InitAuditor initializes the auditor.

func InitAuditorIfNecessary

func InitAuditorIfNecessary(conf *x.LoggerConf) error

InitAuditorIfNecessary accepts conf and initialized auditor.

Types

type AuditEvent

type AuditEvent struct {
	User        string
	Namespace   uint64
	ServerHost  string
	ClientHost  string
	Endpoint    string
	ReqType     string
	Req         string
	Status      string
	QueryParams map[string][]string
}

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *ResponseWriter

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(code int)

Jump to

Keyboard shortcuts

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