vault/sdk/database/dbplugin/database.proto
Johan Brandhorst-Satzkorn 8253e59752
Migrate protobuf generation to Buf (#22099)
* Migrate protobuf generation to Buf

Buf simplifies the generation story and allows us to lean
into other features in the Buf ecosystem, such as dependency
management, linting, breaking change detection, formatting
and remote plugins.

* Format all protobuf files with buf

Also add a CI job to ensure formatting remains consistent

* Add CI job to warn on proto generate diffs

Some files were not regenerated with the latest version
of the protobuf binary. This CI job will ensure we are always
detect if the protobuf files need regenerating.

* Add CI job for linting protobuf files
2023-07-31 18:44:56 +00:00

120 lines
2.7 KiB
Protocol Buffer

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
syntax = "proto3";
package dbplugin;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/hashicorp/vault/sdk/database/dbplugin";
message InitializeRequest {
option deprecated = true;
bytes config = 1;
bool verify_connection = 2;
}
message InitRequest {
bytes config = 1;
bool verify_connection = 2;
}
message CreateUserRequest {
Statements statements = 1;
UsernameConfig username_config = 2;
google.protobuf.Timestamp expiration = 3;
}
message RenewUserRequest {
Statements statements = 1;
string username = 2;
google.protobuf.Timestamp expiration = 3;
}
message RevokeUserRequest {
Statements statements = 1;
string username = 2;
}
message RotateRootCredentialsRequest {
repeated string statements = 1;
}
message Statements {
// DEPRECATED, will be removed in 0.12
string creation_statements = 1 [deprecated = true];
// DEPRECATED, will be removed in 0.12
string revocation_statements = 2 [deprecated = true];
// DEPRECATED, will be removed in 0.12
string rollback_statements = 3 [deprecated = true];
// DEPRECATED, will be removed in 0.12
string renew_statements = 4 [deprecated = true];
repeated string creation = 5;
repeated string revocation = 6;
repeated string rollback = 7;
repeated string renewal = 8;
repeated string rotation = 9;
}
message UsernameConfig {
string DisplayName = 1;
string RoleName = 2;
}
message InitResponse {
bytes config = 1;
}
message CreateUserResponse {
string username = 1;
string password = 2;
}
message TypeResponse {
string type = 1;
}
message RotateRootCredentialsResponse {
bytes config = 1;
}
message Empty {}
message GenerateCredentialsResponse {
string password = 1;
}
message StaticUserConfig {
string username = 1;
string password = 2;
bool create = 3;
}
message SetCredentialsRequest {
Statements statements = 1;
StaticUserConfig static_user_config = 2;
}
message SetCredentialsResponse {
string username = 1;
string password = 2;
}
service Database {
rpc Type(Empty) returns (TypeResponse);
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
rpc RenewUser(RenewUserRequest) returns (Empty);
rpc RevokeUser(RevokeUserRequest) returns (Empty);
rpc RotateRootCredentials(RotateRootCredentialsRequest) returns (RotateRootCredentialsResponse);
rpc Init(InitRequest) returns (InitResponse);
rpc Close(Empty) returns (Empty);
rpc SetCredentials(SetCredentialsRequest) returns (SetCredentialsResponse);
rpc GenerateCredentials(Empty) returns (GenerateCredentialsResponse);
rpc Initialize(InitializeRequest) returns (Empty) {
option deprecated = true;
}
}