[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.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
efb960a160
Коммит
aaa62a40ae
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/request"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/app"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/audit"
|
||||
"github.com/mattermost/mattermost/server/v8/config"
|
||||
)
|
||||
|
||||
@@ -59,7 +59,7 @@ func jobserverCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
if !noJobs || !noSchedule {
|
||||
auditRec := a.MakeAuditRecord(rctx, "jobServer", audit.Success)
|
||||
auditRec := a.MakeAuditRecord(rctx, "jobServer", model.AuditStatusSuccess)
|
||||
a.LogAuditRec(rctx, auditRec, nil)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user