修复(会员审计): 后台改档时间改用 SpacetimeDB 事务时间
- upsert_profile_membership_plan_record 不再信任入参 updated_at_micros - updated_at / created_at 统一取 ctx.timestamp,客户端时钟无法伪造审计时间
This commit is contained in:
@@ -8814,7 +8814,9 @@ fn upsert_profile_membership_plan_record(
|
||||
.map_err(|error| error.to_string())?;
|
||||
ensure_default_profile_membership_plan(ctx);
|
||||
|
||||
let updated_at = Timestamp::from_micros_since_unix_epoch(validated.updated_at_micros);
|
||||
// 审计时间以 SpacetimeDB 事务时间为准:入参 `updated_at_micros` 不再被信任,
|
||||
// 因为 procedure 可被持有 writer 身份者直接调用,客户端时钟可以伪造。
|
||||
let updated_at = ctx.timestamp;
|
||||
let existing = ctx
|
||||
.db
|
||||
.profile_membership_plan()
|
||||
|
||||
Reference in New Issue
Block a user