Files
Genarrative/server-rs/crates/spacetime-client/src/auth.rs
T
kdletters 47083bfe05 切断认证快照同步路径
删除 auth_store_snapshot 表和旧 JSON 快照 procedure。

改用 AuthStoreProjectionView 同步 user_account、auth_identity 和 refresh_session。

让 auth 服务从 user_account 投影恢复内存工作集。

同步生成绑定、schema guard 和后端架构文档。
2026-07-01 19:07:21 +08:00

43 lines
1.5 KiB
Rust

use super::*;
impl SpacetimeClient {
pub async fn export_auth_store_projection_from_tables(
&self,
) -> Result<module_auth::AuthStoreProjectionView, SpacetimeClientError> {
self.call_after_connect(
"export_auth_store_projection_from_tables",
move |connection, sender| {
connection
.procedures()
.export_auth_store_projection_from_tables_then(move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_projection_procedure_result);
send_once(&sender, mapped);
});
},
)
.await
}
pub async fn sync_auth_store_projection(
&self,
view: module_auth::AuthStoreProjectionView,
) -> Result<AuthStoreProjectionSyncRecord, SpacetimeClientError> {
let procedure_input = map_auth_store_projection_view_input(view);
self.call_after_connect("sync_auth_store_projection", move |connection, sender| {
connection.procedures().sync_auth_store_projection_then(
procedure_input,
move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_projection_sync_procedure_result);
send_once(&sender, mapped);
},
);
})
.await
}
}