Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database gRPC plugins #3666

Merged
merged 22 commits into from
Dec 14, 2017
Merged

Database gRPC plugins #3666

merged 22 commits into from
Dec 14, 2017

Conversation

briankassouf
Copy link
Contributor

No description provided.

@jefferai jefferai added this to the 0.9.1 milestone Dec 11, 2017
default:
return "", ErrPluginShutdown
}
resp, err := c.client.Type(ctx, &Empty{}, grpc.FailFast(true))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FailFast is actually the default now (see grpc/grpc-go#738 ; it has been for a while, but the earliest grpc code in Vault predated that and using it has just kind of kept going on). Probably can take it out here though.

@@ -1017,8 +1017,7 @@ func (m *ExpirationManager) revokeEntry(le *leaseEntry) error {
}

// Handle standard revocation via backends
resp, err := m.router.Route(logical.RevokeRequest(
le.Path, le.Secret, le.Data))
resp, err := m.router.Route(logical.RevokeRequest(le.Path, le.Secret, le.Data))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes as a non-sequitur :-D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, yeah at one point there was a context being passed here, but pulled it out for a different PR

Copy link
Contributor

@calvn calvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

case *gRPCClient:
db = raw.(*gRPCClient)
case *databasePluginRPCClient:
logger.Warn(fmt.Sprintf("Plugin '%s' is using deprecated net RPC transport. Recompile plugin to upgrade to gRPC.", pluginRunner.Name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.Warn("database: plugin is using deprecated net RPC transport, recompile plugin to upgrade to gRPC", "plugin", pluginRunner.Name)


func (ds *databasePluginRPCServer) RenewUser(args *RenewUserRequestRPC, _ *struct{}) error {
err := ds.impl.RenewUser(context.Background(), args.Statements, args.Username, args.Expiration)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, but since this is so short we can remove the extra newline here (and for other databasePluginRPCServer methods as well).

return fmt.Errorf("error verifying connection: %s", err)
}
}

return nil
}

func (c *cassandraConnectionProducer) Connection() (interface{}, error) {
func (c *cassandraConnectionProducer) Connection(ctx context.Context) (interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are not using ctx right now, maybe change it to _ for the time being.

@briankassouf briankassouf merged commit a401cc7 into master Dec 14, 2017
@briankassouf briankassouf deleted the database-grpc-plugins branch December 14, 2017 22:03
chrishoffman pushed a commit that referenced this pull request Dec 15, 2017
* oss/master:
  Defer reader.Close that is used to determine sha256
  changelog++
  Avoid unseal failure if plugin backends fail to setup during postUnseal (#3686)
  Add logic for using Auth.Period when handling auth login/renew requests (#3677)
  plugins/database: use context with plugins that use database/sql package (#3691)
  changelog++
  Fix plaintext backup in transit (#3692)
  Database gRPC plugins (#3666)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants