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
//! Shared data structures, traits, protocol constants and streaming
//! compression abstractions for the libfw transfer library.
//!
//! `libfw-core` is the foundation crate consumed by both
//! [`libfw-server`](https://docs.rs/libfw-server) (server routing /
//! middleware) and [`libfw-client`](https://docs.rs/libfw-client) (WASM
//! engine + JS SDK). It contains no I/O of its own: it defines the *contracts*.
//!
//! # Highlights
//!
//! - [`TokenClaims`], [`Action`] and the [`Validator`] trait for
//! fine-grained bearer-token authorization.
//! - [`StorageBackend`] and [`UploadSink`] traits for pluggable storage.
//! - [`Compressor`] / [`Decompressor`] streaming traits backed by
//! [`zrip`] (zstd) with constant-memory guarantees.
//! - Protocol constants: [`CHUNK_SIZE`], [`HEADER_COMPRESS`],
//! [`HEADER_FILE_META`] and friends.
//! - Transfer metadata ([`FileMeta`], [`TransferPlan`], [`ChunkMeta`]).
//!
//! # Example
//!
//! ```no_run
//! use libfw_core::auth::{Action, PathValidator, Validator};
//! use libfw_core::claims::{TokenClaims, Permission};
//!
//! let claims = TokenClaims {
//! sub: "user-42".into(),
//! exp: None,
//! permissions: vec![Permission::Read, Permission::Write],
//! allowed_paths: vec!["/docs/".into()],
//! };
//! let validator = PathValidator::new();
//! assert!(validator.validate(&claims, "/docs/spec.pdf", Action::Read).is_ok());
//! ```
pub use ;
pub use ;
pub use ;
pub use *;
pub use ;
pub use ;
pub use RangeSpec;
pub use ;