diff --git a/auth0support.proto b/auth0support.proto new file mode 100644 index 0000000..d3ce2ea --- /dev/null +++ b/auth0support.proto @@ -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; +} diff --git a/invites.proto b/invites.proto new file mode 100644 index 0000000..d59b910 --- /dev/null +++ b/invites.proto @@ -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 { +}