authlog

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "[auth-token]"

Variables

This section is empty.

Functions

func Endpoint

func Endpoint(raw string) (string, string)

Endpoint returns only the host and path of a URL. Userinfo, query, and fragments are deliberately discarded.

func Log

func Log(ctx context.Context, event Event)

Log writes an always-on token lifecycle event with safe structured fields.

func SafeUserID

func SafeUserID(value string) string

SafeUserID returns a sanitized canonical identifier and suppresses values that look like credential or configuration URLs.

func Sanitize

func Sanitize(value string) string

Sanitize redacts common credential representations and URL secrets before truncating to a bounded number of Unicode characters.

func Status

func Status(value string) int

Status is useful for logging a status when the caller only has a string.

Types

type Event

type Event struct {
	Op             string
	UserID         string
	Provider       string
	Caller         string
	ScheduleID     string
	RunID          string
	Endpoint       string
	HTTPStatus     int
	OAuthErrorCode string
	Classification string
	Action         string
	Elapsed        time.Duration
	Recovered      bool
	Err            error
}

Event is a safe, stable token-lifecycle log record. Empty fields remain present in the log so automated searches can rely on a consistent shape.

Jump to

Keyboard shortcuts

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