* Install buf with go install This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See https://github.com/cockroachdb/cockroach/issues/67216#issuecomment-874176186 for more discussion on using tool dependencies generally, and https://github.com/bufbuild/buf/issues/52 for an example of where this sort of thing caused an issue for a user. * Upgrade buf version We should migrate to v1 sooner rather than later, as it has some breaking changes from v0. * Change buf lint/breaking commands These commands were moved up one level for v1 * Migrate to buf.yaml to v1 * Remove unused imports These were uncovered by using "buf lint". * Use buf v1.3.1 * Depend on googleapis and grpc-gateway via BSR * Switch to buf for proto generation * Remove third party dependency * Remove unused tools and scripts * Move local protos up one level * Temporarily don't fail on breaking changes * Generate CI config * Fix generation of controller.json * Replace use of deprecated flag * Remove unused import, regenerate files * Remove temporary skipping over breaking check
211 lines
7.0 KiB
Protocol Buffer
211 lines
7.0 KiB
Protocol Buffer
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 "google/api/annotations.proto";
|
|
import "google/protobuf/field_mask.proto";
|
|
import "controller/api/resources/groups/v1/group.proto";
|
|
|
|
service GroupService {
|
|
|
|
// GetGroup returns a stored Group if present. The provided request must
|
|
// include the Group id and if it is missing, malformed or referencing a
|
|
// non existing resource an error is returned.
|
|
rpc GetGroup(GetGroupRequest) returns (GetGroupResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/groups/{id}"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Gets a single Group."
|
|
};
|
|
}
|
|
|
|
// ListGroups returns a list of stored Groups which exist inside the
|
|
// provided scope id. If that id is missing, malformed, or
|
|
// references a non-existing scope, an error is returned.
|
|
rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/groups"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Lists all Groups."
|
|
};
|
|
}
|
|
|
|
// CreateGroup creates and stores a Group in boundary. The provided
|
|
// request must include the scope ID in which the Group will be created.
|
|
// If the scope ID is missing, malformed or references a non existing
|
|
// resource, an error is returned. If a name is provided that is in
|
|
// use in another Group in the same scope, an error is returned.
|
|
rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/groups"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Creates a single Group."
|
|
};
|
|
}
|
|
|
|
// UpdateGroup updates an existing Group in boundary. The provided Group
|
|
// must not have any read only fields set. The update mask must be included in
|
|
// the request and contain at least 1 mutable field. To unset a field's value,
|
|
// include the field in the update mask and don't set it in the provided
|
|
// Group. An error is returned if the Group id is missing or reference a
|
|
// non-existing resource. An error is also returned if the request attempts
|
|
// to update the name to one that is already used by another Group in the
|
|
// same scope.
|
|
rpc UpdateGroup(UpdateGroupRequest) returns (UpdateGroupResponse) {
|
|
option (google.api.http) = {
|
|
patch: "/v1/groups/{id}"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Updates a Group."
|
|
};
|
|
}
|
|
|
|
// DeleteGroup removes a Group from Boundary. If the provided Group
|
|
// ID is malformed or not provided an error is returned.
|
|
rpc DeleteGroup(DeleteGroupRequest) returns (DeleteGroupResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/v1/groups/{id}"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Deletes a Group."
|
|
};
|
|
}
|
|
|
|
// AddGroupMembers adds members to a Group. The provided request must include
|
|
// the scope id and the Group id which the members will be added to.
|
|
// An error is returned if any provided id is missing, malformed or
|
|
// references a non-existing resource.
|
|
rpc AddGroupMembers(AddGroupMembersRequest) returns (AddGroupMembersResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/groups/{id}:add-members"
|
|
body: "*"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Adds members to a Group."
|
|
};
|
|
}
|
|
|
|
// SetGroupMembers sets the Group's members. Any existing members on
|
|
// the Group are deleted if they are not included in this request. The provided
|
|
// request must include the Group id which the members will be set to.
|
|
// An error is returned if any provided id is missing, malformed or
|
|
// references a non-existing resource.
|
|
rpc SetGroupMembers(SetGroupMembersRequest) returns (SetGroupMembersResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/groups/{id}:set-members"
|
|
body: "*"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Set a Group's members to exactly the list of provided in the request, removing any members that are not specified."
|
|
};
|
|
}
|
|
|
|
// RemoveGroupMembers removes members from the specified Group.
|
|
// The provided request must include the the Group id to which the members
|
|
// will be set.
|
|
// An error is returned if any provided id is missing, malformed or
|
|
// references a non-existing resource.
|
|
rpc RemoveGroupMembers(RemoveGroupMembersRequest) returns (RemoveGroupMembersResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/groups/{id}:remove-members"
|
|
body: "*"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Removes the specified members from a Group."
|
|
};
|
|
}
|
|
}
|
|
|
|
message GetGroupRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message GetGroupResponse {
|
|
resources.groups.v1.Group item = 1;
|
|
}
|
|
|
|
message ListGroupsRequest {
|
|
string scope_id = 1 [json_name="scope_id"];
|
|
bool recursive = 20 [json_name="recursive"];
|
|
string filter = 30 [json_name="filter"];
|
|
}
|
|
|
|
message ListGroupsResponse {
|
|
repeated resources.groups.v1.Group items = 1;
|
|
}
|
|
|
|
message CreateGroupRequest {
|
|
resources.groups.v1.Group item = 1;
|
|
}
|
|
|
|
message CreateGroupResponse {
|
|
string uri = 1;
|
|
resources.groups.v1.Group item = 2;
|
|
}
|
|
|
|
message UpdateGroupRequest {
|
|
string id = 1;
|
|
resources.groups.v1.Group item = 2;
|
|
google.protobuf.FieldMask update_mask = 3 [json_name="update_mask"];
|
|
}
|
|
|
|
message UpdateGroupResponse {
|
|
resources.groups.v1.Group item = 1;
|
|
}
|
|
|
|
message DeleteGroupRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message DeleteGroupResponse {}
|
|
|
|
message AddGroupMembersRequest {
|
|
string id = 1;
|
|
// 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;
|
|
repeated string member_ids = 3 [json_name="member_ids"];
|
|
}
|
|
|
|
message AddGroupMembersResponse {
|
|
resources.groups.v1.Group item = 1;
|
|
}
|
|
|
|
message SetGroupMembersRequest {
|
|
string id = 1;
|
|
// 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;
|
|
repeated string member_ids = 3 [json_name="member_ids"];
|
|
}
|
|
|
|
message SetGroupMembersResponse {
|
|
resources.groups.v1.Group item = 1;
|
|
}
|
|
|
|
message RemoveGroupMembersRequest {
|
|
string id = 1;
|
|
// 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;
|
|
repeated string member_ids = 3 [json_name="member_ids"];
|
|
}
|
|
|
|
message RemoveGroupMembersResponse {
|
|
resources.groups.v1.Group item = 1;
|
|
}
|