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

feat: add invite member apis #295

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all 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
56 changes: 56 additions & 0 deletions proto/global_admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ service GlobalAdmin {
rpc ListMembers(_ListMembersRequest) returns(_ListMembersResponse) {}
rpc GetEndpointsForAccount(_GetEndpointsForAccountRequest) returns (_GetEndpointsForAccountResponse) {}
rpc SetAccountName(_SetAccountNameRequest) returns (_SetAccountNameResponse) {}
rpc InviteMember(_InviteMemberRequest) returns (_InviteMemberResponse) {}
rpc AcceptInvitation(_AcceptInvitationRequest) returns (_AcceptInvitationResponse) {}
rpc RejectInvitation(_RejectInvitationRequest) returns (_RejectInvitationResponse) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PDXKimani FWIW I think in the console UI we should use the word "Decline" for this. I don't have any concerns about the proto not matching the console UI if you've already shipped but just calling it out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, makes sense.

rpc ListInvitationsForAccount(_ListInvitationsForAccountRequest) returns (_ListInvitationsForAccountResponse) {}
rpc RevokeInvitation(_RevokeInvitationRequest) returns (_RevokeInvitationResponse) {}
}

message _SetAccountNameRequest {
Expand Down Expand Up @@ -60,6 +65,57 @@ message _AddMemberRequest {
message _AddMemberResponse {
}

// API Key needs to be provided via the "authorization" header.
// The Account to add the User to is derived from the API key, which is account-scoped.
message _InviteMemberRequest {
string user_name = 1;
}

// This response is for when a Member is invited to the Account,
// These are some of the Errors and their corresponding GRPC status codes.
// 1. User is already a Member. grpc code = FAILED_PRECONDITION. Metadata: "err" -> "already_a_member".
// 2. Account has too many Members. grpc code = RESOURCE_EXHAUSTED. Metadata: "err" -> "max_member_count_exceeded".
message _InviteMemberResponse {
}

// Auth0 Token needs to be provided via the "authorization" header.
// The user is derived from the Auth0 token and added to the account in the invitation if they match the invitation's user.
message _AcceptInvitationRequest {
string invitation_id = 1;
}

message _AcceptInvitationResponse {
}

// Auth0 Token needs to be provided via the "authorization" header.
// The user is derived from the Auth0 token and the invitation is rejected if they match the invitation's user.
// Reject is called by a user to reject an offered invitation.
message _RejectInvitationRequest {
string invitation_id = 1;
}

message _RejectInvitationResponse {
}

// Account Session Token provides relevant account.
message _ListInvitationsForAccountRequest {}

message _Invitation {
string id = 1;
_Member member = 2;
}

message _ListInvitationsForAccountResponse {
repeated _Invitation invitations = 1;
}

// Revoke is called by an account member to revoke a pending invitation in that account.
message _RevokeInvitationRequest {
string invitation_id = 1;
}

message _RevokeInvitationResponse {}

// API Key needs to be provided via the "authorization" header.
// The Account to remove the User from is derived from the API key, which is account-scoped.
message _RemoveMemberRequest {
Expand Down
Loading