From 2bf64d3133e61a8fff66a1ae86dddddba6844872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 5 Sep 2026 15:02:10 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style:=20cargo=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ai/protocol.rs | 9 ++-- src/ai/server.rs | 15 ++++-- src/state.rs | 9 +++- src/web/builder.rs | 19 ++++---- tests/ai_bridge.rs | 45 ++++++++++++++---- tests/ai_protocol.rs | 56 +++++++++++++++------- tests/builder_api.rs | 111 +++++++++++++++++++++++++++++++++---------- tests/spec_bounds.rs | 14 +++++- 8 files changed, 211 insertions(+), 67 deletions(-) diff --git a/src/ai/protocol.rs b/src/ai/protocol.rs index d94f166..0952d2f 100644 --- a/src/ai/protocol.rs +++ b/src/ai/protocol.rs @@ -536,11 +536,14 @@ mod tests { })) .unwrap(); assert_eq!(bare.on_behalf_of, None); - assert!(serde_json::from_value::(json!({ "id": "01J", "school": "demo" })) - .is_err()); + assert!( + serde_json::from_value::(json!({ "id": "01J", "school": "demo" })) + .is_err() + ); // The school is required here too. assert!( - serde_json::from_value::(json!({ "id": "01J", "file": "01FILE" })).is_err() + serde_json::from_value::(json!({ "id": "01J", "file": "01FILE" })) + .is_err() ); // And the two shapes never parse as each other. assert!( diff --git a/src/ai/server.rs b/src/ai/server.rs index 49fc7dd..e9064f2 100644 --- a/src/ai/server.rs +++ b/src/ai/server.rs @@ -24,11 +24,11 @@ use crate::constant::{ REQUEST_TIMEOUT_SECS, }; use crate::database::Database; -use crate::error::AppError; use crate::domain::course::Course; use crate::domain::course_note::CourseNote; use crate::domain::course_note_file::{CourseNoteFile, CourseNoteFileId}; use crate::domain::user::{User, UserId}; +use crate::error::AppError; use crate::state::DbHealth; use crate::tenant::{Slug, Tenants}; use crate::web::blob_path; @@ -75,8 +75,12 @@ impl ApiHandle { /// switched off — a service that retries the first two forever learns /// nothing, while the third is worth retrying later. async fn school(&self, school: &str) -> Result<(Slug, Database), (&'static str, String)> { - let slug = Slug::try_new(school) - .map_err(|err| ("malformed", format!("`{school}` is not a school slug: {err}")))?; + let slug = Slug::try_new(school).map_err(|err| { + ( + "malformed", + format!("`{school}` is not a school slug: {err}"), + ) + })?; let db = self.tenants.get(&slug).await.map_err(|err| match err { AppError::Unauthorized => ( "unknown_school", @@ -600,7 +604,10 @@ async fn open_blob( /// never trusted from the frame: a service holding a stale id must not act as a /// user who has since been deleted or demoted, nor as a same-named user of /// another school. With nobody named the principal is the synthetic `ai` role. -async fn principal(db: &Database, on_behalf_of: Option<&str>) -> Result { +async fn principal( + db: &Database, + on_behalf_of: Option<&str>, +) -> Result { let Some(who) = on_behalf_of else { return Ok(User::ai_principal()); }; diff --git a/src/state.rs b/src/state.rs index f8773b0..c68aa1b 100644 --- a/src/state.rs +++ b/src/state.rs @@ -173,7 +173,9 @@ impl BoardHub { pub fn publish(&self, slug: &Slug, board: &str, frame: String) { let sender = { let boards = self.0.lock().expect("board hub lock"); - boards.get(&scoped_key(slug, board)).map(|room| room.0.clone()) + boards + .get(&scoped_key(slug, board)) + .map(|room| room.0.clone()) }; if let Some(sender) = sender { let _ = sender.send(frame); @@ -239,7 +241,10 @@ mod tests { let mut in_b = hub.subscribe(&b, "board-1"); hub.publish(&a, "board-1", "alpha stroke".to_string()); - assert_eq!(in_a.recv().await.expect("alpha's own stroke"), "alpha stroke"); + assert_eq!( + in_a.recv().await.expect("alpha's own stroke"), + "alpha stroke" + ); assert!( in_b.try_recv().is_err(), "beta's board must not hear alpha's stroke" diff --git a/src/web/builder.rs b/src/web/builder.rs index 0e12738..9bff111 100644 --- a/src/web/builder.rs +++ b/src/web/builder.rs @@ -206,11 +206,7 @@ async fn builder_login( let password = Password::try_new(&req.password).map_err(|_| AppError::Unauthorized)?; let builder = match Builder::find_by_username(req.username.trim(), control).await? { Some(builder) => { - if !builder - .get_password_hash() - .verify_async(&password) - .await - { + if !builder.get_password_hash().verify_async(&password).await { return Err(AppError::Unauthorized); } builder @@ -401,14 +397,18 @@ async fn update_school( let control = st.tenants.control(); // An empty patch on an unknown school is still a 404, so the existence // check is not left to whichever field happened to be present. - School::read(&slug, control).await?.ok_or(AppError::NotFound)?; + School::read(&slug, control) + .await? + .ok_or(AppError::NotFound)?; if let Some(name) = name { School::update_name(&slug, &name, control).await?; } if let Some(status) = status { st.tenants.set_status(&slug, status).await?; } - let school = School::read(&slug, control).await?.ok_or(AppError::NotFound)?; + let school = School::read(&slug, control) + .await? + .ok_or(AppError::NotFound)?; Ok(Json(SchoolResponse::new(&school))) } @@ -445,7 +445,10 @@ async fn delete_school( if let Err(err) = tokio::fs::remove_dir_all(&dir).await && err.kind() != std::io::ErrorKind::NotFound { - tracing::warn!("failed to remove the files of {slug} at {}: {err}", dir.display()); + tracing::warn!( + "failed to remove the files of {slug} at {}: {err}", + dir.display() + ); } Ok(StatusCode::NO_CONTENT) } diff --git a/tests/ai_bridge.rs b/tests/ai_bridge.rs index 02aa988..702cfe6 100644 --- a/tests/ai_bridge.rs +++ b/tests/ai_bridge.rs @@ -332,7 +332,11 @@ async fn concurrent_requests_share_one_connection_without_blocking_each_other() let calls = (0..N).map(|i| { let bridge = bridge.clone(); - tokio::spawn(async move { bridge.dispatch(&demo(), "ocr.extract", json!({ "n": i })).await }) + tokio::spawn(async move { + bridge + .dispatch(&demo(), "ocr.extract", json!({ "n": i })) + .await + }) }); let answers = futures_util::future::join_all(calls).await; @@ -356,8 +360,14 @@ async fn requests_route_to_the_service_declaring_the_capability() { let grader = connect_service(&bridge, hello("grader", &["grade.essay"]), Behaviour::Echo).await; await_workers(&bridge, 2).await; - bridge.dispatch(&demo(), "grade.essay", json!("text")).await.unwrap(); - bridge.dispatch(&demo(), "ocr.extract", json!("png")).await.unwrap(); + bridge + .dispatch(&demo(), "grade.essay", json!("text")) + .await + .unwrap(); + bridge + .dispatch(&demo(), "ocr.extract", json!("png")) + .await + .unwrap(); assert_eq!(ocr.seen().len(), 1, "ocr only saw its own capability"); assert_eq!(ocr.seen()[0].capability, "ocr.extract"); @@ -572,7 +582,12 @@ async fn a_silent_service_times_out_and_gives_the_slot_back() { // An abandoned request must not leak the worker's capacity. assert_eq!(bridge.workers()[0].inflight, 0); // And the worker is immediately usable again. - assert!(bridge.dispatch(&demo(), "ocr.extract", json!(null)).await.is_err()); + assert!( + bridge + .dispatch(&demo(), "ocr.extract", json!(null)) + .await + .is_err() + ); } #[tokio::test] @@ -593,7 +608,12 @@ async fn a_per_call_timeout_overrides_the_default() { )); // ...but a capability known to be slow can ask for more. let answer = bridge - .dispatch_with_timeout(&demo(), "ocr.extract", json!("slow"), Duration::from_secs(5)) + .dispatch_with_timeout( + &demo(), + "ocr.extract", + json!("slow"), + Duration::from_secs(5), + ) .await .expect("the longer deadline held"); assert_eq!(answer["echo"], "slow"); @@ -667,7 +687,10 @@ async fn a_disconnected_service_is_deregistered() { let bridge = bridge().await; let service = connect_service(&bridge, hello("ocr", &["ocr.extract"]), Behaviour::Echo).await; await_workers(&bridge, 1).await; - bridge.dispatch(&demo(), "ocr.extract", json!(null)).await.unwrap(); + bridge + .dispatch(&demo(), "ocr.extract", json!(null)) + .await + .unwrap(); service.conn.close(0u32.into(), b"service shutting down"); drop(service); @@ -715,7 +738,10 @@ async fn losing_one_service_leaves_the_other_serving() { await_workers(&bridge, 1).await; for _ in 0..4 { - bridge.dispatch(&demo(), "ocr.extract", json!("x")).await.unwrap(); + bridge + .dispatch(&demo(), "ocr.extract", json!("x")) + .await + .unwrap(); } assert_eq!( survivor.seen().len(), @@ -1795,7 +1821,10 @@ async fn a_course_note_is_indexed_and_its_output_stored_with_its_sources() { // The service saw the note itself, under the documented capability. let seen = service.seen(); assert_eq!(seen[0].capability, AI_RAG_INDEX_CAPABILITY); - assert_eq!(seen[0].school, DEMO_SLUG, "the frame names the caller's school"); + assert_eq!( + seen[0].school, DEMO_SLUG, + "the frame names the caller's school" + ); assert_eq!(seen[0].payload["course_note"], note); assert_eq!(seen[0].payload["title"], "Bölüm 3"); assert_eq!(seen[0].payload["content"], "özet"); diff --git a/tests/ai_protocol.rs b/tests/ai_protocol.rs index 84a78c4..fb37cf5 100644 --- a/tests/ai_protocol.rs +++ b/tests/ai_protocol.rs @@ -553,7 +553,8 @@ async fn the_request_frame_carries_exactly_the_published_keys() { let id = request["id"].as_str().unwrap().to_string(); raw::answer( send, - format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{{"text":"hi"}}}}"#).as_bytes(), + format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{{"text":"hi"}}}}"#) + .as_bytes(), ) .await; let answer = call.await.unwrap().expect("dispatch succeeded"); @@ -714,7 +715,8 @@ async fn each_request_gets_its_own_stream_and_answers_may_come_back_in_any_order let n = request["payload"]["n"].clone(); raw::answer( send, - format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{{"n":{n}}}}}"#).as_bytes(), + format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{{"n":{n}}}}}"#) + .as_bytes(), ) .await; } @@ -912,7 +914,8 @@ async fn several_raw_services_serve_one_capability_together() { let n = request["payload"]["n"].clone(); raw::answer( send, - format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{n}}}"#).as_bytes(), + format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{n}}}"#) + .as_bytes(), ) .await; } @@ -1006,7 +1009,10 @@ async fn a_chat_request_names_the_askers_school_role() { let id = request["id"].as_str().expect("trace id").to_string(); raw::answer( send, - format!(r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{{"text":"F = ma"}}}}"#).as_bytes(), + format!( + r#"{{"status":"ok","id":"{id}","school":"{SCHOOL}","payload":{{"text":"F = ma"}}}}"# + ) + .as_bytes(), ) .await; } @@ -1118,9 +1124,13 @@ async fn the_api_refusal_frame_carries_exactly_the_published_keys_and_codes() { ), ( "unknown_user", - r#"{"id":"t5","school":"demo","path":"/auth/me","on_behalf_of":"nobodyatall"}"#.to_string(), + r#"{"id":"t5","school":"demo","path":"/auth/me","on_behalf_of":"nobodyatall"}"# + .to_string(), + ), + ( + "malformed", + r#"{"id":"t6","school":"demo","path":42}"#.to_string(), ), - ("malformed", r#"{"id":"t6","school":"demo","path":42}"#.to_string()), // A frame that names no school at all: required, never defaulted. ("malformed", r#"{"id":"t7","path":"/auth/me"}"#.to_string()), // A string that is no slug — the service's own bug, not a missing @@ -1173,8 +1183,10 @@ async fn an_api_read_answers_a_named_user_with_that_users_own_data() { let (answer, _) = raw::api_read( &service.conn, - format!(r#"{{"id":"tme","school":"{SCHOOL}","path":"/auth/me","on_behalf_of":"{student}"}}"#) - .as_bytes(), + format!( + r#"{{"id":"tme","school":"{SCHOOL}","path":"/auth/me","on_behalf_of":"{student}"}}"# + ) + .as_bytes(), ) .await; assert_eq!(answer["outcome"], "ok", "{answer}"); @@ -1204,7 +1216,10 @@ async fn two_schools(bridge: &AiBridge) -> (axum::Router, Tenants, String, Strin let beta_cookie = common::login_as_school(&app, &beta_db, "beta", "ayse", "student").await; let demo_ayse = common::me_id(&app, &demo_cookie).await; let beta_ayse = common::me_id(&app, &beta_cookie).await; - assert_ne!(demo_ayse, beta_ayse, "two schools, two separate `ayse` rows"); + assert_ne!( + demo_ayse, beta_ayse, + "two schools, two separate `ayse` rows" + ); (app, tenants, demo_ayse, beta_ayse) } @@ -1222,8 +1237,10 @@ async fn an_api_read_answers_out_of_the_school_the_frame_named() { for (school, who) in [("demo", &demo_ayse), ("beta", &beta_ayse)] { let (answer, _) = raw::api_read( &service.conn, - format!(r#"{{"id":"t-own","school":"{school}","path":"/auth/me","on_behalf_of":"{who}"}}"#) - .as_bytes(), + format!( + r#"{{"id":"t-own","school":"{school}","path":"/auth/me","on_behalf_of":"{who}"}}"# + ) + .as_bytes(), ) .await; assert_eq!(answer["outcome"], "ok", "{answer}"); @@ -1272,7 +1289,10 @@ async fn a_suspended_school_is_refused_with_its_own_code() { let (answer, _) = raw::api_read(&service.conn, read.as_bytes()).await; assert_eq!(answer["outcome"], "err", "{answer}"); assert_eq!(answer["code"], "school_suspended", "{answer}"); - assert_eq!(answer["school"], "beta", "the refusal names the school back"); + assert_eq!( + answer["school"], "beta", + "the refusal names the school back" + ); assert_eq!(answer["id"], "t-susp"); // The demo school is untouched by its neighbour's suspension. @@ -1295,8 +1315,10 @@ async fn a_blob_read_names_its_school_too() { let (header, _, body) = raw::blob_read( &service.conn, - format!(r#"{{"id":"t-b1","school":"{SCHOOL}","file":"{file}","on_behalf_of":"{student}"}}"#) - .as_bytes(), + format!( + r#"{{"id":"t-b1","school":"{SCHOOL}","file":"{file}","on_behalf_of":"{student}"}}"# + ) + .as_bytes(), ) .await; assert_eq!(header["status"], "ok", "{header}"); @@ -1459,8 +1481,10 @@ async fn an_api_read_still_answers_on_the_shared_client_stream_path() { let (answer, _) = raw::api_read( &service.conn, - format!(r#"{{"id":"t-api","school":"{SCHOOL}","path":"/auth/me","on_behalf_of":"{student}"}}"#) - .as_bytes(), + format!( + r#"{{"id":"t-api","school":"{SCHOOL}","path":"/auth/me","on_behalf_of":"{student}"}}"# + ) + .as_bytes(), ) .await; assert_eq!(answer["outcome"], "ok", "{answer}"); diff --git a/tests/builder_api.rs b/tests/builder_api.rs index c84f5cd..e4e3f0b 100644 --- a/tests/builder_api.rs +++ b/tests/builder_api.rs @@ -164,7 +164,10 @@ async fn creating_a_school_seeds_an_admin_who_can_log_in() { ); let me = send(&app, "GET", "/auth/me", Some(&cookie), None).await; assert_eq!(me.status, StatusCode::OK); - assert_eq!(me.body["role"], "admin", "the seed is an admin, not a student"); + assert_eq!( + me.body["role"], "admin", + "the seed is an admin, not a student" + ); // The slug is the identity: a second school may not take it. assert_eq!( @@ -187,9 +190,15 @@ async fn creating_a_school_seeds_an_admin_who_can_log_in() { ); // …and nothing was left behind by the refusal. assert_eq!( - send(&app, "GET", &format!("/schools/{bad}"), Some(&builder), None) - .await - .status, + send( + &app, + "GET", + &format!("/schools/{bad}"), + Some(&builder), + None + ) + .await + .status, StatusCode::NOT_FOUND, "slug {bad:?} left a school behind" ); @@ -220,7 +229,9 @@ async fn a_suspension_closes_the_school_and_a_resume_reopens_it() { let (app, _db, _tenants) = deployment().await; let builder = builder_login(&app).await; assert_eq!( - create_school(&app, &builder, "beta", "secret1").await.status, + create_school(&app, &builder, "beta", "secret1") + .await + .status, StatusCode::CREATED ); @@ -302,7 +313,9 @@ async fn a_suspension_closes_the_school_and_a_resume_reopens_it() { "a suspended school refuses login" ); assert_eq!( - send(&app, "GET", "/auth/me", Some(&live), None).await.status, + send(&app, "GET", "/auth/me", Some(&live), None) + .await + .status, StatusCode::FORBIDDEN, "…and the cookie it had already issued, on its very next call" ); @@ -336,7 +349,9 @@ async fn a_suspension_closes_the_school_and_a_resume_reopens_it() { ) .await; assert_eq!( - send(&app, "GET", "/auth/me", Some(&live), None).await.status, + send(&app, "GET", "/auth/me", Some(&live), None) + .await + .status, StatusCode::OK, "resuming restores the very same session" ); @@ -374,7 +389,11 @@ async fn resetting_an_admin_password_revokes_the_old_credential_and_its_sessions .unwrap(); hezarfen_backend::domain::user::User::create( Username::try_new("veli").unwrap(), - Password::try_new("secret1").unwrap().hash_async().await.unwrap(), + Password::try_new("secret1") + .unwrap() + .hash_async() + .await + .unwrap(), &gamma_db, ) .await @@ -632,8 +651,8 @@ async fn probe_hostile_slug_segments_never_delete_anything() { "Demo", "control", "builder", - "%C4%B1demo", // dotless i, non-ascii - "d%E2%80%8Bemo", // zero-width space + "%C4%B1demo", // dotless i, non-ascii + "d%E2%80%8Bemo", // zero-width space "de%20mo", "a", "-lead", @@ -675,12 +694,25 @@ async fn probe_hostile_slug_segments_never_delete_anything() { // Also the empty segment, which is a different route shape entirely. for method in ["GET", "DELETE", "PATCH"] { let res = send(&app, method, "/schools/", Some(&builder), None).await; - assert!(!res.status.is_success() || method == "GET", "{method} /schools/ -> {}", res.status); + assert!( + !res.status.is_success() || method == "GET", + "{method} /schools/ -> {}", + res.status + ); } - assert!(keep_dir.join("keep.bin").exists(), "a bystander school lost its bytes"); - assert!(root_canary.exists(), "the FILES_PATH root canary was deleted"); - assert!(outside_file.exists(), "a file outside FILES_PATH was deleted"); + assert!( + keep_dir.join("keep.bin").exists(), + "a bystander school lost its bytes" + ); + assert!( + root_canary.exists(), + "the FILES_PATH root canary was deleted" + ); + assert!( + outside_file.exists(), + "a file outside FILES_PATH was deleted" + ); assert!( files_dir().exists() && outside.path().exists(), "a directory root was removed" @@ -784,7 +816,14 @@ async fn probe_remote_mode_database_statements_execute_for_every_accepted_slug() let mut broken: Vec = Vec::new(); for raw in [ - "demo", "abc", "ata-koleji", "x-y", "trail-", "2024school", "12345", "a1", + "demo", + "abc", + "ata-koleji", + "x-y", + "trail-", + "2024school", + "12345", + "a1", ] { let Ok(slug) = Slug::try_new(raw) else { continue; @@ -820,8 +859,23 @@ async fn probe_remote_mode_database_statements_execute_for_every_accepted_slug() #[tokio::test] async fn probe_slug_accept_set_and_published_reserved_list() { for bad in [ - "control", "builder", "Demo", "DEMO", "..", "", "a", "-lead", "de mo", "de.mo", "de_mo", - "demo/", "demo\\", "٢٣demo", "démo", "demo\u{200b}", "demo\n", + "control", + "builder", + "Demo", + "DEMO", + "..", + "", + "a", + "-lead", + "de mo", + "de.mo", + "de_mo", + "demo/", + "demo\\", + "٢٣demo", + "démo", + "demo\u{200b}", + "demo\n", // 33 characters "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ] { @@ -831,7 +885,10 @@ async fn probe_slug_accept_set_and_published_reserved_list() { ); } for good in ["ab", "demo", "a1", "2024", "ata-koleji"] { - assert!(Slug::try_new(good).is_ok(), "Slug::try_new rejected {good:?}"); + assert!( + Slug::try_new(good).is_ok(), + "Slug::try_new rejected {good:?}" + ); } // Documented boundary: a trailing hyphen IS accepted today. assert!( @@ -971,7 +1028,9 @@ async fn probe_admin_targets_and_reset_revokes_all_sessions() { assert_eq!(reset.status, StatusCode::NO_CONTENT); for (n, cookie) in [(1, &s1), (2, &s2)] { assert_eq!( - send(&app, "GET", "/auth/me", Some(cookie), None).await.status, + send(&app, "GET", "/auth/me", Some(cookie), None) + .await + .status, StatusCode::UNAUTHORIZED, "session {n} survived the password reset" ); @@ -1036,9 +1095,7 @@ async fn probe_builder_session_hygiene() { let builder = builder_login(&app).await; let student = login(&app, "veli").await; - let builder_token = builder - .trim_start_matches("session=builder.") - .to_string(); + let builder_token = builder.trim_start_matches("session=builder.").to_string(); let student_token = cookie_token(&student).to_string(); // The builder's own token, worn as a school cookie. @@ -1116,7 +1173,9 @@ async fn probe_builder_session_hygiene() { ); // Logout is idempotent and safe without a cookie. assert_eq!( - send(&app, "POST", "/builder/logout", None, None).await.status, + send(&app, "POST", "/builder/logout", None, None) + .await + .status, StatusCode::NO_CONTENT ); } @@ -1283,7 +1342,11 @@ async fn probe_remote_deployment_creates_and_deletes_a_hyphenated_school() { login.status, ); assert_eq!(retry.status, StatusCode::CONFLICT, "a made school is taken"); - assert_eq!(login.status, StatusCode::OK, "the admin logs into the hyphenated school"); + assert_eq!( + login.status, + StatusCode::OK, + "the admin logs into the hyphenated school" + ); assert_eq!(deleted.status, StatusCode::NO_CONTENT); assert!(!listed(&after_delete.body)); assert_eq!( diff --git a/tests/spec_bounds.rs b/tests/spec_bounds.rs index 74d0b2a..acfcce8 100644 --- a/tests/spec_bounds.rs +++ b/tests/spec_bounds.rs @@ -64,8 +64,18 @@ fn expectations() -> Vec<(&'static str, &'static str, &'static str, i64)> { // --- builder (the vendor surface) --- ("CreateSchool", "slug", "minLength", MIN_SLUG_LEN as i64), ("CreateSchool", "slug", "maxLength", MAX_SLUG_LEN as i64), - ("CreateSchool", "name", "maxLength", MAX_SCHOOL_NAME_LEN as i64), - ("UpdateSchool", "name", "maxLength", MAX_SCHOOL_NAME_LEN as i64), + ( + "CreateSchool", + "name", + "maxLength", + MAX_SCHOOL_NAME_LEN as i64, + ), + ( + "UpdateSchool", + "name", + "maxLength", + MAX_SCHOOL_NAME_LEN as i64, + ), ( "CreateSchool", "admin_username",