feat(storage): add audit persistence
This commit is contained in:
26
backend/internal/audit/record.go
Normal file
26
backend/internal/audit/record.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package audit
|
||||
|
||||
import "time"
|
||||
|
||||
type Status string
|
||||
|
||||
const (
|
||||
StatusSuccess Status = "success"
|
||||
StatusValidationFailed Status = "validation_failed"
|
||||
StatusAuthenticationError Status = "authentication_error"
|
||||
StatusUpstreamRejected Status = "upstream_rejected"
|
||||
StatusUpstreamTimeout Status = "upstream_timeout"
|
||||
StatusUpstreamUnavailable Status = "upstream_unavailable"
|
||||
StatusInternalError Status = "internal_error"
|
||||
)
|
||||
|
||||
type Record struct {
|
||||
RequestID string
|
||||
CreatedAt time.Time
|
||||
Duration time.Duration
|
||||
ClientIP *string
|
||||
Status Status
|
||||
UpstreamHTTPStatus *int
|
||||
MaskedCard string
|
||||
ResponseJSON []byte
|
||||
}
|
||||
Reference in New Issue
Block a user