Skip to content
Closed
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
2 changes: 2 additions & 0 deletions pkgs/id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ iroh = { version = "1", features = ["test-utils"] }
toml = "1"
# Local mainline DHT testnet for tests/dht_testnet.rs (P7.3). Dev only; already in the lock via the `dht` feature.
n0-mainline = "0.7"
# Mainline DHT address lookup builder for tests/dht_testnet.rs (P7.3). Matches id-sync optional dep.
iroh-mainline-address-lookup = "0.6"
# XSalsa20-Poly1305 for the Keybase V2 vector's pkey box (P6.1 known-answer test). Dev only; not in the lock before P6.1.
crypto_secretbox = "0.1"
# Reads the vector's msgpack byte strings (P6.1 known-answer test). Dev only; already in the lock.
Expand Down
46 changes: 23 additions & 23 deletions pkgs/id/WEB.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,31 +236,31 @@ Three DaisyUI terminal-inspired themes with `#000000` black backgrounds. Switch

## API Routes

| Route | Method | Description |
| --------------------- | ------ | ----------------------------------- |
| `/` | GET | File browser (main page) |
| `/peers` | GET | Discovered peers (auto-refreshes) |
| `/settings` | GET | Settings page |
| `/edit/{hash}` | GET | Editor/viewer for file by hash |
| `/file/{name}` | GET | Editor/viewer for file by name |
| `/blob/{hash}` | GET | Raw blob content with Content-Type |
| `/api/files` | GET | File list (HTML partial) |
| `/api/save` | POST | Save file content |
| `/api/new` | POST | Create new file |
| `/api/rename` | POST | Rename file (with optional archive) |
| `/api/copy` | POST | Copy file to new name |
| Route | Method | Description |
| --------------------- | ------ | --------------------------------------------------------- |
| `/` | GET | File browser (main page) |
| `/peers` | GET | Discovered peers (auto-refreshes) |
| `/settings` | GET | Settings page |
| `/edit/{hash}` | GET | Editor/viewer for file by hash |
| `/file/{name}` | GET | Editor/viewer for file by name |
| `/blob/{hash}` | GET | Raw blob content with Content-Type |
| `/api/files` | GET | File list (HTML partial) |
| `/api/save` | POST | Save file content |
| `/api/new` | POST | Create new file |
| `/api/rename` | POST | Rename file (with optional archive) |
| `/api/copy` | POST | Copy file to new name |
| `/api/files/send` | POST | Send file to another server (server-side transfer, #5346) |
| `/api/download` | POST | Download file content |
| `/api/delete` | POST | Soft-delete file |
| `/api/download` | POST | Download file content |
| `/api/delete` | POST | Soft-delete file |
| `/api/restore` | POST | Restore deleted file (404 if missing, 409 if not deleted) |
| `/api/hard-delete` | POST | Permanently delete file |
| `/api/tags` | GET | Get tags for a file |
| `/api/tags` | POST | Set a tag |
| `/api/tags` | DELETE | Delete a tag |
| `/api/tags/search` | GET | Search tags |
| `/ws/collab/{doc_id}` | WS | Collaboration WebSocket |
| `/ws/tags` | WS | Tag change broadcast |
| `/assets/*` | GET | Static assets |
| `/api/hard-delete` | POST | Permanently delete file |
| `/api/tags` | GET | Get tags for a file |
| `/api/tags` | POST | Set a tag |
| `/api/tags` | DELETE | Delete a tag |
| `/api/tags/search` | GET | Search tags |
| `/ws/collab/{doc_id}` | WS | Collaboration WebSocket |
| `/ws/tags` | WS | Tag change broadcast |
| `/assets/*` | GET | Static assets |

## Configuration

Expand Down
3 changes: 1 addition & 2 deletions pkgs/id/benches/world_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,7 @@ fn write_results_jsonl(cells: &[MatrixCell], quick: bool) -> Result<()> {
let git_sha = std::env::var("ID_BENCH_GIT_SHA")
.or_else(|_| std::env::var("GITHUB_SHA"))
.unwrap_or_else(|_| "unknown".to_owned());
let toolchain =
std::env::var("ID_BENCH_TOOLCHAIN").unwrap_or_else(|_| "unknown".to_owned());
let toolchain = std::env::var("ID_BENCH_TOOLCHAIN").unwrap_or_else(|_| "unknown".to_owned());
let build_profile = if cfg!(debug_assertions) {
"debug"
} else {
Expand Down
1 change: 0 additions & 1 deletion pkgs/id/crates/id-cli/src/commands/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ use crate::{
parse_stdin_items, read_input,
};


/// Trim a name typed at the forgiving CLI surface before FileOps sees it.
///
/// FileOps stores names verbatim and refuses padding (#4102 / design #4766
Expand Down
23 changes: 18 additions & 5 deletions pkgs/id/crates/id-directory/src/directory_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,12 +845,22 @@ mod tests {
.is_err()
);
assert!(
auth.check_code("user0@x.co", PurposeKind::SignIn, &resent, now() + CODE_RESEND_MS)
.is_ok()
auth.check_code(
"user0@x.co",
PurposeKind::SignIn,
&resent,
now() + CODE_RESEND_MS
)
.is_ok()
);
assert!(
auth.check_code("user0@x.co", PurposeKind::SignIn, &resent, now() + CODE_RESEND_MS)
.is_err()
auth.check_code(
"user0@x.co",
PurposeKind::SignIn,
&resent,
now() + CODE_RESEND_MS
)
.is_err()
);
}

Expand Down Expand Up @@ -894,7 +904,10 @@ mod tests {
)
.unwrap();
assert_eq!(auth.codes.len(), CODE_PENDING_PER_ACCOUNT + 1);
assert!(auth.check_code("other@x.co", PurposeKind::SignIn, &other, now()).is_ok());
assert!(
auth.check_code("other@x.co", PurposeKind::SignIn, &other, now())
.is_ok()
);
// A resend for one of the account's own pending addresses still
// replaces at the per-account cap. (Checking the other account's
// code above consumed it, so the map is back to the account's own
Expand Down
4 changes: 3 additions & 1 deletion pkgs/id/crates/id-native-shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ tokio = { version = "1", features = ["full"] }
# id-web tests do: id-worlds with the sandbox feature, plus the
# in-memory blob store the fixture recorder expects. Dev-only: none of
# this reaches the shipped shell or the default `id` build.
id-worlds = { path = "../id-worlds", default-features = false, features = ["sandbox"] }
id-worlds = { path = "../id-worlds", default-features = false, features = [
"sandbox",
] }
iroh-blobs = "0.103"

[lints.rust]
Expand Down
4 changes: 3 additions & 1 deletion pkgs/id/crates/id-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ p2panda-auth = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b9526
"serde",
] }
# The artifact and envelope network tests use id-core silent lookup helpers.
id-core = { path = "../id-core", default-features = false, features = ["test-utils"] }
id-core = { path = "../id-core", default-features = false, features = [
"test-utils",
] }
proptest = "1.12"
tempfile = "3"
tokio = { version = "1", features = ["test-util"] }
Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/crates/id-sync/src/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ use iroh::{EndpointAddr, endpoint::Endpoint};
use iroh_base::EndpointId;
use iroh_blobs::{Hash, api::Store};

use crate::protocol::META_ALPN;
use crate::meta_client::push_and_name;
use crate::meta_client::{expect_ok, request_over};
use crate::protocol::META_ALPN;
use crate::protocol::{MetaRequest, MetaResponse};

/// What a completed (or already-completed) transfer did.
Expand Down
4 changes: 3 additions & 1 deletion pkgs/id/crates/id-web/src/markdown/parse_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,9 @@ fn code_span_closes_within_paragraph(bytes: &[u8], from: usize, n: usize) -> boo
}
b'\n' => {
let mut m = k + 1;
while m < bytes.len() && (bytes[m] == b' ' || bytes[m] == b'\t' || bytes[m] == b'\r') {
while m < bytes.len()
&& (bytes[m] == b' ' || bytes[m] == b'\t' || bytes[m] == b'\r')
{
m += 1;
}
if m >= bytes.len() || bytes[m] == b'\n' {
Expand Down
Loading