# infosecak/redactor architecture

> Architecture diagram of the GitHub repository infosecak/redactor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/infosecak/redactor
- Repository: https://github.com/infosecak/redactor

## Overview

##### Project Type & Purpose
- This project is a Burp Suite extension written in Python.
- Its purpose is to allow users to easily “redact” parts of an HTTP request by replacing selected text with “[redacted]”. It integrates with various parts of Burp Suite (Repeater, Intruder, Proxy) and interacts with the Extender UI for configuration and real‐time updates.

##### Analysis of the File Structure
- The project is extremely lightweight, containing only a README.md and a single script: redact.py.
- The redact.py script encapsulates the logic for intercepting UI events, processing the text redaction, interacting with Burp Suite APIs, and logging actions.

##### Key Components
- Burp Suite Environment:
– This is the host application that provides the extension framework.
– It includes the Request Editor and tools like Repeater, Intruder, and Proxy where redaction actions can be performed.
- Redactor Extension (redact.py):
– Event Listener/Handler: Captures UI events such as text selection and right-click context menu activation.
– Redaction Processor: Implements the logic to replace the target text with “[redacted]”.
– Logger: Sends updates or debugging information to the Burp Extender Output Tab.

##### Relationships and Interactions
- The user selects text in one of the Burp Suite tools (e.g., in the Request Editor).
- A right-click context menu action (“Redact Selected Text”) triggers an event that is caught by the Redactor extension.
- The extension’s redaction processor takes the selected text, applies the redaction logic, and replaces it with “[redacted]” in real time.
- Simultaneously, the Logger component updates the messages in the Extender Output tab.

##### Architectural Patterns & Design Principles
- The design is event-driven, responding to specific user interactions within the Burp Suite UI.
- The extension adheres to a modular design by isolating event handling, redaction logic, and logging into conceptual components—even if they reside in a single script.
- The emphasis is on integration and real-time interaction between the extension and the multiple tools within Burp Suite.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    UA("User Action"):::external

    %% Burp Suite Environment Subgraph
    subgraph "Burp Suite Environment"
        BSUI("Request Editor (Repeater,Intruder,Proxy)"):::burp
        EO("Extender Output Tab"):::burp
    end

    %% Redactor Extension Subgraph
    subgraph "Redactor Extension"
        EL("Event Listener"):::extension
        RP("Redaction Processor"):::extension
        LG("Logger"):::extension
    end

    %% Flow connections
    UA -->|"selects text"| BSUI
    BSUI -->|"right-click:RedactSelectedText"| EL
    EL -->|"processEvent"| RP
    RP -->|"updatesRequest:[redacted]"| BSUI
    RP -->|"logsAction"| LG
    LG -->|"displayLog"| EO

    %% Click Events for Redactor Extension Components
    click EL "https://github.com/infosecak/redactor/blob/main/redact.py"
    click RP "https://github.com/infosecak/redactor/blob/main/redact.py"
    click LG "https://github.com/infosecak/redactor/blob/main/redact.py"

    %% Styling
    classDef burp fill:#ADD8E6,stroke:#000,stroke-width:1.5px;
    classDef extension fill:#90EE90,stroke:#000,stroke-width:1.5px;
    classDef external fill:#FFC0CB,stroke:#000,stroke-width:1.5px;
```
