[MM-64686] Expose audit logging functionality via plugin API (#31204)

This commit exposes audit logging functionality to plugins via the plugin API, allowing plugins to create and log audit records. Additionally, it addresses a gob encoding issue that could cause plugin crashes when audit data contains nil pointers or unregistered types.
Этот коммит содержится в:
David Krauser
2025-06-25 20:37:32 -04:00
коммит произвёл GitHub
родитель efb960a160
Коммит aaa62a40ae
68 изменённых файлов: 878 добавлений и 750 удалений

Просмотреть файл

@@ -8,6 +8,8 @@ import (
io "io"
http "net/http"
logr "github.com/mattermost/logr/v2"
mock "github.com/stretchr/testify/mock"
model "github.com/mattermost/mattermost/server/public/model"
@@ -4312,6 +4314,16 @@ func (_m *API) LoadPluginConfiguration(dest interface{}) error {
return r0
}
// LogAuditRec provides a mock function with given fields: rec
func (_m *API) LogAuditRec(rec *model.AuditRecord) {
_m.Called(rec)
}
// LogAuditRecWithLevel provides a mock function with given fields: rec, level
func (_m *API) LogAuditRecWithLevel(rec *model.AuditRecord, level logr.Level) {
_m.Called(rec, level)
}
// LogDebug provides a mock function with given fields: msg, keyValuePairs
func (_m *API) LogDebug(msg string, keyValuePairs ...interface{}) {
var _ca []interface{}