Capabilities: implement HTTP client, rate limiting, and downloads #54

Closed
opened 2026-08-08 08:19:16 +00:00 by hugo · 1 comment
Owner

Objective

Implement HttpCapsClient, caps categories/rate limiter, download deduplication/progress/cancellation, and bounded HTTP behavior.

Deliverables

  • Use injected reqwest clients and clocks.
  • Preserve headers/content types, redirects, compression, streaming, retries, rate categories, progress, deduplication, cancellation, and non-HTTP rejection.
  • Redact capability URLs/tokens from logs and errors.

Validation

  • Caps/download/rate-limit tests pass with fake HTTP.
  • No real network is needed for offline tests.
  • Response and decompression limits are enforced.

Prerequisite

Wire codegen and the foundational implementation milestones are complete; the fixed API/test gates remain authoritative.

Project constraints

  • Native Rust networking only; no C# bridge, helper service, subprocess, or fallback.
  • Keep mapped APIs and translated assertions fixed, use bounded resources, and never log secrets.
  • Validate offline with deterministic fake servers before live-grid use and update docs/coverage evidence.
## Objective Implement HttpCapsClient, caps categories/rate limiter, download deduplication/progress/cancellation, and bounded HTTP behavior. ## Deliverables - Use injected reqwest clients and clocks. - Preserve headers/content types, redirects, compression, streaming, retries, rate categories, progress, deduplication, cancellation, and non-HTTP rejection. - Redact capability URLs/tokens from logs and errors. ## Validation - Caps/download/rate-limit tests pass with fake HTTP. - No real network is needed for offline tests. - Response and decompression limits are enforced. ## Prerequisite Wire codegen and the foundational implementation milestones are complete; the fixed API/test gates remain authoritative. ## Project constraints - Native Rust networking only; no C# bridge, helper service, subprocess, or fallback. - Keep mapped APIs and translated assertions fixed, use bounded resources, and never log secrets. - Validate offline with deterministic fake servers before live-grid use and update docs/coverage evidence.
hugo added this to the 08 - Networking and client lifecycle milestone 2026-08-08 08:19:16 +00:00
hugo added the enhancement label 2026-08-08 08:19:16 +00:00
Author
Owner

Implemented in commit 3032b16. Added native Rust HttpCapsClient with injected reqwest/fake-handler backends, rustls transport, bounded redirects/concurrency/request/response/decompression, streaming upload/download progress, LLSD content types, gzip/deflate, cancellation, non-HTTP rejection, and redacted diagnostics. Added deterministic per-category FIFO token buckets with the reference defaults and cap-name mappings. Added the bounded DownloadManager with canonical-URI deduplication, shared cancellation/progress, external completion sources, retries/backoff, permanent-status handling, and deterministic shutdown. Integrated both services into GridClient and regenerated API shims/coverage; documented policy and injection seams. Verification: cargo test -p libremetaverse --test caps_http (11 passed); translated queue_download tests (3 passed); translated non-HTTP Location test (1 passed); libremetaverse-types (48 passed); GridClient core tests (3 passed); cargo clippy -p libremetaverse --all-targets --locked --offline -- -D warnings; cargo check --workspace --all-targets --locked --offline -j 1; mapping/shim/coverage checks; locked API consumer check; rustdoc with warnings denied. The unrelated pre-created live/future-milestone tests still fail only at their explicitly unimplemented manager APIs and were not changed under this issue.

Implemented in commit 3032b16. Added native Rust HttpCapsClient with injected reqwest/fake-handler backends, rustls transport, bounded redirects/concurrency/request/response/decompression, streaming upload/download progress, LLSD content types, gzip/deflate, cancellation, non-HTTP rejection, and redacted diagnostics. Added deterministic per-category FIFO token buckets with the reference defaults and cap-name mappings. Added the bounded DownloadManager with canonical-URI deduplication, shared cancellation/progress, external completion sources, retries/backoff, permanent-status handling, and deterministic shutdown. Integrated both services into GridClient and regenerated API shims/coverage; documented policy and injection seams. Verification: cargo test -p libremetaverse --test caps_http (11 passed); translated queue_download tests (3 passed); translated non-HTTP Location test (1 passed); libremetaverse-types (48 passed); GridClient core tests (3 passed); cargo clippy -p libremetaverse --all-targets --locked --offline -- -D warnings; cargo check --workspace --all-targets --locked --offline -j 1; mapping/shim/coverage checks; locked API consumer check; rustdoc with warnings denied. The unrelated pre-created live/future-milestone tests still fail only at their explicitly unimplemented manager APIs and were not changed under this issue.
hugo closed this issue 2026-08-09 15:45:27 +00:00
Sign in to join this conversation.