[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,6 +10,7 @@ import (
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
||||
)
|
||||
|
||||
// The API can be used to retrieve data or perform actions on behalf of the plugin. Most methods
|
||||
@@ -1537,6 +1538,18 @@ type API interface {
|
||||
// @tag PropertyValue
|
||||
// Minimum server version: 10.10
|
||||
DeletePropertyValuesForField(groupID, fieldID string) error
|
||||
|
||||
// LogAuditRec logs an audit record using the default audit logger.
|
||||
//
|
||||
// @tag Audit
|
||||
// Minimum server version: 10.10
|
||||
LogAuditRec(rec *model.AuditRecord)
|
||||
|
||||
// LogAuditRecWithLevel logs an audit record with a specific log level.
|
||||
//
|
||||
// @tag Audit
|
||||
// Minimum server version: 10.10
|
||||
LogAuditRecWithLevel(rec *model.AuditRecord, level mlog.Level)
|
||||
}
|
||||
|
||||
var handshake = plugin.HandshakeConfig{
|
||||
|
||||
Ссылка в новой задаче
Block a user