summaryrefslogtreecommitdiffstats
path: root/sms-service
diff options
context:
space:
mode:
Diffstat (limited to 'sms-service')
-rw-r--r--sms-service/src/quorumclient/quorumclient.go10
-rw-r--r--sms-service/src/sms/backend/vault.go4
-rw-r--r--sms-service/src/sms/handler/handler.go2
3 files changed, 10 insertions, 6 deletions
diff --git a/sms-service/src/quorumclient/quorumclient.go b/sms-service/src/quorumclient/quorumclient.go
index 7244720..05fc967 100644
--- a/sms-service/src/quorumclient/quorumclient.go
+++ b/sms-service/src/quorumclient/quorumclient.go
@@ -25,6 +25,7 @@ import (
"log"
"net/http"
"os"
+ "path/filepath"
smsauth "sms/auth"
smslogger "sms/log"
"strings"
@@ -63,10 +64,11 @@ func loadPGPKeys(prKeyPath string, pbKeyPath string) (string, string, error) {
//calls necessary initialization endpoints on the
//SMS webservice
func main() {
- idFilePath := "auth/myid"
- pbKeyPath := "auth/pbkey"
- prKeyPath := "auth/prkey"
- shardPath := "auth/shard"
+ podName := os.Getenv("HOSTNAME")
+ idFilePath := filepath.Join("auth", podName, "id")
+ pbKeyPath := filepath.Join("auth", podName, "pbkey")
+ prKeyPath := filepath.Join("auth", podName, "prkey")
+ shardPath := filepath.Join("auth", podName, "shard")
smslogger.Init("")
smslogger.WriteInfo("Starting Log for Quorum Client")
diff --git a/sms-service/src/sms/backend/vault.go b/sms-service/src/sms/backend/vault.go
index 3360197..147d934 100644
--- a/sms-service/src/sms/backend/vault.go
+++ b/sms-service/src/sms/backend/vault.go
@@ -95,6 +95,10 @@ func (v *Vault) GetStatus() (bool, error) {
// RegisterQuorum registers the PGP public key for a quorum client
// We will return a shard to the client that is registering
func (v *Vault) RegisterQuorum(pgpkey string) (string, error) {
+
+ v.Lock()
+ defer v.Unlock()
+
if v.shards == nil {
smslogger.WriteError("Invalid operation")
return "", errors.New("Invalid operation")
diff --git a/sms-service/src/sms/handler/handler.go b/sms-service/src/sms/handler/handler.go
index 0568671..dbf3f93 100644
--- a/sms-service/src/sms/handler/handler.go
+++ b/sms-service/src/sms/handler/handler.go
@@ -231,8 +231,6 @@ func (h handler) registerHandler(w http.ResponseWriter, r *http.Request) {
QuorumID string `json:"quorumid"`
}
- smslogger.WriteInfo("Entering registerHandler")
-
var inp registerStruct
decoder := json.NewDecoder(r.Body)
decoder.DisallowUnknownFields()