hooks

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAuthContext

func LoadAuthContext(app core.App) func(next func(*core.RequestEvent) error) func(*core.RequestEvent) error

LoadAuthContext returns a middleware that loads the auth record from the Authorization header

func OnAuthFailed

func OnAuthFailed(app App) func(*core.RecordAuthRequestEvent) error

OnAuthFailed tracks failed auth attempts and locks account after 5 failures

func OnAuthRequest

func OnAuthRequest(app App) func(*core.RecordAuthRequestEvent) error

OnAuthRequest checks account lockout before allowing auth

func OnAuthWithPasswordRequest

func OnAuthWithPasswordRequest(app App) func(*core.RecordAuthWithPasswordRequestEvent) error

OnAuthWithPasswordRequest checks account lockout and tracks failures

func OnUserCreate

func OnUserCreate(app App) func(*core.RecordEvent) error

OnUserCreate validates password when creating a new user

func OnUserUpdate

func OnUserUpdate(app App) func(*core.RecordEvent) error

OnUserUpdate validates password and checks security constraints when updating user

func RegisterAgentHooks

func RegisterAgentHooks(app core.App)

RegisterAgentHooks registers all agent-related functionality

func RegisterInvestigationHooks

func RegisterInvestigationHooks(app core.App)

RegisterInvestigationHooks registers all investigation management endpoints

func RegisterPatchHooks

func RegisterPatchHooks(app core.App)

RegisterPatchHooks registers all patch management endpoints and hooks

func RequireAuth

func RequireAuth() func(next func(*core.RequestEvent) error) func(*core.RequestEvent) error

RequireAuth returns a middleware that requires authentication

Types

type App

type App interface {
	FindCollectionByNameOrId(collectionNameOrId string) (*core.Collection, error)
	FindRecordsByFilter(collection any, filter string, sort string, limit int, offset int, params ...dbx.Params) ([]*core.Record, error)
	Save(record core.Model) error
}

App interface for PocketBase operations

Jump to

Keyboard shortcuts

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