Skip to content

Commit

Permalink
internal/gen: remove required annotations
Browse files Browse the repository at this point in the history
Unfortunately, while these help with the creating of resources, they still
appear required in contexts where they are not, such as when
updating a resource.
  • Loading branch information
johanbrandhorst committed Mar 25, 2024
1 parent d87053b commit 24e3dbd
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 299 deletions.
17 changes: 4 additions & 13 deletions internal/gen/controller.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"name": "Alias service",
"description": "The alias service exposes endpoints for interacting with aliases in Boundary. An alias acts as a reference or an alternate name for an existing entity within the Boundary access control system. It provides a way to simplify access control by offering a more user-friendly or descriptive identifier for an entity."
"description": "The alias service exposes endpoints for interacting with aliases in Boundary. An alias acts as a reference or an alternate id for an existing entity within the Boundary access control system. It provides a way to simplify access control by offering a more user-friendly or descriptive identifier for an entity."
},
{
"name": "Auth method service",
Expand Down Expand Up @@ -5771,11 +5771,7 @@
"readOnly": true
}
},
"title": "Account contains all fields related to an account resource",
"required": [
"auth_method_id",
"attributes"
]
"title": "Account contains all fields related to an account resource"
},
"controller.api.resources.aliases.v1.Alias": {
"type": "object",
Expand Down Expand Up @@ -5821,7 +5817,7 @@
},
"value": {
"type": "string",
"description": "Required value of the alias. This is the value referenced by the user that\nis resolved to the destination id."
"description": "Value of the alias. This is the value referenced by the user that\nis resolved to the destination id."
},
"destination_id": {
"type": "string",
Expand Down Expand Up @@ -5849,12 +5845,7 @@
"readOnly": true
}
},
"title": "Alias contains all fields related to an Alias resource",
"required": [
"scope_id",
"value",
"type"
]
"title": "Alias contains all fields related to an Alias resource"
},
"controller.api.resources.authmethods.v1.AuthMethod": {
"type": "object",
Expand Down
44 changes: 22 additions & 22 deletions internal/gen/controller/api/services/alias_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 6 additions & 15 deletions internal/proto/controller/api/resources/accounts/v1/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@ message Account {
// The ID of the auth method that is associated with this account.
string auth_method_id = 90 [
json_name = "auth_method_id",
(custom_options.v1.subtype_source_id) = true,
(google.api.field_behavior) = REQUIRED
(custom_options.v1.subtype_source_id) = true
]; // @gotags: `class:"public" eventstream:"observation"`

oneof attrs {
// The attributes that are applicable for the specific account type.
google.protobuf.Struct attributes = 100 [
(custom_options.v1.generate_sdk_option) = true,
(custom_options.v1.subtype) = "default",
(google.api.field_behavior) = REQUIRED,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "{\"login_name\": \"login_name\"}",
description:
Expand Down Expand Up @@ -150,15 +148,11 @@ message PasswordAccountAttributes {
(custom_options.v1.mask_mapping) = {
this: "attributes.login_name"
that: "LoginName"
},
(google.api.field_behavior) = REQUIRED
}
]; // @gotags: `class:"sensitive"`

// The password for this account.
google.protobuf.StringValue password = 20 [
(custom_options.v1.generate_sdk_option) = true,
(google.api.field_behavior) = REQUIRED
]; // @gotags: `class:"secret"`
google.protobuf.StringValue password = 20 [(custom_options.v1.generate_sdk_option) = true]; // @gotags: `class:"secret"`
}

// Attributes associated only with accounts with type "oidc".
Expand All @@ -167,16 +161,14 @@ message OidcAccountAttributes {
// This value is immutable after creation time.
string issuer = 80 [
json_name = "issuer",
(custom_options.v1.generate_sdk_option) = true,
(google.api.field_behavior) = REQUIRED
(custom_options.v1.generate_sdk_option) = true
]; // @gotags: `class:"public"`

// subject is a case sensitive string that maps to the OIDC sub claim.
// This value is immutable after creation time.
string subject = 90 [
json_name = "subject",
(custom_options.v1.generate_sdk_option) = true,
(google.api.field_behavior) = REQUIRED
(custom_options.v1.generate_sdk_option) = true
]; // @gotags: `class:"public"`

// A string that maps to the OIDC name claim.
Expand Down Expand Up @@ -206,8 +198,7 @@ message LdapAccountAttributes {
(custom_options.v1.mask_mapping) = {
this: "attributes.login_name"
that: "LoginName"
},
(google.api.field_behavior) = REQUIRED
}
]; // @gotags: `class:"sensitive"`

// A string that maps to the name attribute for the
Expand Down
12 changes: 4 additions & 8 deletions internal/proto/controller/api/resources/aliases/v1/alias.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ message Alias {
string id = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; // @gotags: `class:"public" eventstream:"observation"`

// The ID of the scope of which this Alias is a part.
string scope_id = 20 [
json_name = "scope_id",
(google.api.field_behavior) = REQUIRED
]; // @gotags: `class:"public" eventstream:"observation"`
string scope_id = 20 [json_name = "scope_id"]; // @gotags: `class:"public" eventstream:"observation"`

// Scope information for this Alias.
resources.scopes.v1.ScopeInfo scope = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down Expand Up @@ -65,15 +62,14 @@ message Alias {
// Not required when creating an alias.
uint32 version = 80; // @gotags: `class:"public"`

// Required value of the alias. This is the value referenced by the user that
// Value of the alias. This is the value referenced by the user that
// is resolved to the destination id.
string value = 90 [
(custom_options.v1.generate_sdk_option) = true,
(custom_options.v1.mask_mapping) = {
this: "value"
that: "Value"
},
(google.api.field_behavior) = REQUIRED
}
]; // @gotags: `class:"public"`

// destination_id is the id of the resource that this Alias points to.
Expand All @@ -87,7 +83,7 @@ message Alias {
]; // @gotags: `class:"public" eventstream:"observation"`

// type is the type of the alias.
string type = 110 [(google.api.field_behavior) = REQUIRED]; // @gotags: `class:"public" eventstream:"observation"`
string type = 110; // @gotags: `class:"public" eventstream:"observation"`

oneof attrs {
// The attributes that are applicable for the specific Alias type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ service AliasService {
name: "Alias service"
description:
"The alias service exposes endpoints for interacting with aliases in Boundary. "
"An alias acts as a reference or an alternate name for an existing entity within the Boundary access control system. "
"An alias acts as a reference or an alternate id for an existing entity within the Boundary access control system. "
"It provides a way to simplify access control by offering a more user-friendly or descriptive identifier for an entity."
};

Expand Down
Loading

0 comments on commit 24e3dbd

Please sign in to comment.