# warp-tech/warpgate architecture

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

- Interactive diagram: https://gitdiagram.com/warp-tech/warpgate
- Repository: https://github.com/warp-tech/warpgate

## Overview

Warpgate is a transparent, multi-protocol bastion: users connect through native clients or a browser, authenticate, select or resolve an authorized target, and have traffic proxied to it, optionally with session recording. The repository separates protocol handlers, shared authorization and session services, persistence, and the admin and gateway interfaces. The README documents the principal flow and major capabilities; several protocol and service implementations were not sampled, so their internal call relationships are not inferred here.

Main entry points: [`warpgate/src/main.rs`](https://github.com/warp-tech/warpgate/blob/main/warpgate/src/main.rs) (Warpgate service), [`warpgate-core/src/auth.rs`](https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/auth.rs) (Authentication), [`warpgate-protocol-http/src/session.rs`](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-http/src/session.rs) (HTTPS gateway), [`warpgate-protocol-ssh/src/server/russh_handler.rs`](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-ssh/src/server/russh_handler.rs) (SSH gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Service entry"]
  node_service["Warpgate service<br/>[main.rs]"]
end

subgraph group_protocols["Protocol gateways"]
  node_ssh["SSH gateway<br/>[russh_handler.rs]"]
  node_http["HTTPS gateway<br/>[session.rs]"]
  node_kubernetes["Kubernetes gateway<br/>[handlers.rs]"]
  node_mysql["MySQL gateway<br/>[client.rs]"]
  node_postgres["PostgreSQL gateway<br/>[client.rs]"]
  node_rdp["RDP gateway<br/>[mod.rs]"]
  node_vnc["VNC gateway<br/>[mod.rs]"]
  node_web_desktop["Browser desktop<br/>[manager.rs]"]
  node_web_ssh["Browser SSH<br/>[manager.rs]"]
end

subgraph group_access["Access and identity"]
  node_auth["Authentication<br/>[auth.rs]"]
  node_desktop_auth["Desktop authentication<br/>[lib.rs]"]
  node_sso["SSO integration<br/>[sso.rs]"]
  node_protection["Login protection<br/>[service.rs]"]
  node_targets["Target configuration<br/>[target.rs]"]
end

subgraph group_sessions["Sessions and audit"]
  node_recording["Session recordings<br/>[storage.rs]"]
  node_kube_audit["Kubernetes audit<br/>[audit.rs]"]
  node_http_sessions[("HTTP session storage<br/>[session_storage.rs]")]
  node_database[("SQLite database<br/>[mod.rs]")]
end

subgraph group_interfaces["Web interfaces"]
  node_admin_api["Admin API<br/>[mod.rs]"]
  node_admin_ui["Admin UI<br/>[App.svelte]"]
  node_gateway_ui["Gateway UI<br/>[App.svelte]"]
end

node_operator(("Operator / client"))

node_operator -->|"connects to"| node_service
node_service -->|"accepts protocol"| node_ssh
node_service -->|"accepts protocol"| node_http
node_service -->|"accepts protocol"| node_kubernetes
node_service -->|"accepts protocol"| node_mysql
node_service -->|"accepts protocol"| node_postgres
node_service -->|"accepts protocol"| node_rdp
node_service -->|"accepts protocol"| node_vnc
node_ssh -.->|"authenticates"| node_auth
node_http -.->|"authenticates"| node_auth
node_kubernetes -.->|"authorizes"| node_auth
node_mysql -.->|"authenticates"| node_auth
node_postgres -.->|"authenticates"| node_auth
node_rdp -.->|"authenticates"| node_desktop_auth
node_vnc -.->|"authenticates"| node_desktop_auth
node_auth -.->|"checks attempts"| node_protection
node_auth -->|"resolves access"| node_targets
node_auth -.->|"supports SSO"| node_sso
node_http -->|"serves access UI"| node_gateway_ui
node_gateway_ui -.->|"opens sessions"| node_web_desktop
node_gateway_ui -.->|"opens sessions"| node_web_ssh
node_admin_ui -->|"manages access"| node_admin_api
node_admin_api -.->|"manages targets"| node_targets
node_http -->|"stores sessions"| node_http_sessions
node_http_sessions -->|"reads and writes"| node_database
node_ssh -.->|"records session"| node_recording
node_http -.->|"records session"| node_recording
node_kubernetes -->|"audits requests"| node_kube_audit
node_recording -->|"replays recordings"| node_admin_ui
node_admin_api -->|"persists history"| node_database

click node_service "https://github.com/warp-tech/warpgate/blob/main/warpgate/src/main.rs"
click node_ssh "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-ssh/src/server/russh_handler.rs"
click node_http "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-http/src/session.rs"
click node_kubernetes "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-kubernetes/src/server/handlers.rs"
click node_mysql "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-mysql/src/client.rs"
click node_postgres "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-postgres/src/client.rs"
click node_rdp "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-rdp/src/server/mod.rs"
click node_vnc "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-vnc/src/server/mod.rs"
click node_auth "https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/auth.rs"
click node_desktop_auth "https://github.com/warp-tech/warpgate/blob/main/warpgate-desktop-auth/src/lib.rs"
click node_sso "https://github.com/warp-tech/warpgate/blob/main/warpgate-sso/src/sso.rs"
click node_protection "https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/login_protection/service.rs"
click node_targets "https://github.com/warp-tech/warpgate/blob/main/warpgate-common/src/config/target.rs"
click node_admin_api "https://github.com/warp-tech/warpgate/blob/main/warpgate-admin/src/api/mod.rs"
click node_admin_ui "https://github.com/warp-tech/warpgate/blob/main/warpgate-web/src/admin/App.svelte"
click node_gateway_ui "https://github.com/warp-tech/warpgate/blob/main/warpgate-web/src/gateway/App.svelte"
click node_web_desktop "https://github.com/warp-tech/warpgate/blob/main/warpgate-web-desktop/src/manager.rs"
click node_web_ssh "https://github.com/warp-tech/warpgate/blob/main/warpgate-web-ssh/src/manager.rs"
click node_recording "https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/recordings/storage.rs"
click node_kube_audit "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-kubernetes/src/audit.rs"
click node_http_sessions "https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-http/src/session_storage.rs"
click node_database "https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/db/mod.rs"

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_service,node_operator toneBlue
class node_ssh,node_http,node_kubernetes,node_mysql,node_postgres,node_rdp,node_vnc,node_web_desktop,node_web_ssh toneAmber
class node_auth,node_desktop_auth,node_sso,node_protection,node_targets toneMint
class node_recording,node_kube_audit,node_http_sessions,node_database toneRose
class node_admin_api,node_admin_ui,node_gateway_ui toneIndigo
```

## Components

### Service entry

- [Warpgate service](https://github.com/warp-tech/warpgate/blob/main/warpgate/src/main.rs): `warpgate/src/main.rs`

### Protocol gateways

- [SSH gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-ssh/src/server/russh_handler.rs): `warpgate-protocol-ssh/src/server/russh_handler.rs`
- [HTTPS gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-http/src/session.rs): `warpgate-protocol-http/src/session.rs`
- [Kubernetes gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-kubernetes/src/server/handlers.rs): `warpgate-protocol-kubernetes/src/server/handlers.rs`
- [MySQL gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-mysql/src/client.rs): `warpgate-protocol-mysql/src/client.rs`
- [PostgreSQL gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-postgres/src/client.rs): `warpgate-protocol-postgres/src/client.rs`
- [RDP gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-rdp/src/server/mod.rs): `warpgate-protocol-rdp/src/server/mod.rs`
- [VNC gateway](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-vnc/src/server/mod.rs): `warpgate-protocol-vnc/src/server/mod.rs`
- [Browser desktop](https://github.com/warp-tech/warpgate/blob/main/warpgate-web-desktop/src/manager.rs): `warpgate-web-desktop/src/manager.rs`
- [Browser SSH](https://github.com/warp-tech/warpgate/blob/main/warpgate-web-ssh/src/manager.rs): `warpgate-web-ssh/src/manager.rs`

### Access and identity

- [Authentication](https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/auth.rs): `warpgate-core/src/auth.rs`
- [Desktop authentication](https://github.com/warp-tech/warpgate/blob/main/warpgate-desktop-auth/src/lib.rs): `warpgate-desktop-auth/src/lib.rs`
- [SSO integration](https://github.com/warp-tech/warpgate/blob/main/warpgate-sso/src/sso.rs): `warpgate-sso/src/sso.rs`
- [Login protection](https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/login_protection/service.rs): `warpgate-core/src/login_protection/service.rs`
- [Target configuration](https://github.com/warp-tech/warpgate/blob/main/warpgate-common/src/config/target.rs): `warpgate-common/src/config/target.rs`

### Sessions and audit

- [Session recordings](https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/recordings/storage.rs): `warpgate-core/src/recordings/storage.rs`
- [Kubernetes audit](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-kubernetes/src/audit.rs): `warpgate-protocol-kubernetes/src/audit.rs`
- [HTTP session storage](https://github.com/warp-tech/warpgate/blob/main/warpgate-protocol-http/src/session_storage.rs): `warpgate-protocol-http/src/session_storage.rs`
- [SQLite database](https://github.com/warp-tech/warpgate/blob/main/warpgate-core/src/db/mod.rs): `warpgate-core/src/db/mod.rs`

### Web interfaces

- [Admin API](https://github.com/warp-tech/warpgate/blob/main/warpgate-admin/src/api/mod.rs): `warpgate-admin/src/api/mod.rs`
- [Admin UI](https://github.com/warp-tech/warpgate/blob/main/warpgate-web/src/admin/App.svelte): `warpgate-web/src/admin/App.svelte`
- [Gateway UI](https://github.com/warp-tech/warpgate/blob/main/warpgate-web/src/gateway/App.svelte): `warpgate-web/src/gateway/App.svelte`

### Other components

- **Operator / client**

## Connections

- Operator / client → Warpgate service: connects to (evidence: `README.md`)
- Warpgate service → SSH gateway: accepts protocol (evidence: `README.md`)
- Warpgate service → HTTPS gateway: accepts protocol (evidence: `README.md`)
- Warpgate service → Kubernetes gateway: accepts protocol (evidence: `README.md`)
- Warpgate service → MySQL gateway: accepts protocol (evidence: `README.md`)
- Warpgate service → PostgreSQL gateway: accepts protocol (evidence: `README.md`)
- Warpgate service → RDP gateway: accepts protocol (evidence: `README.md`)
- Warpgate service → VNC gateway: accepts protocol (evidence: `README.md`)
- SSH gateway → Authentication: authenticates
- HTTPS gateway → Authentication: authenticates
- Kubernetes gateway → Authentication: authorizes
- MySQL gateway → Authentication: authenticates
- PostgreSQL gateway → Authentication: authenticates
- RDP gateway → Desktop authentication: authenticates (evidence: `warpgate-desktop-auth/src/lib.rs`)
- VNC gateway → Desktop authentication: authenticates (evidence: `warpgate-desktop-auth/src/lib.rs`)
- Authentication → Login protection: checks attempts
- Authentication → Target configuration: resolves access (evidence: `README.md`)
- Authentication → SSO integration: supports SSO (evidence: `README.md`)
- HTTPS gateway → Gateway UI: serves access UI (evidence: `README.md`)
- Gateway UI → Browser desktop: opens sessions
- Gateway UI → Browser SSH: opens sessions
- Admin UI → Admin API: manages access (evidence: `README.md`)
- Admin API → Target configuration: manages targets
- HTTPS gateway → HTTP session storage: stores sessions (evidence: `warpgate-protocol-http/src/session_storage.rs`)
- HTTP session storage → SQLite database: reads and writes (evidence: `warpgate-protocol-http/src/session_storage.rs`)
- SSH gateway → Session recordings: records session (evidence: `README.md`)
- HTTPS gateway → Session recordings: records session (evidence: `README.md`)
- Kubernetes gateway → Kubernetes audit: audits requests (evidence: `warpgate-protocol-kubernetes/src/server/handlers.rs`)
- Session recordings → Admin UI: replays recordings (evidence: `README.md`)
- Admin API → SQLite database: persists history (evidence: `README.md`)
