Skip to content

Commit 9747e97

Browse files
authored
Update cloud-api protos to v0.14.0 (#1240)
* Update cloud-api protos to v0.14.0
1 parent 21263fa commit 9747e97

8 files changed

Lines changed: 300 additions & 5 deletions

File tree

crates/client/src/grpc.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@ macro_rules! proxier_impl {
521521
}
522522
dyn_clone::clone_trait_object!($trait_name);
523523

524+
// `allow(deprecated)`: upstream proto deprecations (e.g. cloud-api
525+
// AddNamespaceRegion) generate calls to deprecated tonic client
526+
// methods inside the impls; we still wire them for back-compat.
527+
#[allow(deprecated)]
524528
impl<RC> $trait_name for RC
525529
where
526530
RC: RawGrpcCaller + RawClientProducer + Clone + Unpin,
@@ -533,6 +537,7 @@ macro_rules! proxier_impl {
533537

534538
impl<T: Send + Sync + 'static> RawGrpcCaller for $client_type<T> {}
535539

540+
#[allow(deprecated)]
536541
impl<T> $trait_name for $client_type<T>
537542
where
538543
T: GrpcService<Body> + Clone + Send + Sync + 'static,
@@ -1798,6 +1803,11 @@ proxier! {
17981803
(get_namespace_capacity_info, cloudreq::GetNamespaceCapacityInfoRequest, cloudreq::GetNamespaceCapacityInfoResponse);
17991804
(create_billing_report, cloudreq::CreateBillingReportRequest, cloudreq::CreateBillingReportResponse);
18001805
(get_billing_report, cloudreq::GetBillingReportRequest, cloudreq::GetBillingReportResponse);
1806+
(get_custom_roles, cloudreq::GetCustomRolesRequest, cloudreq::GetCustomRolesResponse);
1807+
(get_custom_role, cloudreq::GetCustomRoleRequest, cloudreq::GetCustomRoleResponse);
1808+
(create_custom_role, cloudreq::CreateCustomRoleRequest, cloudreq::CreateCustomRoleResponse);
1809+
(update_custom_role, cloudreq::UpdateCustomRoleRequest, cloudreq::UpdateCustomRoleResponse);
1810+
(delete_custom_role, cloudreq::DeleteCustomRoleRequest, cloudreq::DeleteCustomRoleResponse);
18011811
}
18021812

18031813
proxier! {

crates/common/protos/api_cloud_upstream/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To use the Cloud Ops API in your project, preform the following 4 steps:
1515

1616
The client is expected to pass in a `temporal-cloud-api-version` header with the api version identifier with every request it makes to the apis. The backend will use the version to safely mutate resources. The `temporal:versioning:min_version` label specifies the minimum version of the API that supports the field.
1717

18-
Current Version `v0.7.1`
18+
Current Version `v0.14.0`
1919

2020
### URL
2121

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.12.0
1+
v0.14.0

crates/common/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,4 +1093,78 @@ message GetBillingReportRequest {
10931093
message GetBillingReportResponse {
10941094
// The billing report retrieved.
10951095
temporal.api.cloud.billing.v1.BillingReport billing_report = 1;
1096-
}
1096+
}
1097+
1098+
message GetCustomRolesRequest {
1099+
// The requested size of the page to retrieve.
1100+
// Cannot exceed 1000. Defaults to 100.
1101+
int32 page_size = 1;
1102+
// The page token if this is continuing from another response.
1103+
string page_token = 2;
1104+
}
1105+
1106+
message GetCustomRolesResponse {
1107+
// The list of custom roles in ascending ID order.
1108+
repeated temporal.api.cloud.identity.v1.CustomRole custom_roles = 1;
1109+
// The next page token.
1110+
string next_page_token = 2;
1111+
}
1112+
1113+
message GetCustomRoleRequest {
1114+
// The ID of the custom role to retrieve.
1115+
string role_id = 1;
1116+
}
1117+
1118+
message GetCustomRoleResponse {
1119+
// The custom role retrieved.
1120+
temporal.api.cloud.identity.v1.CustomRole custom_role = 1;
1121+
}
1122+
1123+
message CreateCustomRoleRequest {
1124+
// The specification for the custom role to create.
1125+
temporal.api.cloud.identity.v1.CustomRoleSpec spec = 1;
1126+
// The ID to use for this async operation.
1127+
// Optional, if not provided a random ID will be generated.
1128+
string async_operation_id = 2;
1129+
}
1130+
1131+
message CreateCustomRoleResponse {
1132+
// The ID of the custom role created.
1133+
string role_id = 1;
1134+
// The async operation.
1135+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
1136+
}
1137+
1138+
message UpdateCustomRoleRequest {
1139+
// The ID of the custom role to update.
1140+
string role_id = 1;
1141+
// The new custom role specification.
1142+
temporal.api.cloud.identity.v1.CustomRoleSpec spec = 2;
1143+
// The version of the custom role for which this update is intended.
1144+
// The latest version can be found in the GetCustomRole operation response.
1145+
string resource_version = 3;
1146+
// The ID to use for this async operation.
1147+
// Optional, if not provided a random ID will be generated.
1148+
string async_operation_id = 4;
1149+
}
1150+
1151+
message UpdateCustomRoleResponse {
1152+
// The async operation.
1153+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
1154+
}
1155+
1156+
message DeleteCustomRoleRequest {
1157+
// The ID of the custom role to delete.
1158+
string role_id = 1;
1159+
// The version of the custom role for which this delete is intended.
1160+
// The latest version can be found in the GetCustomRole operation response.
1161+
string resource_version = 2;
1162+
// The ID to use for this async operation.
1163+
// Optional, if not provided a random ID will be generated.
1164+
string async_operation_id = 3;
1165+
}
1166+
1167+
message DeleteCustomRoleResponse {
1168+
// The async operation.
1169+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
1170+
}

crates/common/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
4848
{name: "Connectivity Rules"; description: "Manage network connectivity rules"},
4949
{name: "Regions"; description: "Query available regions"},
5050
{name: "Account"; description: "Manage account settings and usage"},
51+
{name: "Custom Roles"; description: "Manage custom roles and their permissions"},
5152
{name: "Operations"; description: "Query async operation status"}
5253
];
5354
};
@@ -285,7 +286,9 @@ service CloudService {
285286
}
286287

287288
// Add a new region to a namespace
289+
// Deprecated: Use the UpdateNamespace() to add new replica in the namespace spec instead.
288290
rpc AddNamespaceRegion (AddNamespaceRegionRequest) returns (AddNamespaceRegionResponse) {
291+
option deprecated = true;
289292
option (google.api.http) = {
290293
post: "/cloud/namespaces/{namespace}/add-region",
291294
body: "*"
@@ -302,7 +305,9 @@ service CloudService {
302305
}
303306

304307
// Delete a region from a namespace
308+
// Deprecated: Use the UpdateNamespace() to delete a replica in the namespace spec instead.
305309
rpc DeleteNamespaceRegion (DeleteNamespaceRegionRequest) returns (DeleteNamespaceRegionResponse) {
310+
option deprecated = true;
306311
option (google.api.http) = {
307312
delete: "/cloud/namespaces/{namespace}/regions/{region}",
308313
};
@@ -1153,4 +1158,86 @@ service CloudService {
11531158
};
11541159
};
11551160
}
1161+
1162+
// Get custom roles
1163+
rpc GetCustomRoles(GetCustomRolesRequest) returns (GetCustomRolesResponse) {
1164+
option (google.api.http) = {
1165+
get: "/cloud/custom-roles"
1166+
};
1167+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
1168+
tags: ["Custom Roles"];
1169+
summary: "List custom roles";
1170+
description: "Returns a list of custom roles in the account";
1171+
external_docs: {
1172+
url: "https://docs.temporal.io/cloud/custom-roles";
1173+
description: "Custom roles documentation";
1174+
};
1175+
};
1176+
}
1177+
1178+
// Get a custom role
1179+
rpc GetCustomRole(GetCustomRoleRequest) returns (GetCustomRoleResponse) {
1180+
option (google.api.http) = {
1181+
get: "/cloud/custom-roles/{role_id}"
1182+
};
1183+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
1184+
tags: ["Custom Roles"];
1185+
summary: "Get custom role by ID";
1186+
description: "Returns details for a specific custom role";
1187+
external_docs: {
1188+
url: "https://docs.temporal.io/cloud/custom-roles";
1189+
description: "Custom roles documentation";
1190+
};
1191+
};
1192+
}
1193+
1194+
// Create a custom role
1195+
rpc CreateCustomRole(CreateCustomRoleRequest) returns (CreateCustomRoleResponse) {
1196+
option (google.api.http) = {
1197+
post: "/cloud/custom-roles"
1198+
body: "*"
1199+
};
1200+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
1201+
tags: ["Custom Roles"];
1202+
summary: "Create a custom role";
1203+
description: "Creates a new custom role in the account";
1204+
external_docs: {
1205+
url: "https://docs.temporal.io/cloud/custom-roles";
1206+
description: "Custom roles documentation";
1207+
};
1208+
};
1209+
}
1210+
1211+
// Update a custom role
1212+
rpc UpdateCustomRole(UpdateCustomRoleRequest) returns (UpdateCustomRoleResponse) {
1213+
option (google.api.http) = {
1214+
post: "/cloud/custom-roles/{role_id}"
1215+
body: "*"
1216+
};
1217+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
1218+
tags: ["Custom Roles"];
1219+
summary: "Update a custom role";
1220+
description: "Updates an existing custom role";
1221+
external_docs: {
1222+
url: "https://docs.temporal.io/cloud/custom-roles";
1223+
description: "Custom roles documentation";
1224+
};
1225+
};
1226+
}
1227+
1228+
// Delete a custom role
1229+
rpc DeleteCustomRole(DeleteCustomRoleRequest) returns (DeleteCustomRoleResponse) {
1230+
option (google.api.http) = {
1231+
delete: "/cloud/custom-roles/{role_id}"
1232+
};
1233+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
1234+
tags: ["Custom Roles"];
1235+
summary: "Delete a custom role";
1236+
description: "Deletes a custom role from the account";
1237+
external_docs: {
1238+
url: "https://docs.temporal.io/cloud/custom-roles";
1239+
description: "Custom roles documentation";
1240+
};
1241+
};
1242+
}
11561243
}

