feat(health): family_member + doctor_profile PII 加密
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 迁移 m000067: patient_family_member 添加 phone_hash + key_version
- 迁移 m000068: doctor_profile 添加 license_number_hash + key_version
- family_member: phone 加密 + HMAC 索引 + 列表脱敏
- doctor_profile: license_number 加密 + HMAC 搜索重写 + 详情解密
- 列表中 Tier 1 字段返回 None
This commit is contained in:
iven
2026-04-26 12:23:10 +08:00
parent 2474905727
commit cb3653c92e
7 changed files with 213 additions and 22 deletions

View File

@@ -19,6 +19,8 @@ pub struct Model {
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub license_number: Option<String>,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub license_number_hash: Option<String>,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub bio: Option<String>,
pub online_status: String,
pub created_at: DateTimeUtc,
@@ -30,6 +32,8 @@ pub struct Model {
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<DateTimeUtc>,
pub version: i32,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub key_version: Option<i32>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View File

@@ -13,6 +13,8 @@ pub struct Model {
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub phone_hash: Option<String>,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub birth_date: Option<chrono::NaiveDate>,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub notes: Option<String>,
@@ -25,6 +27,8 @@ pub struct Model {
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<DateTimeUtc>,
pub version: i32,
#[sea_orm(skip_serializing_if = "Option::is_none")]
pub key_version: Option<i32>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]