|
@@ -3784,8 +3784,8 @@ func TestEventRule(t *testing.T) {
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]", "[email protected]"},
|
|
|
Bcc: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" from "{{Name}}" status {{StatusString}}`,
|
|
|
- Body: "Fs path {{FsPath}}, size: {{FileSize}}, protocol: {{Protocol}}, IP: {{IP}} Data: {{ObjectData}} {{ErrorString}}",
|
|
|
+ Subject: `New "{{.Event}}" from "{{.Name}}" status {{.StatusString}}`,
|
|
|
+ Body: "Fs path {{.FsPath}}, size: {{.FileSize}}, protocol: {{.Protocol}}, IP: {{.IP}} Data: {{.ObjectData}} {{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -3795,8 +3795,8 @@ func TestEventRule(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `Failed "{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Fs path {{FsPath}}, protocol: {{Protocol}}, IP: {{IP}} {{ErrorString}}",
|
|
|
+ Subject: `Failed "{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Fs path {{.FsPath}}, protocol: {{.Protocol}}, IP: {{.IP}} {{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -3941,7 +3941,7 @@ func TestEventRule(t *testing.T) {
|
|
|
EnvVars: []dataprovider.KeyValue{
|
|
|
{
|
|
|
Key: "SFTPGO_ACTION_PATH",
|
|
|
- Value: "{{FsPath}}",
|
|
|
+ Value: "{{.FsPath}}",
|
|
|
},
|
|
|
{
|
|
|
Key: "CUSTOM_ENV_VAR",
|
|
@@ -4050,7 +4050,7 @@ func TestEventRule(t *testing.T) {
|
|
|
assert.Contains(t, email.Data, fmt.Sprintf(`Subject: New "download" from "%s"`, user.Username))
|
|
|
}
|
|
|
// test upload action command with arguments
|
|
|
- action1.Options.CmdConfig.Args = []string{"{{Event}}", "{{VirtualPath}}", "custom_arg"}
|
|
|
+ action1.Options.CmdConfig.Args = []string{"{{.Event}}", "{{.VirtualPath}}", "custom_arg"}
|
|
|
action1, _, err = httpdtest.UpdateEventAction(action1, http.StatusOK)
|
|
|
assert.NoError(t, err)
|
|
|
uploadLogFilePath := filepath.Join(os.TempDir(), "upload.log")
|
|
@@ -4128,8 +4128,8 @@ func TestEventRuleStatues(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" error`,
|
|
|
- Body: "{{ErrorString}}",
|
|
|
+ Subject: `New "{{.Event}}" error`,
|
|
|
+ Body: "{{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4241,7 +4241,7 @@ func TestEventRuleDisabledCommand(t *testing.T) {
|
|
|
EnvVars: []dataprovider.KeyValue{
|
|
|
{
|
|
|
Key: "SFTPGO_OBJECT_DATA",
|
|
|
- Value: "{{ObjectData}}",
|
|
|
+ Value: "{{.ObjectData}}",
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -4253,8 +4253,8 @@ func TestEventRuleDisabledCommand(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Object name: {{ObjectName}} object type: {{ObjectType}} Data: {{ObjectData}}",
|
|
|
+ Subject: `New "{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Object name: {{.ObjectName}} object type: {{.ObjectType}} Data: {{.ObjectData}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4265,8 +4265,8 @@ func TestEventRuleDisabledCommand(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `Failed "{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Object name: {{ObjectName}} object type: {{ObjectType}}, IP: {{IP}}",
|
|
|
+ Subject: `Failed "{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Object name: {{.ObjectName}} object type: {{.ObjectType}}, IP: {{.IP}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4390,7 +4390,7 @@ func TestEventRuleProviderEvents(t *testing.T) {
|
|
|
EnvVars: []dataprovider.KeyValue{
|
|
|
{
|
|
|
Key: "SFTPGO_OBJECT_DATA",
|
|
|
- Value: "{{ObjectData}}",
|
|
|
+ Value: "{{.ObjectData}}",
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -4402,8 +4402,8 @@ func TestEventRuleProviderEvents(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Object name: {{ObjectName}} object type: {{ObjectType}} Data: {{ObjectData}}",
|
|
|
+ Subject: `New "{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Object name: {{.ObjectName}} object type: {{.ObjectType}} Data: {{.ObjectData}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4414,8 +4414,8 @@ func TestEventRuleProviderEvents(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `Failed "{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Object name: {{ObjectName}} object type: {{ObjectType}}, IP: {{IP}}",
|
|
|
+ Subject: `Failed "{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Object name: {{.ObjectName}} object type: {{.ObjectType}}, IP: {{.IP}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4561,8 +4561,8 @@ func TestEventRuleFsActions(t *testing.T) {
|
|
|
Renames: []dataprovider.RenameConfig{
|
|
|
{
|
|
|
KeyValue: dataprovider.KeyValue{
|
|
|
- Key: "/{{VirtualDirPath}}/{{ObjectName}}",
|
|
|
- Value: "/{{ObjectName}}_renamed",
|
|
|
+ Key: "/{{.VirtualDirPath}}/{{.ObjectName}}",
|
|
|
+ Value: "/{{.ObjectName}}_renamed",
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -4575,7 +4575,7 @@ func TestEventRuleFsActions(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
FsConfig: dataprovider.EventActionFilesystemConfig{
|
|
|
Type: dataprovider.FilesystemActionDelete,
|
|
|
- Deletes: []string{"/{{ObjectName}}_renamed"},
|
|
|
+ Deletes: []string{"/{{.ObjectName}}_renamed"},
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4593,7 +4593,7 @@ func TestEventRuleFsActions(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
FsConfig: dataprovider.EventActionFilesystemConfig{
|
|
|
Type: dataprovider.FilesystemActionExist,
|
|
|
- Exist: []string{"/{{VirtualPath}}"},
|
|
|
+ Exist: []string{"/{{.VirtualPath}}"},
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -4831,8 +4831,8 @@ func TestEventActionObjectBaseName(t *testing.T) {
|
|
|
Renames: []dataprovider.RenameConfig{
|
|
|
{
|
|
|
KeyValue: dataprovider.KeyValue{
|
|
|
- Key: "/{{VirtualDirPath}}/{{ObjectName}}",
|
|
|
- Value: "/{{ObjectBaseName}}",
|
|
|
+ Key: "/{{.VirtualDirPath}}/{{.ObjectName}}",
|
|
|
+ Value: "/{{.ObjectBaseName}}",
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -4911,8 +4911,8 @@ func TestUploadEventRule(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" from "{{Name}}" status {{StatusString}}`,
|
|
|
- Body: "Fs path {{FsPath}}, size: {{FileSize}}, protocol: {{Protocol}}, IP: {{IP}} Data: {{ObjectData}} {{ErrorString}}",
|
|
|
+ Subject: `New "{{.Event}}" from "{{.Name}}" status {{.StatusString}}`,
|
|
|
+ Body: "Fs path {{.FsPath}}, size: {{.FileSize}}, protocol: {{.Protocol}}, IP: {{.IP}} Data: {{.ObjectData}} {{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -5047,8 +5047,8 @@ func TestEventRulePreDelete(t *testing.T) {
|
|
|
Renames: []dataprovider.RenameConfig{
|
|
|
{
|
|
|
KeyValue: dataprovider.KeyValue{
|
|
|
- Key: "/{{VirtualPath}}",
|
|
|
- Value: fmt.Sprintf("/%s/{{VirtualPath}}", movePath),
|
|
|
+ Key: "/{{.VirtualPath}}",
|
|
|
+ Value: fmt.Sprintf("/%s/{{.VirtualPath}}", movePath),
|
|
|
},
|
|
|
UpdateModTime: true,
|
|
|
},
|
|
@@ -5410,7 +5410,7 @@ func TestFsActionCopy(t *testing.T) {
|
|
|
Type: dataprovider.FilesystemActionCopy,
|
|
|
Copy: []dataprovider.KeyValue{
|
|
|
{
|
|
|
- Key: "/{{VirtualPath}}/",
|
|
|
+ Key: "/{{.VirtualPath}}/",
|
|
|
Value: "/dircopy/",
|
|
|
},
|
|
|
},
|
|
@@ -5492,8 +5492,8 @@ func TestEventFsActionsGroupFilters(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" from "{{Name}}" status {{StatusString}}`,
|
|
|
- Body: "Fs path {{FsPath}}, size: {{FileSize}}, protocol: {{Protocol}}, IP: {{IP}} {{ErrorString}}",
|
|
|
+ Subject: `New "{{.Event}}" from "{{.Name}}" status {{.StatusString}}`,
|
|
|
+ Body: "Fs path {{.FsPath}}, size: {{.FileSize}}, protocol: {{.Protocol}}, IP: {{.IP}} {{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -5623,8 +5623,8 @@ func TestEventProviderActionGroupFilters(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `New "{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "IP: {{IP}}",
|
|
|
+ Subject: `New "{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "IP: {{.IP}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -5759,9 +5759,9 @@ func TestBackupAsAttachment(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}} {{StatusString}}"`,
|
|
|
- Body: "Domain: {{Name}}",
|
|
|
- Attachments: []string{"/{{VirtualPath}}"},
|
|
|
+ Subject: `"{{.Event}} {{.StatusString}}"`,
|
|
|
+ Body: "Domain: {{.Name}}",
|
|
|
+ Attachments: []string{"/{{.VirtualPath}}"},
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -5840,11 +5840,11 @@ func TestEventActionHTTPMultipart(t *testing.T) {
|
|
|
Value: "application/json",
|
|
|
},
|
|
|
},
|
|
|
- Body: `{"FilePath": "{{VirtualPath}}"}`,
|
|
|
+ Body: `{"FilePath": "{{.VirtualPath}}"}`,
|
|
|
},
|
|
|
{
|
|
|
Name: "file",
|
|
|
- Filepath: "/{{VirtualPath}}",
|
|
|
+ Filepath: "/{{.VirtualPath}}",
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -5920,8 +5920,8 @@ func TestEventActionCompress(t *testing.T) {
|
|
|
FsConfig: dataprovider.EventActionFilesystemConfig{
|
|
|
Type: dataprovider.FilesystemActionCompress,
|
|
|
Compress: dataprovider.EventActionFsCompress{
|
|
|
- Name: "/{{VirtualPath}}.zip",
|
|
|
- Paths: []string{"/{{VirtualPath}}"},
|
|
|
+ Name: "/{{.VirtualPath}}.zip",
|
|
|
+ Paths: []string{"/{{.VirtualPath}}"},
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -6091,7 +6091,7 @@ func TestEventActionCompressQuotaErrors(t *testing.T) {
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
Subject: `"Compress failed"`,
|
|
|
- Body: "Error: {{ErrorString}}",
|
|
|
+ Body: "Error: {{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -6235,8 +6235,8 @@ func TestEventActionCompressQuotaFolder(t *testing.T) {
|
|
|
FsConfig: dataprovider.EventActionFilesystemConfig{
|
|
|
Type: dataprovider.FilesystemActionCompress,
|
|
|
Compress: dataprovider.EventActionFsCompress{
|
|
|
- Name: "/{{VirtualPath}}.zip",
|
|
|
- Paths: []string{"/{{VirtualPath}}", testDir},
|
|
|
+ Name: "/{{.VirtualPath}}.zip",
|
|
|
+ Paths: []string{"/{{.VirtualPath}}", testDir},
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -6361,8 +6361,8 @@ func TestEventActionCompressErrors(t *testing.T) {
|
|
|
FsConfig: dataprovider.EventActionFilesystemConfig{
|
|
|
Type: dataprovider.FilesystemActionCompress,
|
|
|
Compress: dataprovider.EventActionFsCompress{
|
|
|
- Name: "/{{VirtualPath}}.zip",
|
|
|
- Paths: []string{"/{{VirtualPath}}.zip"}, // cannot compress itself
|
|
|
+ Name: "/{{.VirtualPath}}.zip",
|
|
|
+ Paths: []string{"/{{.VirtualPath}}.zip"}, // cannot compress itself
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -6424,7 +6424,7 @@ func TestEventActionCompressErrors(t *testing.T) {
|
|
|
// try to overwrite a directory
|
|
|
testDir := "/adir"
|
|
|
action1.Options.FsConfig.Compress.Name = testDir
|
|
|
- action1.Options.FsConfig.Compress.Paths = []string{"/{{VirtualPath}}"}
|
|
|
+ action1.Options.FsConfig.Compress.Paths = []string{"/{{.VirtualPath}}"}
|
|
|
_, _, err = httpdtest.UpdateEventAction(action1, http.StatusOK)
|
|
|
assert.NoError(t, err)
|
|
|
conn, client, err = getSftpClient(user)
|
|
@@ -6469,8 +6469,8 @@ func TestEventActionEmailAttachments(t *testing.T) {
|
|
|
FsConfig: dataprovider.EventActionFilesystemConfig{
|
|
|
Type: dataprovider.FilesystemActionCompress,
|
|
|
Compress: dataprovider.EventActionFsCompress{
|
|
|
- Name: "/archive/{{VirtualPath}}.zip",
|
|
|
- Paths: []string{"/{{VirtualPath}}"},
|
|
|
+ Name: "/archive/{{.VirtualPath}}.zip",
|
|
|
+ Paths: []string{"/{{.VirtualPath}}"},
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -6483,9 +6483,9 @@ func TestEventActionEmailAttachments(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Fs path {{FsPath}}, size: {{FileSize}}, protocol: {{Protocol}}, IP: {{IP}} {{EscapedVirtualPath}}",
|
|
|
- Attachments: []string{"/archive/{{VirtualPath}}.zip"},
|
|
|
+ Subject: `"{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Fs path {{.FsPath}}, size: {{.FileSize}}, protocol: {{.Protocol}}, IP: {{.IP}} {{.EscapedVirtualPath}}",
|
|
|
+ Attachments: []string{"/archive/{{.VirtualPath}}.zip"},
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -6604,8 +6604,8 @@ func TestEventActionsRetentionReports(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Fs path {{FsPath}}, size: {{FileSize}}, protocol: {{Protocol}}, IP: {{IP}}",
|
|
|
+ Subject: `"{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Fs path {{.FsPath}}, size: {{.FileSize}}, protocol: {{.Protocol}}, IP: {{.IP}}",
|
|
|
Attachments: []string{dataprovider.RetentionReportPlaceHolder},
|
|
|
},
|
|
|
},
|
|
@@ -6832,8 +6832,8 @@ func TestEventRuleFirstUploadDownloadActions(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}}" from "{{Name}}"`,
|
|
|
- Body: "Fs path {{FsPath}}, size: {{FileSize}}, protocol: {{Protocol}}, IP: {{IP}}",
|
|
|
+ Subject: `"{{.Event}}" from "{{.Name}}"`,
|
|
|
+ Body: "Fs path {{.FsPath}}, size: {{.FileSize}}, protocol: {{.Protocol}}, IP: {{.IP}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -6964,9 +6964,9 @@ func TestEventRuleRenameEvent(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}}" from "{{Name}}"`,
|
|
|
+ Subject: `"{{.Event}}" from "{{.Name}}"`,
|
|
|
ContentType: 1,
|
|
|
- Body: `<p>Fs path {{FsPath}}, Target path "{{VirtualTargetDirPath}}/{{TargetName}}", size: {{FileSize}}</p>`,
|
|
|
+ Body: `<p>Fs path {{.FsPath}}, Target path "{{.VirtualTargetDirPath}}/{{.TargetName}}", size: {{.FileSize}}</p>`,
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -7045,9 +7045,9 @@ func TestEventRuleIDPLogin(t *testing.T) {
|
|
|
username := `test_"idp_"login`
|
|
|
custom1 := `cust"oa"1`
|
|
|
u := map[string]any{
|
|
|
- "username": "{{Name}}",
|
|
|
+ "username": "{{.Name}}",
|
|
|
"status": 1,
|
|
|
- "home_dir": filepath.Join(os.TempDir(), "{{IDPFieldcustom1}}"),
|
|
|
+ "home_dir": filepath.Join(os.TempDir(), "{{.IDPFieldcustom1}}"),
|
|
|
"permissions": map[string][]string{
|
|
|
"/": {dataprovider.PermAny},
|
|
|
},
|
|
@@ -7055,7 +7055,7 @@ func TestEventRuleIDPLogin(t *testing.T) {
|
|
|
userTmpl, err := json.Marshal(u)
|
|
|
require.NoError(t, err)
|
|
|
a := map[string]any{
|
|
|
- "username": "{{Name}}",
|
|
|
+ "username": "{{.Name}}",
|
|
|
"status": 1,
|
|
|
"permissions": []string{dataprovider.PermAdminAny},
|
|
|
}
|
|
@@ -7081,8 +7081,8 @@ func TestEventRuleIDPLogin(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}} {{StatusString}}"`,
|
|
|
- Body: "{{Name}} Custom field: {{IDPFieldcustom1}}",
|
|
|
+ Subject: `"{{.Event}} {{.StatusString}}"`,
|
|
|
+ Body: "{{.Name}} Custom field: {{.IDPFieldcustom1}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -7327,8 +7327,8 @@ func TestEventRuleEmailField(t *testing.T) {
|
|
|
Type: dataprovider.ActionTypeEmail,
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
- Recipients: []string{"{{Email}}"},
|
|
|
- Subject: `"{{Event}}" from "{{Name}}"`,
|
|
|
+ Recipients: []string{"{{.Email}}"},
|
|
|
+ Subject: `"{{.Event}}" from "{{.Name}}"`,
|
|
|
Body: "Sample email body",
|
|
|
},
|
|
|
},
|
|
@@ -7342,7 +7342,7 @@ func TestEventRuleEmailField(t *testing.T) {
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
Subject: `"Failure`,
|
|
|
- Body: "{{ErrorString}}",
|
|
|
+ Body: "{{.ErrorString}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -7473,9 +7473,9 @@ func TestEventRuleCertificate(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]"},
|
|
|
- Subject: `"{{Event}} {{StatusString}}"`,
|
|
|
+ Subject: `"{{.Event}} {{.StatusString}}"`,
|
|
|
ContentType: 0,
|
|
|
- Body: "Domain: {{Name}} Timestamp: {{Timestamp}} {{ErrorString}} Date time: {{DateTime}}",
|
|
|
+ Body: "Domain: {{.Name}} Timestamp: {{.Timestamp}} {{.ErrorString}} Date time: {{.DateTime}}",
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -7613,8 +7613,8 @@ func TestEventRuleIPBlocked(t *testing.T) {
|
|
|
Options: dataprovider.BaseEventActionOptions{
|
|
|
EmailConfig: dataprovider.EventActionEmailConfig{
|
|
|
Recipients: []string{"[email protected]", "[email protected]"},
|
|
|
- Subject: `New "{{Event}}"`,
|
|
|
- Body: "IP: {{IP}} Timestamp: {{Timestamp}}",
|
|
|
+ Subject: `New "{{.Event}}"`,
|
|
|
+ Body: "IP: {{.IP}} Timestamp: {{.Timestamp}}",
|
|
|
},
|
|
|
},
|
|
|
}
|