Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54177854ce | ||
|
|
041cda8a35 | ||
|
|
6c6e52536a | ||
|
|
630147ecdd | ||
|
|
36bf26e12a | ||
|
|
0bca5ebb7b | ||
|
|
858cfc81e4 | ||
|
|
74b287017b | ||
|
|
b74c9e7fa3 | ||
|
|
a792a8e86f |
No files matched your search
+3
-2
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/SommerEngineering/Ocean/Tools"
|
"github.com/SommerEngineering/Ocean/Tools"
|
||||||
"net/url"
|
"net/url"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Sign a message to secure it.
|
// Sign a message to secure it.
|
||||||
@@ -32,7 +33,7 @@ func signMessage(data map[string][]string) (result url.Values) {
|
|||||||
// Now, loop over all the data:
|
// Now, loop over all the data:
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
// Get the value:
|
// Get the value:
|
||||||
value := data[key]
|
value := data[key][0]
|
||||||
|
|
||||||
// Hash each key and value:
|
// Hash each key and value:
|
||||||
fmt.Fprintf(hash, "key=%s :: value=%s\n", key, value)
|
fmt.Fprintf(hash, "key=%s :: value=%s\n", key, value)
|
||||||
@@ -42,6 +43,6 @@ func signMessage(data map[string][]string) (result url.Values) {
|
|||||||
result = url.Values(data)
|
result = url.Values(data)
|
||||||
|
|
||||||
// Append the sign:
|
// Append the sign:
|
||||||
result.Add(`checksum`, fmt.Sprintf("%x", hash.Sum(nil)))
|
result.Add(`checksum`, strings.ToUpper(fmt.Sprintf("%x", hash.Sum(nil))))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package Log
|
||||||
|
|
||||||
|
// This function provides the project name for e.g. logging events
|
||||||
|
// coming trough the ICCC.
|
||||||
|
func GetProjectName() string {
|
||||||
|
return projectName
|
||||||
|
}
|
||||||
+7
-1
@@ -121,10 +121,16 @@ func clearEntry(entry Meta.Entry) (result Meta.Entry) {
|
|||||||
// Remove white spaces from the parameters.
|
// Remove white spaces from the parameters.
|
||||||
func clearParameters(oldParameters []string) (result []string) {
|
func clearParameters(oldParameters []string) (result []string) {
|
||||||
for n := 0; n < len(oldParameters); n++ {
|
for n := 0; n < len(oldParameters); n++ {
|
||||||
|
// Remove white spaces:
|
||||||
oldParameters[n] = removeWhitespaces(oldParameters[n])
|
oldParameters[n] = removeWhitespaces(oldParameters[n])
|
||||||
|
|
||||||
|
// Is content left after removing?
|
||||||
|
if oldParameters[n] != `` {
|
||||||
|
// Yes, some content is still there. Thus, commit this entry:
|
||||||
|
result = append(result, oldParameters[n])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = oldParameters
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ func ICCCNewLogEventReceiver(data map[string][]string) (result map[string][]stri
|
|||||||
|
|
||||||
// Provide a log entry:
|
// Provide a log entry:
|
||||||
logEntry := LM.Entry{}
|
logEntry := LM.Entry{}
|
||||||
|
logEntry.Project = Log.GetProjectName()
|
||||||
logEntry.Sender = LM.Sender(messageData.Sender)
|
logEntry.Sender = LM.Sender(messageData.Sender)
|
||||||
logEntry.Category = LM.ParseCategory(messageData.Category)
|
logEntry.Category = LM.ParseCategory(messageData.Category)
|
||||||
logEntry.Level = LM.ParseLevel(messageData.Level)
|
logEntry.Level = LM.ParseLevel(messageData.Level)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package Version
|
package Version
|
||||||
|
|
||||||
var (
|
var (
|
||||||
oceansVersion string = `2.0.3` // Ocean's current version
|
oceansVersion string = `2.0.4` // Ocean's current version
|
||||||
)
|
)
|
||||||
Reference in new issue
Block a user