summaryrefslogtreecommitdiffstats
path: root/utils/license.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-04-15 08:48:14 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-04-15 08:48:14 -0400
commitc6c3f1e47829bba9b332da3d4c61193532e87032 (patch)
treeadbbbf666eb0f25ae98be9e7df8642975bdb46c5 /utils/license.go
parent9243b8761a8062a864a882dbab2aa4edc2780d73 (diff)
downloadchat-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.go12
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))))
+}