Skip to content

Commit 7da19ab

Browse files
authored
feat(groups): Invite not found members to organization if added to group (#2192)
Signed-off-by: Javier Rodriguez <[email protected]>
1 parent 8376010 commit 7da19ab

32 files changed

+1822
-229
lines changed

app/controlplane/api/controlplane/v1/group.pb.go

Lines changed: 426 additions & 149 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/controlplane/v1/group.proto

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ service GroupService {
4343
rpc AddMember(GroupServiceAddMemberRequest) returns (GroupServiceAddMemberResponse) {}
4444
// RemoveMember removes a user from a group
4545
rpc RemoveMember(GroupServiceRemoveMemberRequest) returns (GroupServiceRemoveMemberResponse) {}
46+
// ListPendingInvitations retrieves pending invitations for a group
47+
rpc ListPendingInvitations(GroupServiceListPendingInvitationsRequest) returns (GroupServiceListPendingInvitationsResponse) {}
4648
}
4749

4850
// GroupServiceCreateRequest contains the information needed to create a new group
@@ -160,6 +162,31 @@ message GroupServiceRemoveMemberRequest {
160162
// GroupServiceRemoveMemberResponse is returned upon successful removal of a user from a group
161163
message GroupServiceRemoveMemberResponse {}
162164

165+
message GroupServiceListPendingInvitationsRequest {
166+
// IdentityReference is used to specify the group by either its ID or name
167+
IdentityReference group_reference = 1 [(buf.validate.field).required = true];
168+
// Pagination parameters to limit and offset results
169+
OffsetPaginationRequest pagination = 2;
170+
}
171+
172+
// GroupServiceListPendingInvitationsResponse contains a list of pending invitations for a group
173+
message GroupServiceListPendingInvitationsResponse {
174+
// List of pending invitations for the group
175+
repeated PendingGroupInvitation invitations = 1;
176+
// Pagination information for the response
177+
OffsetPaginationResponse pagination = 2;
178+
}
179+
180+
// PendingInvitation represents an invitation to join a group that has not yet been accepted
181+
message PendingGroupInvitation {
182+
// The email address of the user invited to the group
183+
string user_email = 1 [(buf.validate.field).string.email = true];
184+
// The user who sent the invitation
185+
optional User invited_by = 2;
186+
// Timestamp when the invitation was created
187+
google.protobuf.Timestamp created_at = 3;
188+
}
189+
163190
// Group represents a collection of users with shared access to resources
164191
message Group {
165192
// Unique identifier for the group

app/controlplane/api/controlplane/v1/group_grpc.pb.go

Lines changed: 47 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)