refact(managed-groups): Switch subtype attributes to oneof

This updates the credential store resources to use a oneof for
attributes. This allows requests to the credential store service to
leverage the new subtypes.AttributeTransformerInterceptor so that
attributes are strongly typed prior to the service handler.
This commit is contained in:
Timothy Messier authored and Johan Brandhorst-Satzkorn committed 2022-04-20 13:32:31 -04:00
1 parent 9643f7af76
commit 5d6cb0009d
7 files changed
+393 -311

No files matched your search

@@ -7,6 +7,7 @@ option go_package = "github.com/hashicorp/boundary/sdk/pbs/controller/api/resour
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/struct.proto";
import "google/api/visibility.proto";
import "controller/api/resources/scopes/v1/scope.proto";
import "controller/custom_options/v1/options.proto";
@@ -40,8 +41,18 @@ message ManagedGroup {
// The ID of the Auth Method that is associated with this ManagedGroup.
string auth_method_id = 90 [json_name="auth_method_id"];
// The attributes that are applicable for the specific ManagedGroup type.
google.protobuf.Struct attributes = 100 [(custom_options.v1.generate_sdk_option) = true];
oneof attrs {
// The attributes that are applicable for the specific ManagedGroup type.
google.protobuf.Struct attributes = 100 [
(custom_options.v1.generate_sdk_option) = true,
(custom_options.v1.subtype) = "default"
];
OidcManagedGroupAttributes oidc_managed_group_attributes = 101 [
(google.api.field_visibility).restriction = "INTERNAL",
(custom_options.v1.generate_sdk_option) = true,
(custom_options.v1.subtype) = "oidc"
];
}
// Output only. The IDs of the current set of members (accounts) that are associated with this ManagedGroup.
repeated string member_ids = 110 [json_name="member_ids"];
@@ -54,4 +65,4 @@ message ManagedGroup {
message OidcManagedGroupAttributes {
// The boolean expression filter to use to determine membership.
string filter = 10 [json_name="filter", (custom_options.v1.generate_sdk_option) = true, (custom_options.v1.mask_mapping) = {this:"attributes.filter" that: "Filter"}];
}
}