1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Bucket data structures and operations
//!
//! This module defines the core types for JaxBucket's encrypted, content-addressed file storage:
//!
//! - **[`Manifest`]**: Bucket metadata including ID, name, shares, and content-addressed pointers
//! - **[`Node`]**: DAG structure representing directories and files
//! - **[`Mount`]**: In-memory representation of a bucket with CRUD operations
//! - **[`Pins`]**: Set of content hashes that should be kept available
//! - **[`Principal`]**: Access control entries (peer identity + role)
//!
//! # Architecture
//!
//! ## Buckets as DAGs
//!
//! A bucket is a Directed Acyclic Graph (DAG) of encrypted nodes:
//! ```text
//! Manifest (unencrypted) --entry--> Root Node (encrypted)
//! |
//! +------------------+------------------+
//! | | |
//! File1 Dir Node File2
//! (encrypted) (encrypted) (encrypted)
//! |
//! +-------+-------+
//! | |
//! File3 File4
//! (encrypted) (encrypted)
//! ```
//!
//! ## Content Addressing
//!
//! All nodes and files are content-addressed by their (post-encryption) hash.
//! Links between nodes use [`Link`](crate::linked_data::Link), which includes:
//! - Hash (BLAKE3)
//! - Codec (DAG-CBOR for nodes, Raw for encrypted data)
//! - Format (Raw blob or HashSeq)
//!
//! ## Encryption Model
//!
//! - Each node and file has its own encryption [`Secret`](crate::crypto::Secret)
//! - Secrets are stored in the parent node's [`NodeLink`]
//! - The root node's secret is shared with authorized peers via [`Share`](crate::crypto::Share)
//! - This provides fine-grained access control and efficient key rotation
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Pins;
pub use ;