Version can be passed through request body (#281)

* Scopes inline version into update request body.

* Users inline version into update request body.

* Group inline version into update and add|set|remove member request body.

* Role inline version into update and add|set|remove grant|principal request body.

* Auth method inline version into update request body.

* Auth Account inline version into update request body.

* host catalog version is inlined for update.

* Gen after merge.

* Submitting template changes for version handling.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-08-18 17:38:38 -07:00
1 parent e20c150617
commit d86e58476f
62 files changed
+1629 -2137

No files matched your search

@@ -36,7 +36,6 @@ message Account {
// The version can be used in subsequent write requests to ensure this resource
// has not changed and to fail the write if it has.
// Output only.
uint32 version = 70;
// The type of this account. Possible values are: "password", "oidc".
@@ -36,7 +36,6 @@ message AuthMethod {
// The version can be used in subsequent write requests to ensure this resource
// has not changed and to fail the write if it has.
// Output only.
uint32 version = 7;
// The auth method type. This can be "password" or "oidc".
@@ -45,7 +45,6 @@ message Group {
// The version can be used in subsequent write requests to ensure this resource
// has not changed and to fail the write if it has.
// Output only.
uint32 version = 70;
// Contains the list of member ids in this group.
@@ -36,7 +36,6 @@ message HostCatalog {
// The version can be used in subsequent write requests to ensure this resource
// has not changed and to fail the write if it has.
// Output only.
uint32 version = 70;
// The type of the resource, to help differentiate schemas
@@ -77,7 +77,6 @@ message Role {
// The version can be used in subsequent write requests to ensure this resource
// has not changed and to fail the write if it has.
// Output only.
uint32 version = 70;
// The scope the grants will apply to. If the role is at the global scope,
@@ -35,6 +35,5 @@ message User {
// The version can be used in subsequent write requests to ensure this
// resource has not changed and to fail the write if it has.
// Output only.
uint32 version = 70;
}
@@ -149,9 +149,8 @@ message CreateAccountResponse {
message UpdateAccountRequest {
string auth_method_id = 1;
string id = 2;
uint32 version = 3;
resources.authmethods.v1.Account item = 4;
google.protobuf.FieldMask update_mask = 5;
resources.authmethods.v1.Account item = 3;
google.protobuf.FieldMask update_mask = 4;
}
message UpdateAccountResponse {
@@ -115,9 +115,8 @@ message CreateAuthMethodResponse {
message UpdateAuthMethodRequest {
string id = 1;
uint32 version = 2;
resources.authmethods.v1.AuthMethod item = 3;
google.protobuf.FieldMask update_mask = 4;
resources.authmethods.v1.AuthMethod item = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateAuthMethodResponse {
@@ -96,7 +96,7 @@ service GroupService {
rpc AddGroupMembers(AddGroupMembersRequest) returns (AddGroupMembersResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/groups/{id}:add-members"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -112,7 +112,7 @@ service GroupService {
rpc SetGroupMembers(SetGroupMembersRequest) returns (SetGroupMembersResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/groups/{id}:set-members"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -127,7 +127,7 @@ service GroupService {
rpc RemoveGroupMembers(RemoveGroupMembersRequest) returns (RemoveGroupMembersResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/groups/{id}:remove-members"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -164,9 +164,8 @@ message CreateGroupResponse {
message UpdateGroupRequest {
string id = 1;
uint32 version = 2;
resources.groups.v1.Group item = 3;
google.protobuf.FieldMask update_mask = 4;
resources.groups.v1.Group item = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateGroupResponse {
@@ -181,16 +180,12 @@ message DeleteGroupResponse {
bool existed = 1;
}
message GroupMemberIdsMessage {
repeated string member_ids = 1 [json_name="member_ids"];
}
message AddGroupMembersRequest {
string id = 1;
// The version ensures the group hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
GroupMemberIdsMessage item = 3;
repeated string member_ids = 3 [json_name="member_ids"];
}
message AddGroupMembersResponse {
@@ -202,7 +197,7 @@ message SetGroupMembersRequest {
// The version ensures the group hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
GroupMemberIdsMessage item = 3;
repeated string member_ids = 3 [json_name="member_ids"];
}
message SetGroupMembersResponse {
@@ -214,7 +209,7 @@ message RemoveGroupMembersRequest {
// The version ensures the group hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
GroupMemberIdsMessage item = 3;
repeated string member_ids = 3 [json_name="member_ids"];
}
message RemoveGroupMembersResponse {
@@ -120,9 +120,8 @@ message CreateHostCatalogResponse {
message UpdateHostCatalogRequest {
string id = 1;
uint32 version = 2;
api.resources.hosts.v1.HostCatalog item = 3;
google.protobuf.FieldMask update_mask = 4;
api.resources.hosts.v1.HostCatalog item = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateHostCatalogResponse {
@@ -94,7 +94,7 @@ service RoleService {
rpc AddRolePrincipals(AddRolePrincipalsRequest) returns (AddRolePrincipalsResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/roles/{role_id}:add-principals"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -111,7 +111,7 @@ service RoleService {
rpc SetRolePrincipals(SetRolePrincipalsRequest) returns (SetRolePrincipalsResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/roles/{role_id}:set-principals"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -127,7 +127,7 @@ service RoleService {
rpc RemoveRolePrincipals(RemoveRolePrincipalsRequest) returns (RemoveRolePrincipalsResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/roles/{role_id}:remove-principals"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -142,7 +142,7 @@ service RoleService {
rpc AddRoleGrants(AddRoleGrantsRequest) returns (AddRoleGrantsResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/roles/{role_id}:add-grants"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -158,7 +158,7 @@ service RoleService {
rpc SetRoleGrants(SetRoleGrantsRequest) returns (SetRoleGrantsResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/roles/{role_id}:set-grants"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -174,7 +174,7 @@ service RoleService {
rpc RemoveRoleGrants(RemoveRoleGrantsRequest) returns (RemoveRoleGrantsResponse) {
option (google.api.http) = {
post: "/v1/scopes/*/roles/{role_id}:remove-grants"
body: "item"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
@@ -213,9 +213,8 @@ message CreateRoleResponse {
// TODO: Add versions to Update and Delete role requests.
message UpdateRoleRequest {
string id = 1;
uint32 version = 2;
resources.roles.v1.Role item = 3;
google.protobuf.FieldMask update_mask = 4;
resources.roles.v1.Role item = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateRoleResponse {
@@ -230,17 +229,12 @@ message DeleteRoleResponse {
bool existed = 1;
}
message PrincipalIdsMessage {
repeated string principal_ids = 1 [json_name="principal_ids"];
}
message AddRolePrincipalsRequest {
string role_id = 1;
// The version ensures the role hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
PrincipalIdsMessage item = 3;
repeated string principal_ids = 3 [json_name="principal_ids"];
}
message AddRolePrincipalsResponse {
@@ -252,8 +246,7 @@ message SetRolePrincipalsRequest {
// The version ensures the role hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
PrincipalIdsMessage item = 3;
repeated string principal_ids = 3 [json_name="principal_ids"];
}
message SetRolePrincipalsResponse {
@@ -265,25 +258,19 @@ message RemoveRolePrincipalsRequest {
// The version ensures the role hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
PrincipalIdsMessage item = 3;
repeated string principal_ids = 3 [json_name="principal_ids"];
}
message RemoveRolePrincipalsResponse {
resources.roles.v1.Role item = 1;
}
message GrantStringsMessage {
repeated string grant_strings = 1 [json_name="grant_strings"];
}
message AddRoleGrantsRequest {
string role_id = 1;
// The version ensures the role hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
GrantStringsMessage item = 3;;
repeated string grant_strings = 3 [json_name="grant_strings"];
}
message AddRoleGrantsResponse {
@@ -295,8 +282,7 @@ message SetRoleGrantsRequest {
// The version ensures the role hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
GrantStringsMessage item = 3;
repeated string grant_strings = 3 [json_name="grant_strings"];
}
message SetRoleGrantsResponse {
@@ -308,8 +294,7 @@ message RemoveRoleGrantsRequest {
// The version ensures the role hasn't changed since it was last retrieved and if
// it has the request will fail.
uint32 version = 2;
GrantStringsMessage item = 3;
repeated string grant_strings = 3 [json_name="grant_strings"];
}
message RemoveRoleGrantsResponse {
@@ -116,9 +116,8 @@ message CreateScopeResponse {
message UpdateScopeRequest {
string id = 1;
uint32 version = 2;
resources.scopes.v1.Scope item = 3;
google.protobuf.FieldMask update_mask = 4;
resources.scopes.v1.Scope item = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateScopeResponse {
@@ -116,9 +116,8 @@ message CreateUserResponse {
message UpdateUserRequest {
string id = 1;
uint32 version = 2;
resources.users.v1.User item = 3;
google.protobuf.FieldMask update_mask = 4;
resources.users.v1.User item = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateUserResponse {