coldbox-interceptor-development

Register ColdBox interceptors for lifecycle events like preProcess and postProcess.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill coldbox-interceptor-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coldbox-interceptor-development
Source: https://github.com/ColdBox/skills/tree/main/coldbox/interceptor-development
Command: npx skills add https://github.com/ColdBox/skills --skill coldbox-interceptor-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers implement ColdBox interceptors to centralize cross-cutting concerns such as authentication, logging, CORS, rate limiting, request/response transformation, and custom lifecycle events to reduce duplicated code and improve consistency across handlers and modules.

Core Features & Use Cases

  • Lifecycle Hooks: Listen to framework interception points like preProcess, postProcess, preHandler, postHandler, preRender, and onException to run centralized logic.
  • Security & Rate Limiting: Implement authentication checks, protected route handling, and rate limiting with CacheBox integration and configurable responses.
  • Integrations & Patterns: Register interceptors in ColdBox.cfc or ModuleConfig.cfc, use interceptData and announce for custom events, support async listeners for non-blocking tasks (email, notifications), and configure CORS headers and preflight handling.
  • Use Case: Protect admin routes with an auth interceptor, log request metadata, and apply a rate limiter that returns 429 with retry headers when thresholds are exceeded.

Quick Start

Create an interceptor that authenticates requests to /admin, logs request metadata including IP and user-agent, and returns a 401 or redirects to login when unauthenticated.

Frequently Asked Questions about coldbox-interceptor-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement rate limiting in a ColdBox application?

Rate limiting in ColdBox is implemented by creating an interceptor that listens to lifecycle events like preProcess, integrating with CacheBox to track request thresholds, and returning a 429 status with retry headers when limits are exceeded.

What is the best way to centralize authentication and CORS policies in ColdBox?

Centralizing authentication and CORS policies in ColdBox is achieved by registering interceptors in ColdBox.cfc or ModuleConfig.cfc to enforce security checks, apply headers, and handle preflight requests across all handlers without duplicating code.

Can I run asynchronous logging tasks using ColdBox interceptors?

ColdBox interceptors support asynchronous listeners, allowing you to run non-blocking tasks such as logging, email notifications, and custom event announcements via interceptData without delaying the main request lifecycle.

How do I log request metadata before processing a ColdBox handler?

To log request metadata before processing a ColdBox handler, configure an interceptor for the preProcess or preHandler interception point to capture IP addresses, user-agent details, and other request context centrally.

Does ColdBox support custom interception points for module-specific events?

ColdBox supports custom interception points by using the announce method and interceptData payload, allowing you to define and listen for module-specific events registered within ModuleConfig.cfc for modular cross-cutting concerns.

How do I redirect unauthenticated users from protected ColdBox routes?

To redirect unauthenticated users from protected ColdBox routes, create a security interceptor listening to preProcess or preHandler events, check authentication state, and issue a 401 status or redirect to the login page when validation fails.