audit

package
v25.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 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 AuditStreamGRPC added in v25.3.5

func AuditStreamGRPC(srv interface{}, ss grpc.ServerStream,
	info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

AuditStreamGRPC audits streaming RPCs on the public gRPC service, mirroring AuditRequestGRPC for unary calls. Streaming RPCs previously bypassed all interceptors, so any auth or audit had to be wired by hand inside each handler. Routing them through here gives every current and future streaming RPC the same audit treatment by default.

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