-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[DBPW 1/5] Add Database v5 interface with gRPC client & server #9641
Conversation
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.
Just some questions about statements.
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.
I think there's some missing statements logic.
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.
Looking good overall! Just a few small comments and suggestions.
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.
LGTM
|
||
func getUpdateUserRequest(req *proto.UpdateUserRequest) (UpdateUserRequest, error) { | ||
var password *ChangePassword | ||
if req.GetPassword() != nil && req.GetPassword().GetNewPassword() != "" { |
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.
GetNewPassword()
has a built-in nil check on the receiver so you shouldn't need req.GetPassword() != nil
to protect against potential panic, but it's good to be explicit.
Overview
This PR is part of a larger feature adding support for password policies into the combined database engine. This feature is being split into multiple PRs to make for smaller reviews & earlier feedback.
Creates a new
Database
interface for use in the combined database engine. This new interface will be v5 of the engine and is designed to support password policies. It also changes the pattern of the previous interface to a more gRPC style for better future compatibility. This is done so changes to the interface in the future are hopefully less painful.Nothing is referencing this package yet. That will happen in a subsequent PR
Files
sdk/database/newdbplugin/
- New package for keeping all of the v5 database code. This is a temporary location. This package will replace the existingsdk/database/dbplugin
package in a subsequent PR. The existingsdk/database/dbplugin
package will be renamed to indicate it is deprecated.database.go
- New v5 interface & associated request/response objectsproto/database.proto
- New v5 interface as defined in gRPCgrpc_client.go
- gRPC client implementation ofproto/database.proto
. This does the conversion between Go types indatabase.go
to protobuf-generated types.grpc_server.go
- gRPC server implementation ofproto/database.proto
. This does the conversion between protobuf-generated types and Go types indatabase.go
.Related PRs
Original password policies PR
2/X - Middleware
3/X - Plugin handling
4/X - Database engine