audit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ClientIPHeader         = "X-Zapgate-Client-Ip"
	ResultOK               = "ok"
	ResultError            = "error"
	ResultInputRequired    = "input_required"
	ResultDeclined         = "declined"
	ReasonMissing          = "missing"
	ReasonInvalid          = "invalid"
	ActionTokenCreate      = "token_create"
	ActionAccessRevoke     = "access_revoke"
	ActionAccessSet        = "access_set"
	ActionAccountAdd       = "account_add"
	ActionAccountDescribe  = "account_describe"
	ActionAccountRemove    = "account_remove"
	ActionAccountRetention = "account_retention"
	RetentionDefault       = "default"
)
View Source
const (
	EventClientRegister = "client_register"
	EventAuthorize      = "authorize"
	EventTokenIssue     = "token_issue"
	EventTokenRefresh   = "token_refresh"
	EventTokenRevoke    = "token_revoke"
	ResultDenied        = "denied"
	ResultBlocked       = "blocked"
	ReasonWrongPassword = "wrong_password"
	ReasonOwnerDeclined = "owner_declined"
	ReasonCodeReused    = "code_reused"
	ReasonRefreshReused = "refresh_reused"
	ActionPasswordShow  = "password_show"
)

Variables

This section is empty.

Functions

func ClientIP

func ClientIP(r *http.Request) string

func WithClientIP

func WithClientIP(trustedHeader string, next http.Handler) http.Handler

Types

type AuthFailure

type AuthFailure struct {
	Path   string
	Reason string
	IP     string
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(w io.Writer, clk clock.Clock) *Logger

func (*Logger) AccountAction

func (l *Logger) AccountAction(ctx context.Context, action, account string)

func (*Logger) AccountRetention

func (l *Logger) AccountRetention(ctx context.Context, account, retention string)

func (*Logger) AuthFailure

func (l *Logger) AuthFailure(ctx context.Context, e AuthFailure)

func (*Logger) OAuth

func (l *Logger) OAuth(ctx context.Context, e OAuthEvent)

func (*Logger) OwnerAction

func (l *Logger) OwnerAction(ctx context.Context, e OwnerAction)

func (*Logger) PasswordShown

func (l *Logger) PasswordShown(ctx context.Context)

func (*Logger) ToolCall

func (l *Logger) ToolCall(ctx context.Context, e ToolCall)

func (*Logger) Upload

func (l *Logger) Upload(ctx context.Context, e Upload)

type OAuthEvent

type OAuthEvent struct {
	Event    string
	Result   string
	Reason   string
	ClientID string
	Client   string
	GrantID  int64
	Grant    string
	IP       string
}

type OwnerAction

type OwnerAction struct {
	Action   string
	GrantID  int64
	Grant    string
	Kind     string
	Approval string
}

type ToolCall

type ToolCall struct {
	GrantID int64
	Grant   string
	Tool    string
	Account string
	Result  string
	IP      string
}

type Upload

type Upload struct {
	GrantID int64
	Grant   string
	Result  string
	Size    int64
	IP      string
}

Jump to

Keyboard shortcuts

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