Skip to content

Commit 946919a

Browse files
committed
Add per-user entries store and entry endpoints
Introduce a file-backed EntriesStore for per-user signed encrypted-bucketsIndex entries and wire it into the server surface. Adds: EntriesStore implementation (crates/fula-cli/src/entries_store.rs) with atomic JSON persistence and TOFU/sequence checks; handlers for pinning encrypted bucketsIndex blobs and fetching latest entry (encrypted_user_index), a handler to submit signed user entries (user_entry_submit), and a GET /buckets/list owner endpoint (list_buckets_for_owner). Update users_index_publisher to emit a backward-compatible users_enc map (with verification) and provide helper builders for Phase 3 publishing. Add config option entries_store_path and default wiring, update handlers mod and internal test state to account for the new store. Also bump workspace version in Cargo.toml to 0.6.0 and include supporting client/crypto changes and tests. These changes are additive and designed for backward compatibility: when entries_store is not configured or users_enc is empty, behavior and published CBOR remain byte-identical to prior releases.
1 parent 1bddc67 commit 946919a

32 files changed

Lines changed: 4605 additions & 16 deletions

Cargo.lock

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ name = "encrypted_upload_test"
7979
path = "examples/encrypted_upload_test.rs"
8080

8181
[workspace.package]
82-
version = "0.5.7"
82+
version = "0.6.0"
8383
edition = "2021"
8484
license = "MIT OR Apache-2.0"
8585
repository = "https://github.com/functionland/fula-api"

crates/fula-cli/src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ pub struct GatewayConfig {
7373
/// deployments lightweight.
7474
#[serde(default)]
7575
pub pin_queue_path: Option<String>,
76+
/// Phase 2 E2E plan — JSON file path for the per-user signed-entry
77+
/// store. When `Some`, master accepts encrypted bucketsIndex
78+
/// entries via the new `/api/v1/users-index/entry` endpoint and
79+
/// persists them here. When `None`, the new endpoints return 503
80+
/// and master falls back to today's legacy `users[]` publisher
81+
/// path for ALL users — strictly byte-identical to pre-Phase-2
82+
/// behavior. Backward-compatible default.
83+
#[serde(default)]
84+
pub entries_store_path: Option<String>,
7685
}
7786

7887
fn default_block_cache_mb() -> usize {
@@ -112,6 +121,7 @@ impl Default for GatewayConfig {
112121
admin_api_enabled: false,
113122
block_cache_mb: default_block_cache_mb(),
114123
pin_queue_path: Some("/var/lib/fula-gateway/pin_queue.redb".to_string()),
124+
entries_store_path: None,
115125
}
116126
}
117127
}

0 commit comments

Comments
 (0)