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

Add Auth0 support service and Invites manager #130

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
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
41 changes: 41 additions & 0 deletions auth0support.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
syntax = "proto3";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

import "account.proto";

package auth0support;

option go_package = "github.com/overmindtech/sdp-go;sdp";

// |`-._/\_.-`|
// | || |
// |___o()o___|
// |__((<>))__|
// \ o\/o /
// \ || /
// \ || /
// jgs '.||.'
//
// Credit: https://www.asciiart.eu/

// The auth0 support service contains the endpoints used by Auth0 Actions to
// post updates and receive additional information into Auth0.
service Auth0Support {
// create a new user on first login
rpc CreateUser(Auth0CreateUserRequest) returns (Auth0CreateUserResponse);

// Updates sources to keep them running in the background. This is called on
// login by auth0 to give us a chance to boot up sources while the app is
// loading.
rpc KeepaliveSources(account.AdminKeepaliveSourcesRequest) returns (account.KeepaliveSourcesResponse);
}

message Auth0CreateUserRequest {
string user_id = 1;
string email = 2;
}
message Auth0CreateUserResponse {
string org_id = 1;
}
61 changes: 61 additions & 0 deletions invites.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
syntax = "proto3";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

package invites;

option go_package = "github.com/overmindtech/sdp-go;sdp";

// _
// |E]
// .-|=====-.
// | | MAIL |
// |________|___
// ||
// ||
// || www %%%
// vwv || )_(,;;;, ,;,\_/ www
// )_( || \|/ \_/ )_(\| (_)
// \| \ || /\\|/ |/ \| \|// |
// ___\|//jgs||//_\V/_\|//_______\\|//V/\\|/__
//
// Credit: https://www.asciiart.eu/

// provides all operations for inviting people to an organization
service InviteService {
rpc CreateInvite(CreateInviteRequest) returns (CreateInviteResponse);
rpc ListInvites(ListInvitesRequest) returns (ListInvitesResponse);
rpc RevokeInvite(RevokeInviteRequest) returns (RevokeInviteResponse);
}

message CreateInviteRequest {
repeated string emails = 1;
}
message CreateInviteResponse {
}

message Invite {
string email = 1;

enum InviteStatus {
INVITE_STATUS_UNSPECIFIED = 0;
// The user has been invited but has not yet accepted
INVITE_STATUS_INVITED = 1;
// The user has accepted the invitation
INVITE_STATUS_ACCEPTED = 2;
}
InviteStatus status = 2;
}

message ListInvitesRequest {
}
message ListInvitesResponse {
repeated Invite invites = 1;
}

message RevokeInviteRequest {
string email = 1;
}
message RevokeInviteResponse {
}
Loading