audit.proto — Tamper-evident audit chain
Schema: tiyi.v1 · audit.proto · English guide · 中文指南 · Full RPC index
Services
AuditService
| RPC | Kind | Required permission |
|---|---|---|
QueryAudit |
unary | (audit:read) |
GetAuditEntry |
unary | (audit:read) |
GetChainStatus |
unary | (audit:read) |
VerifyChain |
unary | (audit:verify) |
RPCs
AuditService.QueryAudit
- Procedure
POST /tiyi.v1.AuditService/QueryAudit - Kind unary
- Auth (
audit:read)
Request — tiyi.v1.QueryAuditRequest
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
page |
page |
CursorRequest |
singular | — |
time_range |
timeRange |
TimeRange |
singular | — |
actor_id |
actorId |
string |
singular | — |
action |
action |
string |
singular | — |
resource_type |
resourceType |
string |
singular | — |
resource_id |
resourceId |
string |
singular | — |
actor_query |
actorQuery |
string |
singular | — |
outcome |
outcome |
string |
singular | — |
actor_ip |
actorIp |
string |
singular | — |
Response — tiyi.v1.QueryAuditResponse
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
items |
items |
AuditEntry |
repeated | — |
page |
page |
CursorResponse |
singular | — |
total |
total |
int64 |
singular | Total rows matching the tenant and active filters. Web clients use this with CursorRequest.offset for direct, server-backed page navigation. JSON string (64-bit ints are quoted). |
AuditService.GetAuditEntry
- Procedure
POST /tiyi.v1.AuditService/GetAuditEntry - Kind unary
- Auth (
audit:read)
Request — tiyi.v1.GetAuditEntryRequest
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
id |
id |
string |
singular | — |
Response — tiyi.v1.GetAuditEntryResponse
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
entry |
entry |
AuditEntry |
singular | — |
AuditService.GetChainStatus
- Procedure
POST /tiyi.v1.AuditService/GetChainStatus - Kind unary
- Auth (
audit:read)
Request — tiyi.v1.GetChainStatusRequest
No fields — send {}.
Response — tiyi.v1.GetChainStatusResponse
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
healthy |
healthy |
bool |
singular | — |
latest_hash |
latestHash |
string |
singular | — |
latest_verified_at |
latestVerifiedAt |
google.protobuf.Timestamp |
singular | RFC 3339 string, e.g. 2026-07-26T09:00:00Z. |
breaks |
breaks |
ChainBreak |
repeated | — |
checked_rows |
checkedRows |
int64 |
singular | JSON string (64-bit ints are quoted). |
AuditService.VerifyChain
- Procedure
POST /tiyi.v1.AuditService/VerifyChain - Kind unary
- Auth (
audit:verify)
Request — tiyi.v1.VerifyChainRequest
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
time_range |
timeRange |
TimeRange |
singular | — |
Response — tiyi.v1.VerifyChainResponse
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
healthy |
healthy |
bool |
singular | — |
breaks |
breaks |
ChainBreak |
repeated | — |
verified_at |
verifiedAt |
google.protobuf.Timestamp |
singular | RFC 3339 string, e.g. 2026-07-26T09:00:00Z. |
time_range |
timeRange |
TimeRange |
singular | — |
checked_rows |
checkedRows |
int64 |
singular | JSON string (64-bit ints are quoted). |
latest_hash |
latestHash |
string |
singular | — |
Messages
AuditEntry
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
id |
id |
string |
singular | — |
tenant_id |
tenantId |
string |
singular | — |
actor_id |
actorId |
string |
singular | — |
action |
action |
string |
singular | — |
resource_type |
resourceType |
string |
singular | — |
resource_id |
resourceId |
string |
singular | — |
diff |
diff |
JsonPatch |
singular | — |
prev_hash |
prevHash |
string |
singular | — |
hash |
hash |
string |
singular | — |
created_at |
createdAt |
google.protobuf.Timestamp |
singular | RFC 3339 string, e.g. 2026-07-26T09:00:00Z. |
metadata |
metadata |
google.protobuf.Struct |
singular | free-form JSON object. |
actor_name |
actorName |
string |
singular | Current display name (falling back to username) for the canonical actor_id. |
resource_name |
resourceName |
string |
singular | Best-effort resource label captured from this row's immutable diff. |
ChainBreak
| Field | JSON key | Type | Cardinality | Description |
|---|---|---|---|---|
row_id |
rowId |
string |
singular | — |
created_at |
createdAt |
google.protobuf.Timestamp |
singular | RFC 3339 string, e.g. 2026-07-26T09:00:00Z. |
expected_prev_hash |
expectedPrevHash |
string |
singular | — |
actual_prev_hash |
actualPrevHash |
string |
singular | — |
expected_row_hash |
expectedRowHash |
string |
singular | — |
actual_row_hash |
actualRowHash |
string |
singular | — |