@@ -20,6 +20,7 @@ import (
20
20
21
21
"github.com/coreos/etcd/auth/authpb"
22
22
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
23
+
23
24
"golang.org/x/net/context"
24
25
"google.golang.org/grpc"
25
26
)
@@ -104,16 +105,16 @@ type auth struct {
104
105
}
105
106
106
107
func NewAuth (c * Client ) Auth {
107
- return & auth {remote : pb . NewAuthClient ( c . ActiveConnection () )}
108
+ return & auth {remote : RetryAuthClient ( c )}
108
109
}
109
110
110
111
func (auth * auth ) AuthEnable (ctx context.Context ) (* AuthEnableResponse , error ) {
111
- resp , err := auth .remote .AuthEnable (ctx , & pb.AuthEnableRequest {}, grpc . FailFast ( false ) )
112
+ resp , err := auth .remote .AuthEnable (ctx , & pb.AuthEnableRequest {})
112
113
return (* AuthEnableResponse )(resp ), toErr (ctx , err )
113
114
}
114
115
115
116
func (auth * auth ) AuthDisable (ctx context.Context ) (* AuthDisableResponse , error ) {
116
- resp , err := auth .remote .AuthDisable (ctx , & pb.AuthDisableRequest {}, grpc . FailFast ( false ) )
117
+ resp , err := auth .remote .AuthDisable (ctx , & pb.AuthDisableRequest {})
117
118
return (* AuthDisableResponse )(resp ), toErr (ctx , err )
118
119
}
119
120
@@ -138,12 +139,12 @@ func (auth *auth) UserGrantRole(ctx context.Context, user string, role string) (
138
139
}
139
140
140
141
func (auth * auth ) UserGet (ctx context.Context , name string ) (* AuthUserGetResponse , error ) {
141
- resp , err := auth .remote .UserGet (ctx , & pb.AuthUserGetRequest {Name : name }, grpc . FailFast ( false ) )
142
+ resp , err := auth .remote .UserGet (ctx , & pb.AuthUserGetRequest {Name : name })
142
143
return (* AuthUserGetResponse )(resp ), toErr (ctx , err )
143
144
}
144
145
145
146
func (auth * auth ) UserList (ctx context.Context ) (* AuthUserListResponse , error ) {
146
- resp , err := auth .remote .UserList (ctx , & pb.AuthUserListRequest {}, grpc . FailFast ( false ) )
147
+ resp , err := auth .remote .UserList (ctx , & pb.AuthUserListRequest {})
147
148
return (* AuthUserListResponse )(resp ), toErr (ctx , err )
148
149
}
149
150
@@ -168,12 +169,12 @@ func (auth *auth) RoleGrantPermission(ctx context.Context, name string, key, ran
168
169
}
169
170
170
171
func (auth * auth ) RoleGet (ctx context.Context , role string ) (* AuthRoleGetResponse , error ) {
171
- resp , err := auth .remote .RoleGet (ctx , & pb.AuthRoleGetRequest {Role : role }, grpc . FailFast ( false ) )
172
+ resp , err := auth .remote .RoleGet (ctx , & pb.AuthRoleGetRequest {Role : role })
172
173
return (* AuthRoleGetResponse )(resp ), toErr (ctx , err )
173
174
}
174
175
175
176
func (auth * auth ) RoleList (ctx context.Context ) (* AuthRoleListResponse , error ) {
176
- resp , err := auth .remote .RoleList (ctx , & pb.AuthRoleListRequest {}, grpc . FailFast ( false ) )
177
+ resp , err := auth .remote .RoleList (ctx , & pb.AuthRoleListRequest {})
177
178
return (* AuthRoleListResponse )(resp ), toErr (ctx , err )
178
179
}
179
180
@@ -201,7 +202,7 @@ type authenticator struct {
201
202
}
202
203
203
204
func (auth * authenticator ) authenticate (ctx context.Context , name string , password string ) (* AuthenticateResponse , error ) {
204
- resp , err := auth .remote .Authenticate (ctx , & pb.AuthenticateRequest {Name : name , Password : password }, grpc . FailFast ( false ) )
205
+ resp , err := auth .remote .Authenticate (ctx , & pb.AuthenticateRequest {Name : name , Password : password })
205
206
return (* AuthenticateResponse )(resp ), toErr (ctx , err )
206
207
}
207
208
0 commit comments