Sanitize personal information out of license for non system admin users (#3487)

Этот коммит содержится в:
Joram Wilander
2016-07-05 14:02:00 -04:00
коммит произвёл Harrison Healey
родитель 8b918efd3f
Коммит f89e7c6d54
3 изменённых файлов: 25 добавлений и 2 удалений

Просмотреть файл

@@ -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)

Просмотреть файл

@@ -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
}