diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-07-05 14:02:00 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-07-05 14:02:00 -0400 |
commit | f89e7c6d543a82d6078c2ca0f892914d7976a6f5 (patch) | |
tree | e8f25ad982e61db2eb6f20d4e845985ed999d4aa /utils | |
parent | 8b918efd3fba4d0f8efc576ce03df36de4ea8648 (diff) | |
download | chat-f89e7c6d543a82d6078c2ca0f892914d7976a6f5.tar.gz chat-f89e7c6d543a82d6078c2ca0f892914d7976a6f5.tar.bz2 chat-f89e7c6d543a82d6078c2ca0f892914d7976a6f5.zip |
Sanitize personal information out of license for non system admin users (#3487)
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 1 | ||||
-rw-r--r-- | utils/license.go | 20 |
2 files changed, 20 insertions, 1 deletions
diff --git a/utils/config.go b/utils/config.go index 58980ba7f..5ebf29e3e 100644 --- a/utils/config.go +++ b/utils/config.go @@ -230,7 +230,6 @@ func getClientConfig(c *model.Config) map[string]string { props["EnableSignInWithEmail"] = strconv.FormatBool(*c.EmailSettings.EnableSignInWithEmail) props["EnableSignInWithUsername"] = strconv.FormatBool(*c.EmailSettings.EnableSignInWithUsername) props["RequireEmailVerification"] = strconv.FormatBool(c.EmailSettings.RequireEmailVerification) - props["FeedbackEmail"] = c.EmailSettings.FeedbackEmail props["EnableSignUpWithGitLab"] = strconv.FormatBool(c.GitLabSettings.Enable) props["EnableSignUpWithGoogle"] = strconv.FormatBool(c.GoogleSettings.Enable) diff --git a/utils/license.go b/utils/license.go index 6905bee4f..060beb525 100644 --- a/utils/license.go +++ b/utils/license.go @@ -146,3 +146,23 @@ func GetClientLicenseEtag() string { return model.Etag(fmt.Sprintf("%x", md5.Sum([]byte(value)))) } + +func GetSantizedClientLicense() map[string]string { + sanitizedLicense := make(map[string]string) + + for k, v := range ClientLicense { + sanitizedLicense[k] = v + } + + if IsLicensed { + delete(sanitizedLicense, "Name") + delete(sanitizedLicense, "Email") + delete(sanitizedLicense, "Company") + delete(sanitizedLicense, "PhoneNumber") + delete(sanitizedLicense, "IssuedAt") + delete(sanitizedLicense, "StartsAt") + delete(sanitizedLicense, "ExpiresAt") + } + + return sanitizedLicense +} |