Skip to content

Commit f43a366

Browse files
authored
Add support for granting namespace permissions to a service account (#87)
1 parent 5288996 commit f43a366

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

temporal/api/cloud/cloudservice/v1/request_response.proto

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import "temporal/api/cloud/connectivityrule/v1/message.proto";
2222

2323
message GetUsersRequest {
2424
// The requested size of the page to retrieve - optional.
25-
// Cannot exceed 1000. Defaults to 100.
25+
// Cannot exceed 1000. Defaults to 100.
2626
int32 page_size = 1;
2727
// The page token if this is continuing from another response - optional.
2828
string page_token = 2;
@@ -144,8 +144,8 @@ message CreateNamespaceResponse {
144144

145145
message GetNamespacesRequest {
146146
// The requested size of the page to retrieve.
147-
// Cannot exceed 1000.
148-
// Optional, defaults to 100.
147+
// Cannot exceed 1000.
148+
// Optional, defaults to 100.
149149
int32 page_size = 1;
150150
// The page token if this is continuing from another response.
151151
// Optional, defaults to empty.
@@ -387,7 +387,7 @@ message DeleteApiKeyResponse {
387387

388388
message GetNexusEndpointsRequest {
389389
// The requested size of the page to retrieve - optional.
390-
// Cannot exceed 1000. Defaults to 100.
390+
// Cannot exceed 1000. Defaults to 100.
391391
int32 page_size = 1;
392392

393393
// The page token if this is continuing from another response - optional.
@@ -694,6 +694,25 @@ message UpdateServiceAccountResponse {
694694
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
695695
}
696696

697+
message SetServiceAccountNamespaceAccessRequest {
698+
// The ID of the service account to update.
699+
string service_account_id = 1;
700+
// The namespace to set permissions for.
701+
string namespace = 2;
702+
// The namespace access to assign the service account.
703+
temporal.api.cloud.identity.v1.NamespaceAccess access = 3;
704+
// The version of the service account for which this update is intended for.
705+
// The latest version can be found in the GetServiceAccount response.
706+
string resource_version = 4;
707+
// The ID to use for this async operation - optional.
708+
string async_operation_id = 5;
709+
}
710+
711+
message SetServiceAccountNamespaceAccessResponse {
712+
// The async operation.
713+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
714+
}
715+
697716
message DeleteServiceAccountRequest {
698717
// The ID of the service account to delete;
699718
string service_account_id = 1;
@@ -715,18 +734,18 @@ message GetUsageRequest {
715734
// Must be: within the last 90 days from the current date.
716735
// Must be: midnight UTC time.
717736
google.protobuf.Timestamp start_time_inclusive = 1;
718-
737+
719738
// Filter for UTC time < - optional.
720739
// Defaults to: start of the next UTC day.
721740
// Must be: within the last 90 days from the current date.
722741
// Must be: midnight UTC time.
723742
google.protobuf.Timestamp end_time_exclusive = 2;
724-
743+
725744
// The requested size of the page to retrieve - optional.
726745
// Each count corresponds to a single object - per day per namespace
727746
// Cannot exceed 1000. Defaults to 100.
728747
int32 page_size = 3;
729-
748+
730749
// The page token if this is continuing from another response - optional.
731750
string page_token = 4;
732751
}
@@ -853,11 +872,11 @@ message ValidateNamespaceExportSinkResponse {
853872
message UpdateNamespaceTagsRequest {
854873
// The namespace to set tags for.
855874
string namespace = 1;
856-
// A list of tags to add or update.
857-
// If a key of an existing tag is added, the tag's value is updated.
875+
// A list of tags to add or update.
876+
// If a key of an existing tag is added, the tag's value is updated.
858877
// At least one of tags_to_upsert or tags_to_remove must be specified.
859878
map<string, string> tags_to_upsert = 2;
860-
// A list of tag keys to remove.
879+
// A list of tag keys to remove.
861880
// If a tag key doesn't exist, it is silently ignored.
862881
// At least one of tags_to_upsert or tags_to_remove must be specified.
863882
repeated string tags_to_remove = 3;
@@ -868,7 +887,7 @@ message UpdateNamespaceTagsRequest {
868887
message UpdateNamespaceTagsResponse {
869888
// The async operation.
870889
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
871-
}
890+
}
872891

873892
message CreateConnectivityRuleRequest {
874893
// The connectivity rule specification.
@@ -935,4 +954,4 @@ message ValidateAccountAuditLogSinkRequest {
935954
}
936955

937956
message ValidateAccountAuditLogSinkResponse {
938-
}
957+
}

temporal/api/cloud/cloudservice/v1/service.proto

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ service CloudService {
2121
get: "/cloud/users",
2222
};
2323
}
24-
24+
2525
// Get a user
2626
rpc GetUser(GetUserRequest) returns (GetUserResponse) {
2727
option (google.api.http) = {
@@ -192,7 +192,7 @@ service CloudService {
192192
get: "/cloud/nexus/endpoints",
193193
};
194194
}
195-
195+
196196
// Get a nexus endpoint
197197
rpc GetNexusEndpoint(GetNexusEndpointRequest) returns (GetNexusEndpointResponse) {
198198
option (google.api.http) = {
@@ -320,6 +320,14 @@ service CloudService {
320320
};
321321
}
322322

323+
// Set a service account's access to a namespace.
324+
rpc SetServiceAccountNamespaceAccess(SetServiceAccountNamespaceAccessRequest) returns (SetServiceAccountNamespaceAccessResponse) {
325+
option (google.api.http) = {
326+
post: "/cloud/namespaces/{namespace}/service-accounts/{service_account_id}/access",
327+
body: "*"
328+
};
329+
}
330+
323331
// Delete a service account.
324332
rpc DeleteServiceAccount(DeleteServiceAccountRequest) returns (DeleteServiceAccountResponse) {
325333
option (google.api.http) = {
@@ -358,7 +366,7 @@ service CloudService {
358366
};
359367
}
360368

361-
// Get an export sink
369+
// Get an export sink
362370
rpc GetNamespaceExportSink(GetNamespaceExportSinkRequest) returns (GetNamespaceExportSinkResponse) {
363371
option (google.api.http) = {
364372
get: "/cloud/namespaces/{namespace}/export-sinks/{name}"
@@ -441,4 +449,4 @@ service CloudService {
441449
body: "*"
442450
};
443451
}
444-
}
452+
}

0 commit comments

Comments
 (0)