entities

package
v0.0.0-...-bc5d933 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToken

func NewToken(secret string, user User) (string, error)

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims
	UserID    string `json:"user_id,omitempty"`
	UserEmail string `json:"user_email,omitempty"`
}

func ValidateToken

func ValidateToken(tokenString string, secret string) (Claims, bool, error)

type Event

type Event struct {
	ID        string         `json:"id,omitempty"`
	OwnerID   string         `json:"ownerID,omitempty"`
	Payload   string         `json:"payload,omitempty"`
	DstPort   int            `json:"dstPort,omitempty"`   // the connection destination port
	Rule      string         `json:"rule,omitempty"`      // the rule that matched the connection
	Handler   string         `json:"handler,omitempty"`   // the processing handler
	Transport string         `json:"transport,omitempty"` // the transport used
	Scanner   string         `json:"scanner,omitempty"`   // name of the scanner if detected
	SensorID  string         `json:"sensorID,omitempty"`  // the id of the sensor
	SrcHost   string         `json:"srcHost,omitempty"`   // the source IP address
	SrcPort   string         `json:"srcPort,omitempty"`   // the source port
	Timestamp string         `json:"timestamp,omitempty"` // the UTC timestamp of the connection
	Decoded   types.JSONText `json:"decoded,omitempty"`   // a decoded version of the payload if available
}

type Query

type Query struct {
	ID          string `json:"id,omitempty"`
	Content     string `json:"content,omitempty"`
	OwnerID     string `json:"owner_id,omitempty"`
	Active      bool   `json:"active"` // TODO: currently unused
	Description string `json:"description,omitempty"`
}

type User

type User struct {
	ID    string `json:"id,omitempty"`
	Email string `json:"email,omitempty"`
}

Jump to

Keyboard shortcuts

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