etcdmain, proxy: support authed RPCs with grpcproxy

This commit lets grpcproxy support authed RPCs. Auth tokens supplied
by clients are now forwarded to etcdserver by grpcproxy.
This commit is contained in:
Hitoshi Mitake
2017-07-24 18:09:37 +09:00
committed by Hitoshi Mitake
parent aca8a0d5b9
commit e709f83253
2 changed files with 58 additions and 0 deletions

View File

@@ -204,6 +204,8 @@ func mustNewClient() *clientv3.Client {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
cfg.DialOptions = append(cfg.DialOptions,
grpc.WithUnaryInterceptor(grpcproxy.AuthUnaryClientInterceptor))
client, err := clientv3.New(*cfg)
if err != nil {
fmt.Fprintln(os.Stderr, err)