feat(proto): Format protobuf files with buf (#2033)

Formats all protobuf files with buf format. This ensures
a consistent style across all our protobuf files, similar
to gofumpt.
This commit is contained in:
Johan Brandhorst-Satzkorn authored and GitHub committed 2022-05-04 11:10:21 -04:00
1 parent 0fb9b35498
commit f69fbf2255
131 files changed
+2329 -1618

No files matched your search

@@ -2,17 +2,16 @@ syntax = "proto3";
package controller.api.services.v1;
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/api/services;services";
import "protoc-gen-openapiv2/options/annotations.proto";
import "controller/api/resources/authmethods/v1/auth_method.proto";
import "controller/api/resources/authtokens/v1/authtoken.proto";
import "controller/custom_options/v1/options.proto";
import "google/api/annotations.proto";
import "google/api/visibility.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "controller/api/resources/authmethods/v1/auth_method.proto";
import "controller/api/resources/authtokens/v1/authtoken.proto";
import "controller/custom_options/v1/options.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/api/services;services";
option (custom_options.v1.domain) = "auth";
service AuthMethodService {
@@ -112,7 +111,7 @@ service AuthMethodService {
}
message GetAuthMethodRequest {
string id = 1; // @gotags: `class:"public"`
string id = 1; // @gotags: `class:"public"`
}
message GetAuthMethodResponse {
@@ -120,9 +119,9 @@ message GetAuthMethodResponse {
}
message ListAuthMethodsRequest {
string scope_id = 1 [json_name = "scope_id"]; // @gotags: `class:"public"`
bool recursive = 20 [json_name = "recursive"]; // @gotags: `class:"public"`
string filter = 30 [json_name = "filter"]; // @gotags: `class:"public"`
string scope_id = 1 [json_name = "scope_id"]; // @gotags: `class:"public"`
bool recursive = 20 [json_name = "recursive"]; // @gotags: `class:"public"`
string filter = 30 [json_name = "filter"]; // @gotags: `class:"public"`
}
message ListAuthMethodsResponse {
@@ -134,12 +133,12 @@ message CreateAuthMethodRequest {
}
message CreateAuthMethodResponse {
string uri = 1; // @gotags: `class:"public"`
string uri = 1; // @gotags: `class:"public"`
resources.authmethods.v1.AuthMethod item = 2;
}
message UpdateAuthMethodRequest {
string id = 1; // @gotags: `class:"public"`
string id = 1; // @gotags: `class:"public"`
resources.authmethods.v1.AuthMethod item = 2;
google.protobuf.FieldMask update_mask = 3 [json_name = "update_mask"];
}
@@ -149,7 +148,7 @@ message UpdateAuthMethodResponse {
}
message DeleteAuthMethodRequest {
string id = 1; // @gotags: `class:"public"`
string id = 1; // @gotags: `class:"public"`
}
message DeleteAuthMethodResponse {}
@@ -157,23 +156,26 @@ message DeleteAuthMethodResponse {}
// Attributes specific to changing the state of an oidc auth method.
message OidcChangeStateAttributes {
// state must be `inactive`, `active-private`, or `active-public`
string state = 1; // @gotags: `class:"public"`
string state = 1; // @gotags: `class:"public"`
// This flag is only useful for an oidc auth method. It should not be used
// unless the oidc provider's config is incorrectly set and is stopping the
// activation of this auth method.
bool disable_discovered_config_validation = 2 [json_name = "disable_discovered_config_validation"]; // @gotags: `class:"public"`
bool disable_discovered_config_validation = 2 [json_name = "disable_discovered_config_validation"]; // @gotags: `class:"public"`
}
message ChangeStateRequest {
string id = 1; // @gotags: `class:"public"`
string id = 1; // @gotags: `class:"public"`
// Version is used to ensure this resource has not changed.
// The mutation will fail if the version does not match the latest known good version.
uint32 version = 2; // @gotags: `class:"public"`
uint32 version = 2; // @gotags: `class:"public"`
oneof attrs {
// The attributes specific to this auth method's state.
google.protobuf.Struct attributes = 4 [(custom_options.v1.subtype) = "default"];
OidcChangeStateAttributes oidc_change_state_attributes = 5 [(custom_options.v1.subtype) = "oidc", (google.api.field_visibility).restriction = "INTERNAL"];
OidcChangeStateAttributes oidc_change_state_attributes = 5 [
(custom_options.v1.subtype) = "oidc",
(google.api.field_visibility).restriction = "INTERNAL"
];
}
}
@@ -184,8 +186,8 @@ message ChangeStateResponse {
// The layout of the struct for "attributes" field in AuthenticateRequest for a password type. This message isn't directly referenced anywhere but is used here to define the expected field names and
// types.
message PasswordLoginAttributes {
string login_name = 1 [json_name = "login_name"]; // @gotags: `class:"sensitive"`
string password = 2; // @gotags: `class:"secret"`
string login_name = 1 [json_name = "login_name"]; // @gotags: `class:"sensitive"`
string password = 2; // @gotags: `class:"secret"`
}
// The layout of the struct for "attributes" field in AuthenticateRequest for a oidc type's start command. This message isn't directly referenced anywhere but is used here to define the expected field
@@ -194,18 +196,21 @@ message OidcStartAttributes {
// An object which will be marshaled as JSON and roundtripped in the token command call.
google.protobuf.Struct roundtrip_payload = 1 [json_name = "roundtrip_payload"];
// Cached marshaled payload. This is not ingressed from the client; anything found will be thrown out.
string cached_roundtrip_payload = 2; // @gotags: `class:"sensitive"`
string cached_roundtrip_payload = 2; // @gotags: `class:"sensitive"`
}
message AuthenticateRequest {
// The ID of the Auth Method in the system that should be used for authentication.
string auth_method_id = 1 [json_name = "auth_method_id"]; // @gotags: `class:"public"`
string auth_method_id = 1 [json_name = "auth_method_id"]; // @gotags: `class:"public"`
// This can be "cookie" or "token". If not provided, "token" will be used. "cookie" activates a split-cookie method where the token is split partially between http-only and regular cookies in order
// to keep it safe from rogue JS in the browser. Deprecated, use "type" instead.
string token_type = 2 [json_name = "token_type", deprecated = true]; // @gotags: `class:"public"`
string token_type = 2 [
json_name = "token_type",
deprecated = true
]; // @gotags: `class:"public"`
// This can be "cookie" or "token". If not provided, "token" will be used. "cookie" activates a split-cookie method where the token is split partially between http-only and regular cookies in order
// to keep it safe from rogue JS in the browser.
string type = 6 [json_name = "type"]; // @gotags: `class:"public"`
string type = 6 [json_name = "type"]; // @gotags: `class:"public"`
oneof attrs {
// Attributes are passed to the Auth Method; the valid keys and values depend on the type of Auth Method as well as the command.
google.protobuf.Struct attributes = 4;
@@ -217,7 +222,7 @@ message AuthenticateRequest {
controller.api.resources.authmethods.v1.OidcAuthMethodAuthenticateTokenRequest oidc_auth_method_authenticate_token_request = 10 [(google.api.field_visibility).restriction = "INTERNAL"];
}
// The command to perform.
string command = 5 [json_name = "command"]; // @gotags: `class:"public"`
string command = 5 [json_name = "command"]; // @gotags: `class:"public"`
// Deprecated fields
reserved "credentials";
@@ -225,10 +230,10 @@ message AuthenticateRequest {
}
message AuthenticateResponse {
reserved 1, 2; // Old item and token_type
reserved 1, 2; // Old item and token_type
reserved "item", "token_type";
// The type of the token returned. Either "cookie" or "token".
string type = 3; // @gotags: `class:"public"`
string type = 3; // @gotags: `class:"public"`
oneof attrs {
// Valid keys and values depend on the type of Auth Method as well as the command.
google.protobuf.Struct attributes = 4 [json_name = "attributes"];
@@ -240,5 +245,5 @@ message AuthenticateResponse {
controller.api.resources.authtokens.v1.AuthToken auth_token_response = 9 [(google.api.field_visibility).restriction = "INTERNAL"];
}
// The command that was performed.
string command = 5 [json_name = "command"]; // @gotags: `class:"public"`
string command = 5 [json_name = "command"]; // @gotags: `class:"public"`
}