Phase B: identifier+key on the wire, JCS envelope signing (FRX/0.5), registry binding

This commit is contained in:
George Coles
2026-09-15 05:54:52 -04:00
parent 559c260639
commit d30e612be8
12 changed files with 159 additions and 89 deletions
+11 -2
View File
@@ -59,9 +59,18 @@ pub fn free_port() -> u16 {
listener.local_addr().unwrap().port()
}
pub fn query_envelope(key: &Keypair, text: &str, max_results: usize) -> Envelope {
pub fn query_envelope(key: &Keypair, identifier: &str, text: &str, max_results: usize) -> Envelope {
let body = QueryBody::new(text, max_results);
Envelope::new(key, TYPE_QUERY, serde_json::to_value(&body).unwrap())
Envelope::new(
key,
identifier,
TYPE_QUERY,
serde_json::to_value(&body).unwrap(),
)
}
pub fn test_envelope(key: &Keypair, msg_type: &str, body: Value) -> Envelope {
Envelope::new(key, &key.public_hex(), msg_type, body)
}
pub async fn challenge(client: &reqwest::Client, relay_url: &str, member: &str) -> Option<String> {