Check credentials when connecting to shim
NewUnixSocketCredentials was actually never invoked before. Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
24aac336f3
commit
587a811d09
@ -80,7 +80,7 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
server := grpc.NewServer()
|
||||
server := newServer()
|
||||
e, err := connectEvents(context.GlobalString("address"))
|
||||
if err != nil {
|
||||
return err
|
||||
@ -182,9 +182,10 @@ func connect(address string, d func(string, time.Duration) (net.Conn, error)) (*
|
||||
gopts := []grpc.DialOption{
|
||||
grpc.WithBlock(),
|
||||
grpc.WithInsecure(),
|
||||
grpc.WithTimeout(100 * time.Second),
|
||||
grpc.WithTimeout(60 * time.Second),
|
||||
grpc.WithDialer(d),
|
||||
grpc.FailOnNonTempDialError(true),
|
||||
grpc.WithBackoffMaxDelay(3 * time.Second),
|
||||
}
|
||||
conn, err := grpc.Dial(dialAddress(address), gopts...)
|
||||
if err != nil {
|
||||
|
@ -33,7 +33,7 @@ func setupSignals() (chan os.Signal, error) {
|
||||
}
|
||||
|
||||
func newServer() *grpc.Server {
|
||||
return grpc.NewServer(grpc.Creds(NewUnixSocketCredentils(0, 0)))
|
||||
return grpc.NewServer(grpc.Creds(NewUnixSocketCredentials(0, 0)))
|
||||
}
|
||||
|
||||
type unixSocketCredentials struct {
|
||||
@ -42,7 +42,7 @@ type unixSocketCredentials struct {
|
||||
serverName string
|
||||
}
|
||||
|
||||
func NewUnixSocketCredentils(uid, gid int) credentials.TransportCredentials {
|
||||
func NewUnixSocketCredentials(uid, gid int) credentials.TransportCredentials {
|
||||
return &unixSocketCredentials{uid, gid, "locahost"}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user