-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Database gRPC plugins #3666
Conversation
default: | ||
return "", ErrPluginShutdown | ||
} | ||
resp, err := c.client.Type(ctx, &Empty{}, grpc.FailFast(true)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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) | ||
|
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
* 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)
No description provided.