audit

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1"

Version - represents the current version of audit log structure.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Version      string    `json:"version"`
	DeploymentID string    `json:"deploymentid,omitempty"`
	Time         time.Time `json:"time"`
	Trigger      string    `json:"trigger"`
	API          struct {
		Path            string `json:"path,omitempty"`
		Status          string `json:"status,omitempty"`
		Method          string `json:"method"`
		StatusCode      int    `json:"statusCode,omitempty"`
		InputBytes      int64  `json:"rx"`
		OutputBytes     int64  `json:"tx"`
		TimeToFirstByte string `json:"timeToFirstByte,omitempty"`
		TimeToResponse  string `json:"timeToResponse,omitempty"`
	} `json:"api"`
	RemoteHost string                 `json:"remotehost,omitempty"`
	RequestID  string                 `json:"requestID,omitempty"`
	SessionID  string                 `json:"sessionID,omitempty"`
	UserAgent  string                 `json:"userAgent,omitempty"`
	ReqClaims  map[string]interface{} `json:"requestClaims,omitempty"`
	ReqQuery   map[string]string      `json:"requestQuery,omitempty"`
	ReqHeader  map[string]string      `json:"requestHeader,omitempty"`
	RespHeader map[string]string      `json:"responseHeader,omitempty"`
	Tags       map[string]interface{} `json:"tags,omitempty"`
}

Entry - audit entry logs.

func NewEntry

func NewEntry(deploymentID string) Entry

NewEntry - constructs an audit entry object with some fields filled

func ToEntry

func ToEntry(w http.ResponseWriter, r *http.Request, reqClaims map[string]interface{}, deploymentID string) Entry

ToEntry - constructs an audit entry from a http request

type ObjectVersion

type ObjectVersion struct {
	ObjectName string `json:"objectName"`
	VersionID  string `json:"versionId,omitempty"`
}

ObjectVersion object version key/versionId

Jump to

Keyboard shortcuts

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