github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/cmd/protoc-gen-openapi/converter/testdata/proto/signup.proto (about)

     1  syntax = "proto3";
     2  
     3  option go_package = "./proto;signup";
     4  
     5  package go.micro.generator.test;
     6  
     7  service Signup {
     8  	// Sends the verification email to the user
     9  	rpc SendVerificationEmail(SendVerificationEmailRequest) returns (SendVerificationEmailResponse);
    10  	// Verify kicks off the process of verification
    11  	rpc Verify(VerifyRequest) returns (VerifyResponse);
    12  	rpc SetPaymentMethod(SetPaymentMethodRequest) returns (SetPaymentMethodResponse);
    13  	rpc HasPaymentMethod(HasPaymentMethodRequest) returns (HasPaymentMethodResponse);
    14  	// Creates a subscription and an account
    15  	rpc CompleteSignup(CompleteSignupRequest) returns (CompleteSignupResponse);
    16  	rpc Recover(RecoverRequest) returns (RecoverResponse);
    17  }
    18  
    19  message SendVerificationEmailRequest {
    20  	string email = 1;
    21  }
    22  
    23  message SendVerificationEmailResponse {}
    24  
    25  message VerifyRequest {
    26  	string email = 1;
    27  	// Email token that was received in an email.
    28  	string token = 2;
    29  }
    30  
    31  message VerifyResponse {
    32  	// Auth token to be saved into '~/.micro'
    33  	// For users who are already registered and paid,
    34  	// the flow stops here.
    35  	// For users who are yet to be registered
    36  	// the token will be acquired in the 'FinishSignup' step.
    37  	AuthToken authToken = 1;
    38  	// Payment provider custommer id that can be used to
    39  	// acquire a payment method, see 'micro login' flow for more.
    40  	// @todo this is likely not needed
    41  	string customerID = 2;
    42  	// Namespace to use
    43  	// @todod deprecated since we no longer support OTP logins
    44  	string namespace = 3;
    45  	// Message to display to the user
    46  	string message = 4;
    47  	// Whether payment is required or not
    48  	bool payment_required = 5;
    49  	// Namespaces one has access to based on previous invites
    50  	// Currently only 1 is supported
    51  	repeated string namespaces = 6;
    52  }
    53  
    54  message SetPaymentMethodRequest {
    55  	string email = 1;
    56  	string payment_method = 2;
    57  }
    58  
    59  message SetPaymentMethodResponse {
    60  
    61  }
    62  
    63  message HasPaymentMethodRequest {
    64  	// We can't read by email because that would be too easy to guess.
    65  	// The token is already used for identification purposes during the signup
    66  	// so we will use that too to pull for the payment method.
    67  	string token = 1;
    68  }
    69  
    70  message HasPaymentMethodResponse {
    71  	bool has = 1;
    72  }
    73  
    74  message CompleteSignupRequest {
    75  	string email = 1;
    76  	// The token has to be passed here too for identification purposes.
    77  	string token = 2;
    78  	// This payment method ID is the one we got back from Stripe on the frontend (ie. 'm3o.com/subscribe.html')
    79  	// deprecated: signup service now knows the payment method due to the
    80  	// SetPaymentMethod call issued by the frontend.
    81  	string paymentMethodID = 3;
    82  	// The secret/password to use for the account
    83  	string secret = 4;
    84  	// Which namespace to sign up to based on previous invite
    85  	string namespace = 5;
    86  }
    87  
    88  message CompleteSignupResponse {
    89  	AuthToken authToken = 1;
    90  	string namespace = 2;
    91  }
    92  
    93  // lifted from https://github.com/micro/go-micro/blob/master/auth/service/proto/auth.proto
    94  message AuthToken {
    95  	string access_token = 1;
    96  	string refresh_token = 2;
    97  	int64 created = 3;
    98  	int64 expiry = 4;
    99  }
   100  
   101  message RecoverRequest {
   102  	string email = 1;
   103  }
   104  
   105  message RecoverResponse {}