crates/common/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ message AccountAccess {
3737
ROLE_READ = 5; // Gives read only access to the account.
3838
ROLE_METRICS_READ = 6; // Gives read only access to the account metrics.
3939
}
40+
41+
// List of custom role IDs assigned to the user or service account.
42+
// temporal:versioning:min_version=v0.13.0
43+
repeated string custom_roles = 3;
4044
}
4145

4246
message NamespaceAccess {
@@ -73,6 +77,10 @@ message Access {
7377
// The map of namespace accesses
7478
// The key is the namespace name and the value is the access to the namespace
7579
map<string, NamespaceAccess> namespace_accesses = 2;
80+
// List of custom role IDs assigned to the user or service account.
81+
// Deprecated: Not supported after v0.12.0 api version. Use account_access.custom_roles instead.
82+
// temporal:versioning:max_version=v0.12.0
83+
repeated string custom_roles_deprecated = 4 [deprecated = true];
7684
}
7785

7886
message NamespaceScopedAccess {
@@ -294,3 +302,48 @@ message ApiKeySpec {
294302
// True if the API key is disabled.
295303
bool disabled = 6;
296304
}
305+
306+
message CustomRoleSpec {
307+
// The name of the custom role.
308+
string name = 1;
309+
// The description of the custom role.
310+
string description = 2;
311+
// The permissions assigned to the custom role.
312+
repeated Permission permissions = 3;
313+
314+
message Resources {
315+
// The resource type the permission applies to.
316+
string resource_type = 1;
317+
// The resource IDs the permission applies to. Can be empty if allow_all is true.
318+
repeated string resource_ids = 2;
319+
// Whether the permission applies to all resources of the given type.
320+
bool allow_all = 3;
321+
}
322+
323+
message Permission {
324+
// The resources the permission applies to.
325+
Resources resources = 1;
326+
// The actions allowed by the permission.
327+
repeated string actions = 2;
328+
}
329+
}
330+
331+
message CustomRole {
332+
// The id of the custom role.
333+
string id = 1;
334+
// The current version of the custom role specification.
335+
// The next update operation will have to include this version.
336+
string resource_version = 2;
337+
// The custom role specification.
338+
CustomRoleSpec spec = 3;
339+
// The current state of the custom role.
340+
// For any failed state, reach out to Temporal Cloud support for remediation.
341+
temporal.api.cloud.resource.v1.ResourceState state = 4;
342+
// The id of the async operation that is creating/updating/deleting the custom role, if any.
343+
string async_operation_id = 5;
344+
// The date and time when the custom role was created.
345+
google.protobuf.Timestamp created_time = 6;
346+
// The date and time when the custom role was last modified.
347+
// Will not be set if the custom role has never been modified.
348+
google.protobuf.Timestamp last_modified_time = 7;
349+
}

0 commit comments

Comments
 (0)