feat: establish Orbit models, migrations and development baseline
This commit is contained in:
32
platform/model/audit_event.go
Normal file
32
platform/model/audit_event.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||||
)
|
||||
|
||||
// AuditEvent 表示不可改写的管理审计,保留操作身份、原因和变更摘要。
|
||||
// 对应表 orbit_audit_events;这是服务端持久化模型,不直接作为 API 响应。
|
||||
type AuditEvent struct {
|
||||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||||
core.Record
|
||||
// OperationID 管理操作的稳定身份,重复操作必须保留同一身份。
|
||||
OperationID core.ID `db:"operation_id"`
|
||||
// ActorID 经认证的操作主体标识,不能直接信任请求自报值。
|
||||
ActorID string `db:"actor_id"`
|
||||
// Action 执行的管理动作,例如暂停、取消或核查。
|
||||
Action string `db:"action"`
|
||||
// ResourceKind 关联资源类型;多态关联需要服务层额外校验。
|
||||
ResourceKind string `db:"resource_kind"`
|
||||
// ResourceID 关联资源标识,不能单独作为访问授权依据。
|
||||
ResourceID core.ID `db:"resource_id"`
|
||||
// Reason 操作原因或处理说明,需要保留审计信息。
|
||||
Reason string `db:"reason"`
|
||||
// Before 操作前的受控摘要 JSON,须脱敏。
|
||||
Before core.JSON `db:"before"`
|
||||
// After 操作后的受控摘要 JSON,须脱敏。
|
||||
After core.JSON `db:"after"`
|
||||
// EvidenceRef 业务核查证据的引用;为空表示没有附加引用。
|
||||
EvidenceRef *string `db:"evidence_ref"`
|
||||
}
|
||||
|
||||
func (AuditEvent) TableName() string { return "orbit_audit_events" }
|
||||
Reference in New Issue
Block a user