Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce user group management APIs #22

Merged
merged 20 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions temporal/api/cloud/cloudservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,100 @@ message GetRegionResponse {
// The temporal cloud region.
temporal.api.cloud.region.v1.Region region = 1;
}

message GetUserGroupsRequest {
// The requested size of the page to retrieve - optional.
// Cannot exceed 1000. Defaults to 100.
int32 page_size = 1;
// The page token if this is continuing from another response - optional.
string page_token = 2;
// Only return groups that grant access to the specified namespace - optional.
string namespace = 3;
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
// Filter groups by their name - optional.
string name = 4;
}

message GetUserGroupsResponse {
// The list of groups in ascending name order.
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
repeated temporal.api.cloud.identity.v1.UserGroup groups = 1;
// The next page's token.
string next_page_token = 2;
}

message GetUserGroupRequest {
// The id of the group to get.
string group_id = 1;
}

message GetUserGroupResponse {
// The group.
temporal.api.cloud.identity.v1.UserGroup group = 1;
}

message CreateUserGroupRequest {
// The spec for the group to create.
temporal.api.cloud.identity.v1.UserGroupSpec spec = 1;
// The id to use for this async operation.
// Optional, if not provided a random id will be generated.
string async_operation_id = 2;
}

message CreateUserGroupResponse {
// The id of the group that was created.
string group_id = 1;
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
}

message UpdateUserGroupRequest {
// The id of the group to update.
string group_id = 1;
// The new group specification.
temporal.api.cloud.identity.v1.UserGroupSpec spec = 2;
// The version of the group for which this update is intended for.
// The latest version can be found in the GetGroup operation response.
string resource_version = 3;
// The id to use for this async operation.
// Optional, if not provided a random id will be generated.
string async_operation_id = 4;
}

message UpdateUserGroupResponse {
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message DeleteUserGroupRequest {
// The id of the group to delete.
string group_id = 1;
// The version of the group for which this delete is intended for.
// The latest version can be found in the GetGroup operation response.
string resource_version = 2;
// The id to use for this async operation.
// Optional, if not provided a random id will be generated.
string async_operation_id = 3;
}

message DeleteUserGroupResponse {
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}

message SetUserGroupNamespaceAccessRequest {
// The namespace to set permissions for.
string namespace = 1;
// The id of the group to set permissions for.
string group_id = 2;
// The namespace access to assign the group. If left empty, the group will be removed from the namespace access.
temporal.api.cloud.identity.v1.NamespaceAccess access = 3;
// The version of the group for which this update is intended for.
// The latest version can be found in the GetGroup operation response.
string resource_version = 4;
// The id to use for this async operation - optional.
string async_operation_id = 5;
}

message SetUserGroupNamespaceAccessResponse {
// The async operation.
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
}
45 changes: 45 additions & 0 deletions temporal/api/cloud/cloudservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,49 @@ service CloudService {
get: "/api/v1/cloud/regions/{region}",
};
}

// Get all groups
rpc GetUserGroups (GetUserGroupsRequest) returns (GetUserGroupsResponse) {
option (google.api.http) = {
get: "/api/v1/cloud/user-groups",
};
}

// Get a group
rpc GetUserGroup (GetUserGroupRequest) returns (GetUserGroupResponse) {
option (google.api.http) = {
get: "/api/v1/cloud/user-groups/{group_id}",
};
}

// Create new a group
rpc CreateUserGroup (CreateUserGroupRequest) returns (CreateUserGroupResponse) {
option (google.api.http) = {
post: "/api/v1/cloud/user-groups",
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
body: "*"
};
}

// Update a group
rpc UpdateUserGroup (UpdateUserGroupRequest) returns (UpdateUserGroupResponse) {
option (google.api.http) = {
post: "/api/v1/cloud/user-groups/{group_id}",
body: "*"
};
}

// Delete a group
rpc DeleteUserGroup (DeleteUserGroupRequest) returns (DeleteUserGroupResponse) {
option (google.api.http) = {
delete: "/api/v1/cloud/user-groups/{group_id}",
};
}

// Set a group's access to a namespace
rpc SetUserGroupNamespaceAccess (SetUserGroupNamespaceAccessRequest) returns (SetUserGroupNamespaceAccessResponse) {
option (google.api.http) = {
post: "/api/v1/cloud/namespaces/{namespace}/user-groups/{group_id}/access",
body: "*"
};
}
}
32 changes: 31 additions & 1 deletion temporal/api/cloud/identity/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@ message User {
// The date and time when the user was created
google.protobuf.Timestamp created_time = 7;
// The date and time when the user was last modified
// Will not be set if the user has never been modified.
// Will not be set if the user has never been modified
google.protobuf.Timestamp last_modified_time = 8;
}

message UserGroupSpec {
// The name of the group as defined in the customer's IdP (e.g. Google group name in Google Workspace).
// The name is immutable. Once set, it cannot be changed.
string name = 1;
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
// The type of the group. e.g. "googleworkspace"
// This field is immutable. Once set, it cannot be changed.
string type = 2;
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
codemonkeycxy marked this conversation as resolved.
Show resolved Hide resolved
// The access assigned to the group
temporal.api.cloud.identity.v1.Access access = 3;
}

message UserGroup {
// The id of the group
string id = 1;
// The current version of the group specification
// The next update operation will have to include this version
string resource_version = 2;
// The group specification
UserGroupSpec spec = 3;
// The current state of the group
string state = 4;
// The id of the async operation that is creating/updating/deleting the group, if any
string async_operation_id = 5;
// The date and time when the group was created
google.protobuf.Timestamp created_time = 6;
// The date and time when the group was last modified
// Will not be set if the group has never been modified
google.protobuf.Timestamp last_modified_time = 7;
}
Loading