Remove membership classes (spec, registry schema, enforcement); no roles or tiers

This commit is contained in:
George Coles
2026-09-15 12:59:35 -04:00
parent 276fe5e438
commit dfa1fb1143
16 changed files with 68 additions and 222 deletions
+2 -73
View File
@@ -4,7 +4,7 @@ use std::fs;
use std::path::Path;
use common::{ask, client, collection, config_for, spawn_relay};
use frxd::config::{CLASS_ENRICHMENT, CLASS_SOURCE, Member, save_members};
use frxd::config::{Member, save_members};
use frxd::index::LocalIndex;
use frxd::message::EXPOSURE_FULL;
use frxd::node::{self, Node, NodeHandle, current_period};
@@ -163,77 +163,7 @@ async fn aggregate_floor_rejects_finer_than_month() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn enrichment_members_cannot_send_content() {
let root = tempfile::tempdir().unwrap();
let relay_url = spawn_relay().await;
let bob_full = start_node(
root.path(),
"bob",
&relay_url,
EXPOSURE_FULL,
&[("doc.txt", "enrichment test rust content")],
)
.await;
let carol_meta = start_node(
root.path(),
"carol",
&relay_url,
"metadata",
&[("doc.txt", "enrichment test rust metadata")],
)
.await;
let alice = start_node(
root.path(),
"alice",
&relay_url,
EXPOSURE_FULL,
&[("mine.txt", "alice local")],
)
.await;
save_members(
&alice.node.config.members_path(),
&[
Member {
name: "bob".to_string(),
pubkey: bob_full.pubkey.clone(),
class: CLASS_ENRICHMENT.to_string(),
previous: Vec::new(),
},
Member {
name: "carol".to_string(),
pubkey: carol_meta.pubkey.clone(),
class: CLASS_ENRICHMENT.to_string(),
previous: Vec::new(),
},
],
)
.unwrap();
let (_status, _raw, value) = ask(&client(), &alice.addr.to_string(), "rust", 5).await;
let responses = value.get("responses").and_then(Value::as_array).unwrap();
assert_eq!(
responses.len(),
1,
"full-exposure enrichment reply must be dropped"
);
assert_eq!(
responses[0].get("member").and_then(Value::as_str),
Some(carol_meta.pubkey.as_str())
);
assert!(
responses[0]
.get("results")
.and_then(Value::as_array)
.unwrap()[0]
.get("content")
.unwrap()
.is_null()
);
}
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn source_members_may_send_content() {
async fn full_exposure_responses_carry_content() {
let root = tempfile::tempdir().unwrap();
let relay_url = spawn_relay().await;
let bob = start_node(
@@ -257,7 +187,6 @@ async fn source_members_may_send_content() {
&[Member {
name: "bob".to_string(),
pubkey: bob.pubkey.clone(),
class: CLASS_SOURCE.to_string(),
previous: Vec::new(),
}],
)