|
1 | 1 | syntax = "proto3";
|
2 | 2 | package account;
|
3 |
| -// https://docs.rs/opaque-ke/latest/opaque_ke/ |
4 |
| -// Will use opaque-ke for registration and login. |
5 |
| -// From opaque-ke we will get a session token. This token can later be used to |
6 |
| -// create a JWT token for API usage. |
7 |
| -message CreateAccountStartRequest { |
8 |
| - bytes oprf = 1; // OPAQUE Registration message. |
9 |
| - string email = 2; |
10 |
| - string captcha = 3; |
11 |
| -} |
12 | 3 |
|
13 |
| -message CreateAccountStartResponse { |
14 |
| - bytes oprf = 1; // OPAQUE Registration message. |
15 |
| - string session_id = 2; |
16 |
| -} |
17 | 4 |
|
18 |
| -message CreateAccountFinishRequest { |
19 |
| - string username = 1; |
20 |
| - bytes oprf = 2; // OPAQUE Registration message. |
21 |
| - string session_id = 3; |
22 |
| - bytes public_signing_key = 4; // The signing key that is used by the server to |
23 |
| - // verify user signatures. |
24 |
| -} |
25 |
| - |
26 |
| -message CreateAccountFinishResponse { string jwt_token = 1; } |
27 |
| - |
28 |
| -message AccountLoginStartRequest { |
29 |
| - string email = 1; |
30 |
| - bytes oprf = 2; // OPAQUE login message. |
31 |
| -} |
32 |
| - |
33 |
| -message AccountLoginStartResponse { |
34 |
| - bytes oprf = 1; // OPAQUE login message. |
35 |
| - string session_id = 2; |
36 |
| - bool is_totp_code_required = 3; |
37 |
| -} |
38 |
| - |
39 |
| -message AccountLoginFinishRequest { |
40 |
| - bytes oprf = 1; // OPAQUE login message. |
41 |
| - string session_id = 2; |
42 |
| - optional string totp_code = 3; |
43 |
| -} |
44 |
| - |
45 |
| -message AccountLoginFinishResponse { string jwt_token = 1; } |
46 |
| - |
47 |
| -// 2FA Setup and Verification. Will use TOTP. Will require the user to verify |
48 |
| -// the 2FA code with verifie message. Until then it's just temporary. Client -> |
49 |
| -// SetupTwoFactorAuthenticationRequest -> Server Client <- |
50 |
| -// SetupTwoFactorAuthenticationResponse <- Server Client -> |
51 |
| -// SetupVerifyTwoFactorAuthenticationRequest -> Server Client <- |
52 |
| -// SetupVerifyTwoFactorAuthenticationResponse <- Server |
53 |
| -// First the user gets the secrete, the user stores the secrete, the user uses the secrete to compute the first totp code and send that in for verification. |
54 |
| -message SetupTwoFactorAuthenticationRequest {} |
55 |
| - |
56 |
| -message SetupTwoFactorAuthenticationResponse { string totp_secrete = 1; } |
57 |
| - |
58 |
| -message SetupTwoFactorAuthenticationVerifyRequest { string totp_code = 1; } |
59 |
| -/// Will return a status error message if totp_code is invalid. |
60 |
| -message SetupTwoFactorAuthenticationVerifyResponse {} |
61 |
| -/// Invalidates the users JWT-token. |
62 |
| -message AccountLogoutRequest { string token = 1; } |
63 |
| - |
64 |
| -message AccountLogoutResponse {} |
65 | 5 |
|
66 | 6 | // OPAQUE Registration.
|
67 | 7 | // OPAQUE Login.
|
68 | 8 | // message OpaqueRegistration {
|
69 | 9 | // string username = 1;
|
70 | 10 |
|
71 | 11 | // }
|
| 12 | + |
0 commit comments