* Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * Update copyright file headers to BUS-1.1 * Rerun make gen This will pick up the last of the license changes * Revert "Rerun make gen" This reverts commit dbe0968bffd92745d8663c6940debae098395a6b. * Remove copywrite from generation script The current version of copywrite is not sophisticated enough to only apply the copywrite changes to certain subdirectories, so to avoid accidentally relicensing our api and sdk modules, we will stop running the copywrite script until such time that it can do the right thing. * License protobuf API as MPL The protobuf API files are used to generate the SDK, since we want the SDK to be MPL, the protobuf files must also be MPL. This extends to all protobuf files whose sources end up in the SDK directory, including: - internal/proto/controller/api - internal/proto/controller/custom_options - internal/proto/plugin It also includes the generated service directory in internal/gen/controller/api/services, since they are generated from the protobuf sources used for the SDK. * Change website license file name This makes the naming scheme consistent with the rest of the repository. * Add note on licensing to README * Set copywrite license to BUSL * Revert "Add note on licensing to README" This reverts commit 4d865a91a7a4f11605f0dc4609355d7e3c3cfffe. --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
173 lines
4.0 KiB
Protocol Buffer
173 lines
4.0 KiB
Protocol Buffer
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
syntax = "proto3";
|
|
|
|
package testing.attribute.v1;
|
|
|
|
import "controller/custom_options/v1/options.proto";
|
|
import "google/api/annotations.proto";
|
|
import "google/protobuf/field_mask.proto";
|
|
import "google/protobuf/struct.proto";
|
|
import "protoc-gen-openapiv2/options/annotations.proto";
|
|
|
|
option go_package = "github.com/hashicorp/boundary/internal/gen/testing/attribute;attribute";
|
|
option (controller.custom_options.v1.domain) = "test";
|
|
|
|
message TestResource {
|
|
string id = 1;
|
|
string type = 2;
|
|
|
|
string other_id = 3 [(controller.custom_options.v1.subtype_source_id) = true];
|
|
|
|
oneof attrs {
|
|
google.protobuf.Struct attributes = 10 [(controller.custom_options.v1.subtype) = "default"];
|
|
TestSubResourceAttributes sub_resource_attributes = 20 [(controller.custom_options.v1.subtype) = "sub_resource"];
|
|
}
|
|
}
|
|
|
|
message TestSubResourceAttributes {
|
|
string name = 1;
|
|
}
|
|
|
|
message TestNoAttributes {
|
|
string id = 1;
|
|
string type = 2;
|
|
}
|
|
|
|
message TestNoOneOf {
|
|
string id = 1;
|
|
string type = 2;
|
|
|
|
google.protobuf.Struct attributes = 10;
|
|
}
|
|
|
|
message TestCustomTransformation {
|
|
string some_random_id = 1;
|
|
string secondary_id = 2;
|
|
|
|
oneof attrs {
|
|
google.protobuf.Struct attributes = 10;
|
|
TestSubResourceAttributes sub_resource_attributes = 20;
|
|
}
|
|
}
|
|
|
|
service TestResourceService {
|
|
rpc TestListResource(TestListResourceRequest) returns (TestListResourceResponse) {
|
|
option (google.api.http) = {get: "/v1/test-resources"};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Test list"};
|
|
}
|
|
|
|
rpc TestCreateResource(TestCreateResourceRequest) returns (TestCreateResourceResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/test-resources"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Test create"};
|
|
}
|
|
|
|
rpc TestUpdateResource(TestUpdateResourceRequest) returns (TestUpdateResourceResponse) {
|
|
option (google.api.http) = {
|
|
patch: "/v1/test-resources/{id}"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Test update"};
|
|
}
|
|
|
|
rpc TestGetResource(TestGetResourceRequest) returns (TestGetResourceResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/test-resources/{id}"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {summary: "Test get"};
|
|
}
|
|
}
|
|
|
|
message TestListResourceRequest {}
|
|
|
|
message TestListResourceResponse {
|
|
repeated TestResource items = 1;
|
|
}
|
|
|
|
message TestGetResourceRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message TestGetResourceResponse {
|
|
TestResource item = 1;
|
|
}
|
|
|
|
message TestCreateResourceRequest {
|
|
TestResource item = 2;
|
|
}
|
|
|
|
message TestCreateResourceResponse {
|
|
TestResource item = 1;
|
|
}
|
|
|
|
message TestUpdateResourceRequest {
|
|
string id = 1;
|
|
TestResource item = 2;
|
|
google.protobuf.FieldMask update_mask = 3 [json_name = "update_mask"];
|
|
}
|
|
|
|
message TestUpdateResourceResponse {
|
|
TestResource item = 1;
|
|
}
|
|
|
|
message TestRequestNoItem {
|
|
string name = 1;
|
|
}
|
|
|
|
message TestRequestItemNotMessage {
|
|
string item = 1;
|
|
}
|
|
|
|
message TestItemNoType {
|
|
string id = 1;
|
|
}
|
|
|
|
message TestRequestItemNoType {
|
|
TestItemNoType item = 1;
|
|
}
|
|
|
|
message TestNoItemAttributes {
|
|
string id = 1;
|
|
|
|
oneof attrs {
|
|
google.protobuf.Struct attributes = 10 [(controller.custom_options.v1.subtype) = "default"];
|
|
TestSubResourceAttributes sub_resource_attributes = 20 [(controller.custom_options.v1.subtype) = "sub_resource"];
|
|
}
|
|
}
|
|
|
|
message TestCreateNoOneOfRequest {
|
|
TestNoOneOf item = 1;
|
|
}
|
|
|
|
message TestUpdateNoOneOfRequest {
|
|
string id = 1;
|
|
TestNoOneOf item = 2;
|
|
}
|
|
|
|
message TestResponseNoItem {
|
|
string name = 1;
|
|
}
|
|
|
|
message TestResponseItemNotMessage {
|
|
string item = 1;
|
|
}
|
|
|
|
message TestResponseItemNoType {
|
|
TestItemNoType item = 1;
|
|
}
|
|
|
|
message TestCreateNoOneOfResponse {
|
|
TestNoOneOf item = 1;
|
|
}
|
|
|
|
message TestUpdateNoOneOfResponse {
|
|
TestNoOneOf item = 1;
|
|
}
|