Class is MA-assigned at approval, not self-declared; drop the sharing dropdown
This commit is contained in:
+14
-8
@@ -91,7 +91,7 @@ async fn application_pending_then_approve_then_enroll_binds_key() {
|
||||
assert_eq!(dup.status(), reqwest::StatusCode::CONFLICT);
|
||||
|
||||
// MA approves: member stub; a member token then authorizes key enrollment
|
||||
commands::registry_approve(&dir, id, None).unwrap();
|
||||
commands::registry_approve(&dir, id, None, None).unwrap();
|
||||
let signed = registry::load_registry(&dir.join("registry.json")).unwrap();
|
||||
assert!(signed.doc.members.iter().any(|member| member.id == id));
|
||||
let apps = registry::load_applications(&dir.join("applications.json")).unwrap();
|
||||
@@ -166,7 +166,6 @@ async fn signup_stores_private_application_and_class() {
|
||||
"email": "ops@keswick.example",
|
||||
"address": "1 Fell Road, Keswick",
|
||||
"domain": "keswick.example",
|
||||
"class": "enrichment",
|
||||
"payment": "IBAN XX00 0000",
|
||||
"privacy_link": "https://keswick.example/privacy",
|
||||
"attestation": true,
|
||||
@@ -182,7 +181,8 @@ async fn signup_stores_private_application_and_class() {
|
||||
Some("keswick-research.frx.invalid")
|
||||
);
|
||||
|
||||
// private application record holds the contract details
|
||||
// private application record holds the contract details; applicants do not
|
||||
// self-declare a class — the MA assigns it at approval
|
||||
let apps = registry::load_applications(&dir.join("applications.json")).unwrap();
|
||||
assert_eq!(apps.len(), 1);
|
||||
let app = &apps[0];
|
||||
@@ -192,11 +192,17 @@ async fn signup_stores_private_application_and_class() {
|
||||
assert_eq!(app.email, "ops@keswick.example");
|
||||
assert_eq!(app.payment, "IBAN XX00 0000");
|
||||
assert_eq!(app.privacy_link, "https://keswick.example/privacy");
|
||||
assert_eq!(app.class, "enrichment");
|
||||
assert_eq!(app.class, "source");
|
||||
assert_eq!(app.status, "pending");
|
||||
|
||||
// approval creates the member entry with the declared class
|
||||
commands::registry_approve(&dir, "keswick-research.frx.invalid", None).unwrap();
|
||||
// approval with --class enrichment creates the member with that class
|
||||
commands::registry_approve(
|
||||
&dir,
|
||||
"keswick-research.frx.invalid",
|
||||
None,
|
||||
Some(frxd::config::CLASS_ENRICHMENT),
|
||||
)
|
||||
.unwrap();
|
||||
let signed = registry::load_registry(&dir.join("registry.json")).unwrap();
|
||||
let member = signed
|
||||
.doc
|
||||
@@ -223,7 +229,7 @@ async fn invite_reissues_token_per_node() {
|
||||
.unwrap();
|
||||
submit_application(&http, &base, "Multi Node").await;
|
||||
let id = "multi-node.frx.invalid";
|
||||
commands::registry_approve(&dir, id, None).unwrap();
|
||||
commands::registry_approve(&dir, id, None, None).unwrap();
|
||||
|
||||
let enroll = |token: String, pubkey: String| {
|
||||
let http = http.clone();
|
||||
@@ -276,7 +282,7 @@ async fn wizard_enrolls_and_writes_config() {
|
||||
let http = reqwest::Client::new();
|
||||
submit_application(&http, &base, "Wizard Test").await;
|
||||
let id = "wizard-test.frx.invalid";
|
||||
commands::registry_approve(&dir, id, None).unwrap();
|
||||
commands::registry_approve(&dir, id, None, None).unwrap();
|
||||
let token = commands::registry_token(&dir, id, None).unwrap();
|
||||
let signed = registry::load_registry(&dir.join("registry.json")).unwrap();
|
||||
let credentials = format!(
|
||||
|
||||
Reference in New Issue
Block a user