Skip to content

Commit

Permalink
protocol buf changes. need to merge #6173
Browse files Browse the repository at this point in the history
  • Loading branch information
catsby committed Feb 12, 2019
1 parent 9e97e45 commit b717550
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 10 additions & 10 deletions builtin/logical/database/dbplugin/grpc_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,19 @@ func (s *gRPCServer) Close(_ context.Context, _ *Empty) (*Empty, error) {
return &Empty{}, nil
}

func (s *gRPCServer) SetCredentials(context.Context, *SetCredentialsRequest) (*SetCredentialsResponse, error) {
func (s *gRPCServer) SetCredentials(ctx context.Context, req *SetCredentialsRequest) (*SetCredentialsResponse, error) {

resp, err := s.impl.SetCredentials(ctx, req.StaticUserConfig)
if err != nil {
return nil, err
}

respConfig, err := json.Marshal(resp)
username, password, restored, err := s.impl.SetCredentials(ctx, req)
if err != nil {
return nil, err
}

return &SetCredentialsResponse{
Config: respConfig,
Username: username,
Password: password,
Restored: restored,
}, err
}
return nil, status.Error(codes.Unimplemented, "not yet implemented")
// return nil, status.Error(codes.Unimplemented, "not yet implemented")
}

// ---- gRPC client domain ----
Expand Down Expand Up @@ -302,3 +298,7 @@ func (c *gRPCClient) Close() error {
_, err := c.client.Close(c.doneCtx, &Empty{})
return err
}

func (c *gRPCClient) SetCredentials(ctx context.Context, req *SetCredentialsRequest) (username, password string, restored bool, err error) {
return
}
1 change: 1 addition & 0 deletions builtin/logical/database/dbplugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Database interface {
RevokeUser(ctx context.Context, statements Statements, username string) error

RotateRootCredentials(ctx context.Context, statements []string) (config map[string]interface{}, err error)
SetCredentials(ctx context.Context, req *SetCredentialsRequest) (username string, password string, restored bool, err error)

Init(ctx context.Context, config map[string]interface{}, verifyConnection bool) (saveConfig map[string]interface{}, err error)
Close() error
Expand Down

0 comments on commit b717550

Please sign in to comment.