Michael Golowka 6478665b5e
Add Database v5 interface with gRPC client & server (#9641)
* Add new Database v5 interface with gRPC client & server
This is primarily for making password policies available to the DB engine, however since there are a number of other problems with the current interface this is getting an overhaul to a more gRPC request/response approach for easier future compatibility.

This is the first in a series of PRs to add support for password policies in the combined database engine
2020-08-28 11:20:49 -06:00

96 lines
2.0 KiB
Protocol Buffer

syntax = "proto3";
package newdbplugin; // TODO: Update name
option go_package = "github.com/hashicorp/vault/sdk/database/newdbplugin/proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
/////////////////
// Initialize()
/////////////////
message InitializeRequest {
google.protobuf.Struct config_data = 1;
bool verify_connection = 2;
}
message InitializeResponse {
google.protobuf.Struct config_data = 1;
}
/////////////////
// NewUser()
/////////////////
message NewUserRequest {
UsernameConfig username_config = 1;
string password = 2;
google.protobuf.Timestamp expiration = 3;
Statements statements = 4;
Statements rollback_statements = 5;
}
message UsernameConfig {
string display_name = 1;
string role_name = 2;
}
message NewUserResponse {
string username = 1;
}
/////////////////
// UpdateUser()
/////////////////
message UpdateUserRequest {
string username = 1;
ChangePassword password = 2;
ChangeExpiration expiration = 3;
}
message ChangePassword {
string new_password = 1;
Statements statements = 2;
}
message ChangeExpiration {
google.protobuf.Timestamp new_expiration = 1;
Statements statements = 2;
}
message UpdateUserResponse {}
/////////////////
// DeleteUser()
/////////////////
message DeleteUserRequest {
string username = 1;
Statements statements = 2;
}
message DeleteUserResponse {}
/////////////////
// Type()
/////////////////
message TypeResponse {
string Type = 1;
}
/////////////////
// General purpose
/////////////////
message Statements {
repeated string Commands = 1;
}
message Empty {}
service Database {
rpc Initialize(InitializeRequest) returns (InitializeResponse);
rpc NewUser(NewUserRequest) returns (NewUserResponse);
rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse);
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
rpc Type(Empty) returns (TypeResponse);
rpc Close(Empty) returns (Empty);
}