add preshared key based peer auth

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2019-10-03 10:10:50 -04:00
parent 562f1caa54
commit f0719ee8a9
No known key found for this signature in database
GPG key ID: A519480096146526
9 changed files with 92 additions and 40 deletions

View file

@ -28,10 +28,11 @@ import (
)
// Connect attempts to connect to the peer and returns the master info
func (c *Client) Connect() (*v1.Master, error) {
func (c *Client) Connect(key string) (*v1.Master, error) {
ctx := context.Background()
resp, err := c.heimdallClient.Connect(ctx, &v1.ConnectRequest{
ID: c.id,
ID: c.id,
ClusterKey: key,
})
if err != nil {
return nil, err