Files
Mazyar 241e3b5f2d Implement audit logging functionality across services and middleware
- Introduced a new `auditlog` package to handle audit logging for user actions, including creation, updates, deletions, and authentication events.
- Enhanced existing services (customer, user) to log relevant actions using the new audit logger, capturing details such as actor ID, action type, target type, and success status.
- Added middleware to enrich request context with metadata for audit logging, ensuring comprehensive tracking of user interactions.
- Integrated Elasticsearch for persistent storage of audit logs, with fallback to file-only logging if Elasticsearch is unavailable.
- Updated API documentation to include new audit log endpoints for administrative access.

This update significantly improves the system's ability to track and audit user actions, enhancing security and accountability within the application.
2026-06-29 21:11:33 +03:30

19 lines
460 B
Go

package elasticsearch
import "context"
type noopClient struct{}
// NewNoopClient returns a client that performs no Elasticsearch operations.
func NewNoopClient() Client {
return noopClient{}
}
func (noopClient) Index(context.Context, AuditDocument) error { return nil }
func (noopClient) Search(context.Context, SearchFilter) (*SearchResult, error) {
return &SearchResult{Items: []AuditDocument{}}, nil
}
func (noopClient) Close() error { return nil }