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
67 changes: 53 additions & 14 deletions pkgs/id/Cargo.lock

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

45 changes: 7 additions & 38 deletions pkgs/id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ categories = ["command-line-utilities", "network-programming"]
# id-core sub-crate under crates/; this package is the workspace root.

[workspace]
members = ["crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-groups", "crates/id-sync", "crates/id-worlds", "crates/id-directory", "crates/id-native-shell"]
members = ["crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-groups", "crates/id-sync", "crates/id-worlds", "crates/id-directory", "crates/id-web", "crates/id-native-shell"]
# The vendored crates stay OUT of the workspace: as path dependencies inside
# this directory Cargo would otherwise treat them as members, and a member's
# feature graph joins the lock resolve — p2panda-sync's `test_utils` feature
# forwards to `p2panda-store/test_utils`, whose `sqlite` feature pulls sqlx
# into Cargo.lock even though no build here enables it (see vendor/README.md).
exclude = ["vendor/p2panda-sync", "vendor/p2panda-encryption"]
default-members = [".", "crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-groups", "crates/id-sync", "crates/id-worlds", "crates/id-directory"]
default-members = [".", "crates/id-core", "crates/id-caps", "crates/id-store", "crates/id-events", "crates/id-groups", "crates/id-sync", "crates/id-worlds", "crates/id-directory", "crates/id-web"]

# =============================================================================
# Features
Expand All @@ -33,27 +33,13 @@ default-members = [".", "crates/id-core", "crates/id-caps", "crates/id-store", "
default = ["sandbox", "world"]
sandbox = ["world", "id-core/sandbox", "id-caps/sandbox", "id-worlds/sandbox"]
world = [
"dep:subtle",
"dep:hmac",
"dep:scrypt",
"dep:rmp-serde",
"id-core/world",
]
ssh = ["world", "id-worlds/ssh"]
web = [
"world",
"dep:axum",
"dep:tower",
"dep:tower-http",
"dep:rust-embed",
"dep:mime_guess",
"dep:futures",
"dep:rmp-serde",
"dep:comrak",
"dep:urlencoding",
"dep:aes-gcm",
"dep:hkdf",
"dep:qrcode",
"dep:id-web",
"id-core/web",
]
# Mainline DHT address lookup (P7.3, decision 15). Off in the default build; src/dht.rs decides per server.
Expand Down Expand Up @@ -86,6 +72,10 @@ id-groups = { path = "crates/id-groups", default-features = false }
# Worlds-family modules extracted in step 5 of the crate split (#4408).
# Re-exported at their historical crate:: paths in src/lib.rs.
id-worlds = { path = "crates/id-worlds", default-features = false }
# Web layer extracted in step 6c of the crate split (#4409). Optional:
# only the `web` feature links it, and src/lib.rs re-exports it as
# `id::web` under that feature.
id-web = { path = "crates/id-web", default-features = false, optional = true }
# Directory-family modules extracted in step 6b of the crate split
# (#4409). Re-exported at their historical crate:: paths in src/lib.rs.
id-directory = { path = "crates/id-directory", default-features = false }
Expand Down Expand Up @@ -143,22 +133,6 @@ unicode-width = "0.2"

# Web feature dependencies (optional)
axum = { version = "0.8", features = ["ws", "multipart"], optional = true }
tower = { version = "0.5", features = ["util"], optional = true }
tower-http = { version = "0.7", features = [
"fs",
"cors",
"compression-gzip",
], optional = true }
rust-embed = { version = "8", optional = true }
mime_guess = { version = "2", optional = true }
futures = { version = "0.3.32", optional = true }
rmp-serde = { version = "1", optional = true }
comrak = { version = "0.56", default-features = false, optional = true }
urlencoding = { version = "2", optional = true }
aes-gcm = { version = "0.11", default-features = false, features = [
"aes",
"alloc",
], optional = true }
argon2 = "0.6"
chacha20poly1305 = "0.10"
zeroize = "1"
Expand All @@ -172,16 +146,11 @@ blake3 = "1"
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"] }
webpki-roots = "1"
qrcode = { version = "0.14.1", default-features = false, optional = true }
hkdf = { version = "0.13", optional = true }
# SHA-256 for the hosted binding ceremony's service attestation (slice 1,
# #3808): required in every build variant, not only `world`/`web`.
sha2 = "0.11"
# HMAC-SHA512 for the Seitan V2 invite ID and Ed25519 seed (P6.1, src/seitan/derive.rs). Already in the lock.
hmac = { version = "0.13", optional = true }
# scrypt for the Seitan V2 stretch (P6.1). Already in the lock as a transitive dependency.
scrypt = { version = "0.12", optional = true }
subtle = { version = "2", optional = true }
# wasmtime moved to id-worlds in step 5b of the crate split (#4408):
# the `sandbox` feature above forwards to `id-worlds/sandbox`.
# russh moved to id-worlds in step 5c of the crate split (#4408):
Expand Down
12 changes: 12 additions & 0 deletions pkgs/id/crates/id-core/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ mod tests {
assert_eq!(sanitize_chat(text), "hello\n\t\u{200d}world");
}
}

/// Truncate `s` to at most `max` bytes **on a character boundary**, appending `…`.
pub fn truncate_on_char_boundary(s: &str, max: usize) -> String {
if s.len() <= max {
return s.to_owned();
}
let mut end = max;
while end > 0 && !s.is_char_boundary(end) {
end -= 1;
}
format!("{}…", &s[..end])
}
4 changes: 2 additions & 2 deletions pkgs/id/crates/id-sync/src/fileops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn is_archive_tag_name(name: &str) -> bool {
/// `hash` in the same critical section (#2462): when this returns, the
/// tag already points at `hash`, and no concurrent claim in this process
/// can receive the same name.
pub(crate) async fn claim_archive_name(
pub async fn claim_archive_name(
store: &Store,
name: &str,
ts: u64,
Expand All @@ -195,7 +195,7 @@ pub(crate) const PROVENANCE_TAG_KEYS: [&[u8]; 2] = [b"origin", b"created"];
/// are copied by content hash so the recorded values are preserved
/// exactly; a source with no recorded provenance leaves `to` with
/// none — unknown stays unknown, provenance is never invented.
pub(crate) async fn snapshot_provenance_tags(tags: &TagStore, from: &str, to: &str) -> Result<()> {
pub async fn snapshot_provenance_tags(tags: &TagStore, from: &str, to: &str) -> Result<()> {
for key in PROVENANCE_TAG_KEYS {
for tag in tags.get_by_key(&tags.global, from.as_bytes(), key).await? {
tags.set_tag_hash(
Expand Down
Loading
Loading