Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ tracing = "0.1"
sha2 = "0.11.0"
hmac = "0.13.0"
digest = "0.11.3"
chacha20poly1305 = "0.11"
aead = "0.6"
base64 = "0.22"
hex = "0.4"
getrandom = { version = "0.4", features = ["wasm_js"] }

# Learned watermark (TrustMark ONNX, optional — pulls in ONNX Runtime)
trustmark = { version = "0.2", optional = true }
Expand All @@ -80,6 +85,9 @@ time = { version = "0.3", features = ["formatting"], optional = true }
clap = { version = "4.5", features = ["derive"] }
glob = "0.3"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
capglyph-server = { path = "crates/capglyph-server" }
rand = "0.8"
uuid = { version = "1.8", features = ["v4", "serde"] }

[features]
default = []
Expand Down
2 changes: 2 additions & 0 deletions crates/capglyph-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ ciborium = "0.2"
serde_bytes = "0.11"
thiserror = "2"
tempfile = "3.27.0"
chacha20poly1305 = "0.11"
aead = "0.6"

axum = { version = "0.7" }
tokio = { version = "1", features = ["full"] }
Expand Down
17 changes: 17 additions & 0 deletions crates/capglyph-server/migrations/001_initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,20 @@ CREATE TABLE IF NOT EXISTS audit_events (
);
CREATE INDEX IF NOT EXISTS idx_audit_object ON audit_events(object_id);
CREATE INDEX IF NOT EXISTS idx_audit_type ON audit_events(event_type);

-- CTX-0024 pointer mode: message_objects (capability → encrypted object)
CREATE TABLE IF NOT EXISTS message_objects (
id TEXT PRIMARY KEY,
capability_id BLOB NOT NULL UNIQUE,
capability_hash BLOB NOT NULL UNIQUE,
ciphertext BLOB NOT NULL,
nonce BLOB NOT NULL,
tag BLOB NOT NULL,
content_key BLOB,
policy TEXT NOT NULL,
owner_id TEXT,
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
expires_at TEXT
);
CREATE INDEX IF NOT EXISTS idx_message_objects_cap_hash ON message_objects(capability_hash);
CREATE INDEX IF NOT EXISTS idx_message_objects_owner ON message_objects(owner_id);
18 changes: 18 additions & 0 deletions crates/capglyph-server/migrations/002_pointer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- 002_pointer.sql — CTX-0024 pointer mode: message_objects (capability → encrypted object)
-- Extends 001_initial with pointer stego tables.

CREATE TABLE IF NOT EXISTS message_objects (
id TEXT PRIMARY KEY,
capability_id BLOB NOT NULL UNIQUE,
capability_hash BLOB NOT NULL UNIQUE,
ciphertext BLOB NOT NULL,
nonce BLOB NOT NULL,
tag BLOB NOT NULL,
content_key BLOB,
policy TEXT NOT NULL,
owner_id TEXT,
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
expires_at TEXT
);
CREATE INDEX IF NOT EXISTS idx_message_objects_cap_hash ON message_objects(capability_hash);
CREATE INDEX IF NOT EXISTS idx_message_objects_owner ON message_objects(owner_id);
Loading