# teamproject-03/vaultlite architecture

> Architecture diagram of the GitHub repository teamproject-03/vaultlite, 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/teamproject-03/vaultlite
- Repository: https://github.com/teamproject-03/vaultlite

## Overview

VaultLite is a secrets manager accessed by humans and applications through a CLI or HTTPS API. Its main workflow initializes and unseals the vault, authorizes a token and path, then encrypts or decrypts versioned secrets persisted in SQLite; operations are audited. The graph also preserves the documented share-based key lifecycle, key and secret rotation, token policies, and signed audit verification. Relationships are limited to calls indicated by excerpts or the source index, or explicitly documented by the README; unsampled CLI and TLS internals are not inferred.

Main entry points: [`vaultlite/api/server.py`](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/server.py) (HTTPS API), [`vaultlite/core/seal.py`](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/seal.py) (Seal lifecycle), [`vaultlite/crypto/rotation.py`](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/rotation.py) (Key rotation), [`vaultlite/core/storage.py`](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/storage.py) (SQLite storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clients and API"]
  node_cli["CLI client<br/>[cli.py]"]
  node_api["HTTPS API<br/>[server.py]"]
end

subgraph group_access["Access control"]
  node_auth["Token authentication<br/>[auth.py]"]
  node_policies["Path policies<br/>[policies.py]"]
end

subgraph group_lifecycle["Vault lifecycle"]
  node_seal["Seal lifecycle<br/>[seal.py]"]
end

subgraph group_crypto["Cryptographic services"]
  node_shamir["Shamir shares<br/>[shamir.py]"]
  node_keyring["Keyring and check<br/>[keyring.py]"]
  node_envelope["Envelope encryption<br/>[envelope.py]"]
  node_rotation["Key rotation<br/>[rotation.py]"]
  node_errors["Crypto errors<br/>[errors.py]"]
  node_signing["Signing primitives<br/>[signing.py]"]
end

subgraph group_persistence["Persistence and audit"]
  node_storage[("SQLite storage<br/>[storage.py]")]
  node_audit["Audit log<br/>[audit.py]"]
end

node_human(("Human or app"))

node_human -->|"runs commands"| node_cli
node_cli -->|"calls over HTTPS"| node_api
node_api -->|"authenticates requests"| node_auth
node_auth -->|"checks permissions"| node_policies
node_auth -->|"reads and writes tokens"| node_storage
node_api -->|"controls vault lifecycle"| node_seal
node_api -->|"reads and writes secrets"| node_storage
node_api -->|"encrypts and decrypts"| node_envelope
node_api -->|"records operations"| node_audit
node_seal -->|"persists key metadata"| node_storage
node_seal -->|"splits and combines keys"| node_shamir
node_seal -->|"opens and seals KEK"| node_keyring
node_seal -->|"performs rotations"| node_rotation
node_seal -->|"wraps signing key"| node_signing
node_audit -->|"reads and appends entries"| node_storage
node_audit -->|"hashes and verifies entries"| node_signing
node_rotation -->|"rewraps data keys"| node_envelope
node_rotation -->|"rewraps vault key"| node_keyring
node_rotation -->|"issues replacement shares"| node_shamir
node_envelope -->|"raises decryption errors"| node_errors
node_keyring -->|"raises key errors"| node_errors
node_shamir -->|"raises share errors"| node_errors

click node_cli "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/cli.py"
click node_api "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/server.py"
click node_auth "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/auth.py"
click node_policies "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/policies.py"
click node_seal "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/seal.py"
click node_shamir "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/shamir.py"
click node_keyring "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/keyring.py"
click node_envelope "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/envelope.py"
click node_rotation "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/rotation.py"
click node_errors "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/errors.py"
click node_storage "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/storage.py"
click node_audit "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/audit.py"
click node_signing "https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/signing.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_cli,node_api toneBlue
class node_auth,node_policies toneAmber
class node_seal toneMint
class node_shamir,node_keyring,node_envelope,node_rotation,node_errors,node_signing toneRose
class node_storage,node_audit,node_human toneIndigo
```

## Components

### Clients and API

- [CLI client](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/cli.py): `vaultlite/cli.py`
- [HTTPS API](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/server.py): `vaultlite/api/server.py`

### Access control

- [Token authentication](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/auth.py): `vaultlite/api/auth.py`
- [Path policies](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/api/policies.py): `vaultlite/api/policies.py`

### Vault lifecycle

- [Seal lifecycle](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/seal.py): `vaultlite/core/seal.py`

### Cryptographic services

- [Shamir shares](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/shamir.py): `vaultlite/crypto/shamir.py`
- [Keyring and check](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/keyring.py): `vaultlite/crypto/keyring.py`
- [Envelope encryption](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/envelope.py): `vaultlite/crypto/envelope.py`
- [Key rotation](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/rotation.py): `vaultlite/crypto/rotation.py`
- [Crypto errors](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/errors.py): `vaultlite/crypto/errors.py`
- [Signing primitives](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/crypto/signing.py): `vaultlite/crypto/signing.py`

### Persistence and audit

- [SQLite storage](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/storage.py): `vaultlite/core/storage.py`
- [Audit log](https://github.com/teamproject-03/vaultlite/blob/main/vaultlite/core/audit.py): `vaultlite/core/audit.py`

### Other components

- **Human or app**

## Connections

- Human or app → CLI client: runs commands (evidence: `README.md`)
- CLI client → HTTPS API: calls over HTTPS (evidence: `README.md`)
- HTTPS API → Token authentication: authenticates requests (evidence: `vaultlite/api/server.py`)
- Token authentication → Path policies: checks permissions (evidence: `vaultlite/api/auth.py`)
- Token authentication → SQLite storage: reads and writes tokens (evidence: `vaultlite/api/auth.py`)
- HTTPS API → Seal lifecycle: controls vault lifecycle (evidence: `vaultlite/api/server.py`)
- HTTPS API → SQLite storage: reads and writes secrets (evidence: `vaultlite/api/server.py`)
- HTTPS API → Envelope encryption: encrypts and decrypts (evidence: `vaultlite/api/server.py`)
- HTTPS API → Audit log: records operations (evidence: `vaultlite/api/server.py`)
- Seal lifecycle → SQLite storage: persists key metadata (evidence: `vaultlite/core/seal.py`)
- Seal lifecycle → Shamir shares: splits and combines keys (evidence: `vaultlite/core/seal.py`)
- Seal lifecycle → Keyring and check: opens and seals KEK (evidence: `vaultlite/core/seal.py`)
- Seal lifecycle → Key rotation: performs rotations (evidence: `vaultlite/core/seal.py`)
- Seal lifecycle → Signing primitives: wraps signing key (evidence: `vaultlite/core/seal.py`)
- Audit log → SQLite storage: reads and appends entries (evidence: `vaultlite/core/audit.py`)
- Audit log → Signing primitives: hashes and verifies entries (evidence: `vaultlite/core/audit.py`)
- Key rotation → Envelope encryption: rewraps data keys (evidence: `vaultlite/crypto/rotation.py`)
- Key rotation → Keyring and check: rewraps vault key (evidence: `vaultlite/crypto/rotation.py`)
- Key rotation → Shamir shares: issues replacement shares (evidence: `vaultlite/crypto/rotation.py`)
- Envelope encryption → Crypto errors: raises decryption errors (evidence: `vaultlite/crypto/envelope.py`)
- Keyring and check → Crypto errors: raises key errors (evidence: `vaultlite/crypto/keyring.py`)
- Shamir shares → Crypto errors: raises share errors (evidence: `vaultlite/crypto/shamir.py`)
