Help us shape the future of Go! Take the 2026 Go Developer Survey

security

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package security defines the security event dispatched for every security-relevant decision (failed logins, denied authorization, CSRF rejections, rate limits, invalid signatures). Subscribe to alert:

events.Listen(app.Events, func(ctx context.Context, e security.Event) error {
	if e.Name == "auth.login_failed" { ... }
	return nil
})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name      string         `json:"name"`
	At        time.Time      `json:"at"`
	Method    string         `json:"method"`
	Path      string         `json:"path"`
	IP        string         `json:"ip"`
	RequestID string         `json:"request_id,omitempty"`
	Attrs     map[string]any `json:"attrs,omitempty"`
}

Event describes one security event. Attrs never contain secrets.

Jump to

Keyboard shortcuts

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