"log"
"net/http"
"os"
+ "path/filepath"
smsauth "sms/auth"
smslogger "sms/log"
"strings"
//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")
// 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")
QuorumID string `json:"quorumid"`
}
- smslogger.WriteInfo("Entering registerHandler")
-
var inp registerStruct
decoder := json.NewDecoder(r.Body)
decoder.DisallowUnknownFields()