Skip to content

Commit

Permalink
Made requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
domwhewell-sage committed May 9, 2024
1 parent d11f6f3 commit 9475dc2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"html/template"
"net/url"
"strings"
"strconv"
"strings"

"github.com/ashwanthkumar/slack-go-webhook"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -137,12 +137,12 @@ func (w SubmittedDetails) SendGraphql() error {
if !viper.GetBool("ghostwriter.disable_credentials") {
output = "\nUsername: " + w.Username + "\nPassword: " + w.Password
}
oplog_entry := ghostwriter_oplog_entry{
SourceIp: w.Address,
oplog_entry := ghostwriterOplogEntry{
SourceIp: w.Address,
UserContext: w.Email,
Description: "User ID: " + w.ID + "\nCampaign ID: " + strconv.FormatUint(uint64(w.CampaignID), 10),
Output: output,
Comments: SubmittedData
Output: output,
Comments: SubmittedData,
}
return sendGraphql(oplog_entry)
}
Expand Down Expand Up @@ -193,12 +193,12 @@ func (w ClickDetails) SendEmail() error {
}

func (w ClickDetails) SendGraphql() error {
oplog_entry := ghostwriter_oplog_entry{
SourceIp: w.Address,
oplog_entry := ghostwriterOplogEntry{
SourceIp: w.Address,
UserContext: w.Email,
Description: "User ID: " + w.ID + "\nCampaign ID: " + strconv.FormatUint(uint64(w.CampaignID), 10),
Output: "UserAgent: " + w.UserAgent,
Comments: ClickedLink
Output: "UserAgent: " + w.UserAgent,
Comments: ClickedLink,
}
return sendGraphql(oplog_entry)
}
Expand Down Expand Up @@ -261,12 +261,12 @@ func (w OpenedDetails) SendEmail() error {
}

func (w OpenedDetails) SendGraphql() error {
oplog_entry := ghostwriter_oplog_entry{
SourceIp: w.Address,
oplog_entry := ghostwriterOplogEntry{
SourceIp: w.Address,
UserContext: w.Email,
Description: "User ID: " + w.ID + "\nCampaign ID: " + strconv.FormatUint(uint64(w.CampaignID), 10),
Output: "UserAgent: " + w.UserAgent,
Comments: EmailOpened
Output: "UserAgent: " + w.UserAgent,
Comments: EmailOpened,
}
return sendGraphql(oplog_entry)
}
4 changes: 2 additions & 2 deletions sending_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/spf13/viper"
)

type ghostwriter_oplog_entry struct {
type ghostwriterOplogEntry struct {
Oplog int
StartDate string
EndDate string
Expand Down Expand Up @@ -56,7 +56,7 @@ func sendEmail(subject, body string) error {
return nil
}

func sendGraphql(data ghostwriter_oplog_entry) error {
func sendGraphql(data ghostwriterOplogEntry) error {
url := viper.GetString("ghostwriter.graphql_endpoint")
api_key := viper.GetString("ghostwriter.api_key")
query := viper.GetString("graphql_default_query")
Expand Down

0 comments on commit 9475dc2

Please sign in to comment.