Documentation
¶
Overview ¶
Package adminaudit carries non-secret administrator provenance into business transactions, and owns the rules for recording it and the audit log's read models. persistence/postgres/auditpg stores it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidQuery = errors.New("invalid administrator audit query")
ErrInvalidQuery reports an audit log query with an invalid filter, page size or cursor.
var ErrInvalidSource = errors.New("invalid administrator audit source")
ErrInvalidSource reports an administrator mutation record that cannot be recorded: missing or malformed provenance, or a malformed action or resource. The mutation it belongs to fails closed.
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
ProjectID, ResourceType, ResourceID, Action, After string
CreatedAfter, CreatedBefore *time.Time
Limit int
}
Filter selects committed administrator mutations, newest first. A zero Limit is the default page size.
type Operation ¶
type Operation struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
AdminCredentialID string `json:"admin_credential_id"`
ActorLabel string `json:"actor_label"`
Action string `json:"action"`
ProjectID *string `json:"project_id" extensions:"x-nullable"`
ResourceType string `json:"resource_type"`
ResourceID string `json:"resource_id"`
ResultIDs json.RawMessage `json:"result_ids" swaggertype:"array,object"`
RequestID string `json:"request_id"`
TraceID string `json:"trace_id"`
}
Operation is one administrator write. ProjectID is null for deployment-wide writes, such as deployment default model providers.
type Reader ¶
Reader reads committed administrator mutations as safe metadata, never request bodies or secrets.
type Source ¶
type Source struct {
CredentialID string
ActorLabel string
RequestID string
TraceID string
ProjectID string
}
func (Source) ValidateDeploymentMutation ¶
ValidateDeploymentMutation checks the record of a deployment-wide mutation, which has no Project, so s names none.
func (Source) ValidateProjectMutation ¶
ValidateProjectMutation checks the record of a mutation in the Project that s names.