* 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
137 lines
4.2 KiB
Protocol Buffer
137 lines
4.2 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/scopes/v1/scope.proto";
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
|
info: {
|
|
title: "Boundary Controller HTTP API"
|
|
}
|
|
schemes: HTTPS
|
|
schemes: HTTP
|
|
};
|
|
|
|
service ScopeService {
|
|
// GetScope returns a stored Scope if present. The provided request
|
|
// must include the scope ID for the scope being retrieved. If
|
|
// that ID is missing, malformed or references a non existing
|
|
// resource an error is returned.
|
|
rpc GetScope(GetScopeRequest) returns (GetScopeResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/scopes/{id}"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Gets a single Scope."
|
|
};
|
|
}
|
|
|
|
// ListScopes returns a list of stored Scopes which exist inside the provided
|
|
// parent Scope id.
|
|
rpc ListScopes(ListScopesRequest) returns (ListScopesResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/scopes"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Lists all Scopes within the Scope provided in the request."
|
|
};
|
|
}
|
|
|
|
// CreateScope creates and stores a Scope in boundary. The provided request
|
|
// must include the Scope ID in which the new scope will be created. If the Scope
|
|
// ID is missing, malformed or references a non existing scope, an error is
|
|
// returned. If a name is provided that is in use in another Scope in the same
|
|
// parent scope, an error is returned.
|
|
rpc CreateScope(CreateScopeRequest) returns (CreateScopeResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/scopes"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Creates a single Scope."
|
|
};
|
|
}
|
|
|
|
// UpdateScope updates an existing Scope in boundary. The provided
|
|
// Scope 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 scope. An error is returned if the Scope 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 in use by another scope in the parent scope.
|
|
rpc UpdateScope(UpdateScopeRequest) returns (UpdateScopeResponse) {
|
|
option (google.api.http) = {
|
|
patch: "/v1/scopes/{id}"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Updates a Scope."
|
|
};
|
|
}
|
|
|
|
// DeleteScope remotes a Scope and all child resources from Boundary. If the
|
|
// provided Scope IDs are malformed or not provided an error is returned.
|
|
rpc DeleteScope(DeleteScopeRequest) returns (DeleteScopeResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/v1/scopes/{id}"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Deletes a Scope."
|
|
};
|
|
}
|
|
}
|
|
|
|
message GetScopeRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message GetScopeResponse {
|
|
resources.scopes.v1.Scope item = 1;
|
|
}
|
|
|
|
message ListScopesRequest {
|
|
string scope_id = 1;
|
|
bool recursive = 20 [json_name="recursive"];
|
|
string filter = 30 [json_name="filter"];
|
|
}
|
|
|
|
message ListScopesResponse {
|
|
repeated resources.scopes.v1.Scope items = 1;
|
|
}
|
|
|
|
message CreateScopeRequest {
|
|
bool skip_admin_role_creation = 1;
|
|
bool skip_default_role_creation = 2;
|
|
resources.scopes.v1.Scope item = 3;
|
|
}
|
|
|
|
message CreateScopeResponse {
|
|
string uri = 1;
|
|
resources.scopes.v1.Scope item = 2;
|
|
}
|
|
|
|
message UpdateScopeRequest {
|
|
string id = 1;
|
|
resources.scopes.v1.Scope item = 2;
|
|
google.protobuf.FieldMask update_mask = 3 [json_name="update_mask"];
|
|
}
|
|
|
|
message UpdateScopeResponse {
|
|
resources.scopes.v1.Scope item = 1;
|
|
}
|
|
|
|
message DeleteScopeRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message DeleteScopeResponse {}
|