[server] use encryption_key for couchbase env as hash is reserved keyword

This commit is contained in:
Lakhan Samani
2023-01-31 11:18:20 +05:30
parent 748761926d
commit a1df2ce31f
9 changed files with 29 additions and 20 deletions

View File

@@ -3,6 +3,7 @@ package env
import (
"context"
"encoding/json"
"fmt"
"os"
"reflect"
"strconv"
@@ -115,6 +116,7 @@ func PersistEnv() error {
if err != nil || env.EnvData == "" {
// AES encryption needs 32 bit key only, so we chop off last 4 characters from 36 bit uuid
hash := uuid.New().String()[:36-4]
fmt.Println("hash:", hash)
err := memorystore.Provider.UpdateEnvVariable(constants.EnvKeyEncryptionKey, hash)
if err != nil {
log.Debug("Error while updating encryption env variable: ", err)