mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix: code cleanup
Signed-off-by: jianfei.zhang <jianfei.zhang@daocloud.io>
This commit is contained in:
parent
4977877730
commit
c26d7f5389
@ -236,7 +236,7 @@ func (t *tokenSimple) isValidSimpleToken(ctx context.Context, token string) bool
|
||||
}
|
||||
|
||||
select {
|
||||
case <-t.indexWaiter(uint64(index)):
|
||||
case <-t.indexWaiter(index):
|
||||
return true
|
||||
case <-ctx.Done():
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ func TestNewAuthStoreBcryptCost(t *testing.T) {
|
||||
|
||||
func encodePassword(s string) string {
|
||||
hashedPassword, _ := bcrypt.GenerateFromPassword([]byte(s), bcrypt.MinCost)
|
||||
return base64.StdEncoding.EncodeToString([]byte(hashedPassword))
|
||||
return base64.StdEncoding.EncodeToString(hashedPassword)
|
||||
}
|
||||
|
||||
func setupAuthStore(t *testing.T) (store *authStore, teardownfunc func(t *testing.T)) {
|
||||
|
@ -48,6 +48,7 @@ import (
|
||||
"golang.org/x/net/http2"
|
||||
"golang.org/x/net/trace"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
type serveCtx struct {
|
||||
@ -137,7 +138,7 @@ func (sctx *serveCtx) serve(
|
||||
|
||||
var gwmux *gw.ServeMux
|
||||
if s.Cfg.EnableGRPCGateway {
|
||||
gwmux, err = sctx.registerGateway([]grpc.DialOption{grpc.WithInsecure()})
|
||||
gwmux, err = sctx.registerGateway([]grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())})
|
||||
if err != nil {
|
||||
sctx.lg.Error("registerGateway failed", zap.Error(err))
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user