mirror of
https://github.com/goharbor/harbor
synced 2025-05-07 21:10:39 +00:00
Adjust the audit_log_ext column size to keep align with audit_log table (#21678)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
This commit is contained in:
parent
5c39e76ac4
commit
b9528d8deb
@ -6,10 +6,10 @@ CREATE TABLE IF NOT EXISTS audit_log_ext
|
||||
id BIGSERIAL PRIMARY KEY NOT NULL,
|
||||
project_id BIGINT,
|
||||
operation VARCHAR(50) NULL,
|
||||
resource_type VARCHAR(50) NULL,
|
||||
resource VARCHAR(50) NULL,
|
||||
username VARCHAR(50) NULL,
|
||||
op_desc VARCHAR(500) NULL,
|
||||
resource_type VARCHAR(255) NULL,
|
||||
resource VARCHAR(1024) NULL,
|
||||
username VARCHAR(255) NULL,
|
||||
op_desc VARCHAR(1024) NULL,
|
||||
op_result BOOLEAN DEFAULT true,
|
||||
payload TEXT NULL,
|
||||
source_ip VARCHAR(50) NULL,
|
||||
|
@ -65,7 +65,7 @@ func (h *Handler) Handle(ctx context.Context, value interface{}) error {
|
||||
if auditLog != nil && config.AuditLogEventEnabled(ctx, fmt.Sprintf("%v_%v", auditLog.Operation, auditLog.ResourceType)) {
|
||||
_, err := auditext.Mgr.Create(ctx, auditLog)
|
||||
if err != nil {
|
||||
log.Debugf("add audit log err: %v", err)
|
||||
log.Infof("add audit log err: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,9 @@ func init() {
|
||||
commonevent.RegisterResolver(`/api/v2.0/configurations`, configureEventResolver)
|
||||
}
|
||||
|
||||
const payloadSizeLimit = 450
|
||||
// payloadSizeLimit max size allowed in the op_desc
|
||||
// the size of audit_log_ext's op_desc - 50
|
||||
const payloadSizeLimit = 950
|
||||
|
||||
// resolver used to resolve the configuration event
|
||||
type resolver struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user