diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-15 08:48:14 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-15 08:48:14 -0400 |
commit | c6c3f1e47829bba9b332da3d4c61193532e87032 (patch) | |
tree | adbbbf666eb0f25ae98be9e7df8642975bdb46c5 /utils/license.go | |
parent | 9243b8761a8062a864a882dbab2aa4edc2780d73 (diff) | |
download | chat-c6c3f1e47829bba9b332da3d4c61193532e87032.tar.gz chat-c6c3f1e47829bba9b332da3d4c61193532e87032.tar.bz2 chat-c6c3f1e47829bba9b332da3d4c61193532e87032.zip |
Update client license etag to handle new features (#2716)
Diffstat (limited to 'utils/license.go')
-rw-r--r-- | utils/license.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/license.go b/utils/license.go index fcc08e6b1..69279fd23 100644 --- a/utils/license.go +++ b/utils/license.go @@ -5,11 +5,13 @@ package utils import ( "crypto" + "crypto/md5" "crypto/rsa" "crypto/sha512" "crypto/x509" "encoding/base64" "encoding/pem" + "fmt" "strconv" "strings" @@ -129,3 +131,13 @@ func getClientLicense(l *model.License) map[string]string { return props } + +func GetClientLicenseEtag() string { + value := "" + + for k, v := range ClientLicense { + value += fmt.Sprintf("%s:%s;", k, v) + } + + return model.Etag(fmt.Sprintf("%x", md5.Sum([]byte(value)))) +} |