hooks

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 19 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 RegisterPackageExceptionHooks added in v0.0.2

func RegisterPackageExceptionHooks(app core.App)

RegisterPackageExceptionHooks registers hooks for package_exceptions collection

func RegisterPatchHooks

func RegisterPatchHooks(app core.App)

RegisterPatchHooks registers all patch management endpoints and hooks

func RegisterProxmoxHooks added in v0.0.2

func RegisterProxmoxHooks(app core.App)

RegisterProxmoxHooks registers the Proxmox related hooks and routes

func RequireAuth

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

RequireAuth returns a middleware that requires authentication

func RequireAuthCollection added in v0.0.2

func RequireAuthCollection(collectionName string) func(next func(*core.RequestEvent) error) func(*core.RequestEvent) error

RequireAuthCollection returns a middleware that requires authentication for a specific collection

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