add preshared key based peer auth
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
562f1caa54
commit
f0719ee8a9
9 changed files with 92 additions and 40 deletions
|
@ -25,6 +25,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/google/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/stellarproject/heimdall"
|
||||
"github.com/stellarproject/heimdall/version"
|
||||
|
@ -76,6 +77,12 @@ func main() {
|
|||
Usage: "grpc address to join a peer",
|
||||
EnvVar: "HEIMDALL_PEER",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "cluster-key",
|
||||
Usage: "preshared key for cluster peer joins",
|
||||
Value: generateKey(),
|
||||
EnvVar: "HEIMDALL_CLUSTER_KEY",
|
||||
},
|
||||
}
|
||||
app.Before = func(c *cli.Context) error {
|
||||
if c.Bool("debug") {
|
||||
|
@ -90,3 +97,7 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func generateKey() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ func runServer(cx *cli.Context) error {
|
|||
ID: cx.String("id"),
|
||||
GRPCAddress: cx.String("addr"),
|
||||
GRPCPeerAddress: cx.String("peer"),
|
||||
ClusterKey: cx.String("cluster-key"),
|
||||
RedisURL: cx.String("redis-url"),
|
||||
AdvertiseRedisURL: cx.String("advertise-redis-url"),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue