Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(lg mlog.Logger, tl *mopentelemetry.Telemetry, cc *mcasdoor.CasdoorConnection, th *TrillianHandler) *fiber.App
func WithSwaggerEnvConfig ¶
func WithSwaggerEnvConfig() fiber.Handler
WithSwaggerEnvConfig sets the Swagger configuration for the API documentation from environment variables if they are set.
Types ¶
type HashValidationResponse ¶
type HashValidationResponse struct { AuditID string `json:"auditId"` ExpectedHash string `json:"expectedHash"` CalculatedHash string `json:"calculatedHash"` IsTampered bool `json:"isTampered"` } // @Name HashValidationResponse
HashValidationResponse encapsulates auditing validation results
swagger:model HashValidationResponse @Description HashValidationResponse show if any of the logs has been tampered
type Leaf ¶
type Leaf struct { LeafID string `json:"leaf_id"` Body json.RawMessage `json:"body"` } // @Name Leaf
Leaf encapsulates audit log values
swagger:model Leaf @Description Leaf stores each audit log
type LogsResponse ¶
type LogsResponse struct { TreeID int64 `json:"tree_id"` Leaves []Leaf `json:"leaves"` } // @name LogsResponse
LogsResponse is a struct to encapsulate audit logs response
swagger:model LogsResponse @Description LogsResponse is the response with audit log values
type TrillianHandler ¶
func (*TrillianHandler) AuditLogs ¶
func (th *TrillianHandler) AuditLogs(c *fiber.Ctx) error
AuditLogs compares leaf hash with a hash generated from the leaf value
@Summary Audit logs by reference ID @Description Audit logs to check if any was tampered @Tags Audit @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param audit_id path string true "Audit ID" @Success 200 {object} HashValidationResponse @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/audit/{audit_id}/audit-logs [get]
func (*TrillianHandler) ReadLogs ¶
func (th *TrillianHandler) ReadLogs(c *fiber.Ctx) error
ReadLogs retrieves log values by the audit id
@Summary Get logs by reference ID @Description Get log values from Trillian by reference ID @Tags Audit @Produce json @Param Authorization header string true "Authorization Bearer Token" @Param Midaz-Id header string false "Request ID" @Param organization_id path string true "Organization ID" @Param ledger_id path string true "Ledger ID" @Param audit_id path string true "Audit ID" @Success 200 {object} LogsResponse @Router /v1/organizations/{organization_id}/ledgers/{ledger_id}/audit/{audit_id}/read-logs [get]