feat(kanban): partition local queues by account

req: sync/020

req: auth/005

req: security/004

req: operations/002
This commit is contained in:
slhx agent
2026-07-13 19:00:04 +02:00
parent 6de4dcb73b
commit 3ef84e7331
7 changed files with 239 additions and 95 deletions
+18
View File
@@ -428,6 +428,7 @@ async fn main() {
.route("/events", get(events))
.route("/sync-demo", get(sync_demo))
.route("/sync.js", get(sync_js))
.route("/sync/context", get(sync_context))
.route("/sync/commands", post(sync_command))
.route("/sync/acknowledgements", get(sync_acknowledgements))
.route("/sync/snapshot", get(sync_snapshot))
@@ -585,6 +586,23 @@ fn current_sync_principal(
))
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct SyncContext {
account_partition: String,
}
// req: sync/020 req: auth/005
async fn sync_context(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
) -> Result<Json<SyncContext>, SyncRejection> {
let principal = current_sync_principal(&headers, &state.sync_sessions)?;
Ok(Json(SyncContext {
account_partition: format!("{}:{}", principal.tenant, principal.principal),
}))
}
fn authorize_sync_replay(
principal: CurrentSyncPrincipal,
card_id: u64,