Use typed structs for activity objects instead of inline json!() #20

Closed
opened 2026-07-25 11:18:24 +00:00 by GKaszewski · 0 comments
Owner

Severity: Low

src/service/broadcast.rs lines 80, 143, 167, 220 construct inner activity objects as raw JSON values (e.g., json!({"type":"Announce","id":...})).

This bypasses the type system and serde validation. If a field name is mistyped, it silently produces non-spec JSON that remote servers will reject. Use typed structs with #[derive(Serialize)] instead.

**Severity: Low** `src/service/broadcast.rs` lines 80, 143, 167, 220 construct inner activity objects as raw JSON values (e.g., `json!({"type":"Announce","id":...})`). This bypasses the type system and serde validation. If a field name is mistyped, it silently produces non-spec JSON that remote servers will reject. Use typed structs with `#[derive(Serialize)]` instead.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/k-ap#20