Documentation
    Preparing search index...

    Class AbstractRbacMiddleware<TRequest, TResponse, TNext>Abstract

    Abstract base class for framework-specific RBAC middlewares (Express, Astro, etc.). Coordinates route access decisions, user context resolution, FLS helper injection, and tarpitting.

    Type Parameters

    • TRequest = any
    • TResponse = any
    • TNext = any

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    • Factory method building a scoped RbacRequestContext helper for controllers and templates.

      Parameters

      • user: RbacUserContext | null

        Current user context (or null for anonymous guest).

      Returns RbacRequestContext

      RbacRequestContext instance.

    • Normalizes the target URI path and HTTP method from the incoming request.

      Parameters

      • request: TRequest

        Native request object.

      Returns { method: HttpMethod; uri: string }

      Object containing uri and method.

    • Extracts the authenticated user or M2M agent context from the incoming request.

      Parameters

      • request: TRequest

        Native request object.

      Returns RbacUserContext | Promise<RbacUserContext | null> | null

      RbacUserContext or null if unauthenticated.

    • Handles access denial according to request context (e.g. JSON error for API, redirect/403 for HTML pages).

      Parameters

      • request: TRequest

        Native request object.

      • response: TResponse

        Native response object.

      • reason: "unauthenticated" | "forbidden" | "tarpit_blocked"

        Denial rationale ('unauthenticated' | 'forbidden' | 'tarpit_blocked').

      Returns any