# rsudre/apiscan architecture

> Architecture diagram of the GitHub repository rsudre/apiscan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rsudre/apiscan
- Repository: https://github.com/rsudre/apiscan

## Overview

ApiScan is a single-file Python API security testing script. Its workflow loads route definitions from an OpenAPI-style JSON file, constructs sample parameters, sends supported HTTP requests, analyzes responses for status, timing and selected security warnings, then writes an HTML report. The README also documents optional proxy routing and console progress; the shown implementation supports proxy routing but does not show a progress animation. The graph reflects the one sampled source file; no separate internal modules or storage layer are present.

Main entry points: [`ApiScan.py`](https://github.com/rsudre/apiscan/blob/main/ApiScan.py) (Route tester)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["API scanning"]
  node_loader["Spec loader<br/>[ApiScan.py]"]
  node_parambuilder["Parameter builder<br/>[ApiScan.py]"]
  node_scanner["Route tester<br/>[ApiScan.py]"]
end

subgraph group_reporting["Results and reporting"]
  node_analysis["Response analysis<br/>[ApiScan.py]"]
  node_results["Test results<br/>[ApiScan.py]"]
  node_reportgen["HTML report generator<br/>[ApiScan.py]"]
end

node_operator(("API tester"))
node_specfile["OpenAPI JSON"]
node_targetapi["Target API"]
node_proxy["HTTP proxy"]
node_reportfile["HTML report"]

node_operator -->|"runs script"| node_loader
node_specfile -->|"provides JSON"| node_loader
node_loader -->|"loads route data"| node_parambuilder
node_loader -->|"passes routes"| node_scanner
node_scanner -->|"builds parameters"| node_parambuilder
node_scanner -->|"sends HTTP requests"| node_targetapi
node_scanner -->|"routes optionally"| node_proxy
node_scanner -->|"checks responses"| node_analysis
node_analysis -->|"records findings"| node_results
node_scanner -->|"returns results"| node_results
node_results -->|"supplies findings"| node_reportgen
node_reportgen -->|"writes HTML"| node_reportfile

click node_loader "https://github.com/rsudre/apiscan/blob/main/ApiScan.py"
click node_parambuilder "https://github.com/rsudre/apiscan/blob/main/ApiScan.py"
click node_scanner "https://github.com/rsudre/apiscan/blob/main/ApiScan.py"
click node_analysis "https://github.com/rsudre/apiscan/blob/main/ApiScan.py"
click node_results "https://github.com/rsudre/apiscan/blob/main/ApiScan.py"
click node_reportgen "https://github.com/rsudre/apiscan/blob/main/ApiScan.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loader,node_parambuilder,node_scanner toneBlue
class node_analysis,node_results,node_reportgen toneAmber
class node_operator,node_specfile,node_targetapi toneMint
class node_proxy,node_reportfile toneIndigo
```

## Components

### API scanning

- [Spec loader](https://github.com/rsudre/apiscan/blob/main/ApiScan.py): `ApiScan.py`
- [Parameter builder](https://github.com/rsudre/apiscan/blob/main/ApiScan.py): `ApiScan.py`
- [Route tester](https://github.com/rsudre/apiscan/blob/main/ApiScan.py): `ApiScan.py`

### Results and reporting

- [Response analysis](https://github.com/rsudre/apiscan/blob/main/ApiScan.py): `ApiScan.py`
- [Test results](https://github.com/rsudre/apiscan/blob/main/ApiScan.py): `ApiScan.py`
- [HTML report generator](https://github.com/rsudre/apiscan/blob/main/ApiScan.py): `ApiScan.py`

### Other components

- **API tester**
- **OpenAPI JSON**
- **Target API**
- **HTTP proxy**
- **HTML report**

## Connections

- API tester → Spec loader: runs script (evidence: `README.md`)
- OpenAPI JSON → Spec loader: provides JSON (evidence: `ApiScan.py`)
- Spec loader → Parameter builder: loads route data (evidence: `ApiScan.py`)
- Spec loader → Route tester: passes routes (evidence: `ApiScan.py`)
- Route tester → Parameter builder: builds parameters (evidence: `ApiScan.py`)
- Route tester → Target API: sends HTTP requests (evidence: `ApiScan.py`)
- Route tester → HTTP proxy: routes optionally (evidence: `ApiScan.py`)
- Route tester → Response analysis: checks responses (evidence: `ApiScan.py`)
- Response analysis → Test results: records findings (evidence: `ApiScan.py`)
- Route tester → Test results: returns results (evidence: `ApiScan.py`)
- Test results → HTML report generator: supplies findings (evidence: `ApiScan.py`)
- HTML report generator → HTML report: writes HTML (evidence: `ApiScan.py`)
