Skip to content

Commit

Permalink
Add Auth0 support service and Invites manager
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidS-ovm committed Oct 3, 2023
1 parent 420f16b commit 23b7b11
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
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 {
}

0 comments on commit 23b7b11

Please sign in to comment.