IPolicyCallbacks

Interface representing callbacks for policy lifecycle and validation events. Provides hooks for initialization, validation, and ban actions.

onInit: (policyName: string) => void

Optional callback triggered when the policy is initialized. Useful for setup or logging.

onValidateInput: (incoming: string, clientId: string, swarmName: string, policyName: string) => void

Optional callback triggered to validate incoming messages. Useful for logging or monitoring input validation.

onValidateOutput: (outgoing: string, clientId: string, swarmName: string, policyName: string) => void

Optional callback triggered to validate outgoing messages. Useful for logging or monitoring output validation.

onBanClient: (clientId: string, swarmName: string, policyName: string) => void

Optional callback triggered when a client is banned. Useful for logging or triggering ban-related actions.

onUnbanClient: (clientId: string, swarmName: string, policyName: string) => void

Optional callback triggered when a client is unbanned. Useful for logging or triggering unban-related actions.