-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSecurityEndpoints.proto
163 lines (137 loc) · 5.62 KB
/
SecurityEndpoints.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
option java_package = "com.idamobile.instabank.dto.protobuf";
option java_outer_classname = "SecurityEndpoints";
import "Commons.proto";
import "Entities.proto";
import "Events.proto";
import "Wallets.proto";
import "Social.proto";
import "Locations.proto";
import "Forms.proto";
// should return long-lived token
// endpoint GET URL: "/getFacebookToken"
// returns HTTP 412 FACEBOOK_TOKEN_NOT_FOUND
message GetFacebookTokenResponseProtobufDTO {
required string fbAccessToken = 1;
required int64 expires = 2;
repeated string permissions = 3;
}
//endpoint URL: GET "/getOptionsStatusesResponse"
message GetOptionsStatusesResponseProtobufDTO {
required bool pinEstablished = 1;
required bool socialConfidantEstablished = 2;
optional string socialConfidantFacebookId = 3;
optional bool phoneNumberEstablished = 4;
optional string phoneNumber = 5;
optional int64 debtAmount = 6;
optional bool securityWordEstablished = 7;
optional string email = 8;
}
// endpoint URL: "/getRecoveryOptions"
// returns GetRecoveryOptionsRequestProtobufDTO
message GetRecoveryOptionsRequestProtobufDTO {
required string userToken = 1;
}
message GetRecoveryOptionsResponseProtobufDTO {
/*
* 422 Unprocessable Entity
IS_NOT_REGISTERED if this user is not registered in system
*/
required bool socialConfidentEstablished = 1;
required bool securityWordEstablished = 2;
}
// endpoint URL: "/requestUserToken"
// returns UserTokenResponseProtobufDTO
message UserTokenRequestProtobufDTO {
required string phoneNumber = 1;
required string verificationCode = 2;
}
// endpoint URL: "/requestUserTokenForFacebook"
// returns UserTokenResponseProtobufDTO
message UserTokenForFacebookRequestProtobufDTO {
required string fbAccessToken = 1;
}
message UserTokenResponseProtobufDTO {
/* 401 Unauthorized
IS_NOT_REGISTERED
* 422 Unprocessable Entity
NOT_MATCHED if verification code is not valid
FACEBOOK_INVALID_CREDENTIALS if incorrect facebook token
* 423 Locked
TOO_MANY_VERIFICATION_ATTEMPTS if there were too many attempts
* 424 Failed Dependency
VERIFICATION_CODE_NOT_REQUESTED if the verificationCode was not requested yet
*/
required string userToken = 1;
required InstabankAccountDTO account = 2;
}
//endpoint URL: "/getRemainingPinAttempts"
message GetRemainingPinAttemptsRequestProtobufDTO {
optional string fbAccessToken = 1 [deprecated=true];
optional string userToken = 2;
}
message GetRemainingPinAttemptsResponseProtobufDTO {
/* 412 Precondition Failed if pin not established for user
* 401 Unauthorized with protobuf entity DiagnosticMessageProtobufDTO which contains
IS_NOT_REGISTERED {LoginWithFacebookAndPinRequestProtobufDTO, LoginWithFacebookAndPinRecoveryCodeRequestProtobufDTO} if this facebook user is not registered in system - use /registerWithFacebook
FACEBOOK_INVALID_CREDENTIALS {RegisterWithFacebookRequestProtobufDTO, LoginWithFacebookAndPinRequestProtobufDTO, LoginWithFacebookAndPinRecoveryCodeRequestProtobufDTO} if incorrect facebook credentials
422 Unprocessable entity: all fields are empty
*/
required int32 attemptsCount = 1;
}
//endpoint URL: "/establishPin"
message EstablishPinRequestProtobufDTO {
required int32 pin = 1;
}
message EstablishPinResponseProtobufDTO {
}
//endpoint URL: "/establishSocialConfidant"
message EstablishSocialConfidantRequestProtobufDTO {
required string facebookId = 1;
}
message EstablishSocialConfidantResponseProtobufDTO {
}
// endpoint URL: "/establishSecurityWord"
// returns:
// UnprocessableEntity(422)
// WRONG_WORD_FORMAT if the word contains derecated symbols (' ','\t','\n','\r')
// WORD_IS_TO_SHORT;{minimal word length}
// OK(200)
message EstablishSecurityWordRequestProtobufDTO {
required string securityWord = 1;
}
// endpoint URL: "/sendPinRecoveryCode"
// returns: SendPinRecoveryCodeResponseProtobufDTO
//DEPRECATED use recoverWithSecurityWord
message SendPinRecoveryCodeRequestProtobufDTO {
required string fbAccessToken = 1;
}
message SendPinRecoveryCodeResponseProtobufDTO {
/* 412 Precondition Failed if pin not established for user
PIN_NOT_ESTABLISHED if pin not established for user
SOCIAL_CONFIDANT_NOT_ESTABLISHED if social confidant not established for user
PIN_NOT_BANNED
* 401 Unauthorized with protobuf entity DiagnosticMessageProtobufDTO which contains
IS_NOT_REGISTERED if this facebook user is not registered in system - use /registerWithFacebook
FACEBOOK_INVALID_CREDENTIALS if incorrect facebook credentials
*/
enum Status {
OK = 1;
}
required Status status = 1 [default = OK];
}
// endpoint URL: "/recoverWithSecurityWord"
// returns: HTTP 200 if recovery code sent, or:
/* 412 Precondition Failed
PIN_NOT_BANNED
PIN_NOT_ESTABLISHED if pin not established for user
SECURITY_WORD_NOT_ESTABLISHED if security word is not established for user
SECURITY_WORD_NOT_MATCH;%d if security word not match; %d seconds - if timer started and user should repeat after %d seconds
SECURITY_WORD_BLOCKED if security word blocked and user should call to bank to restore access
SECURITY_WORD_TIMEOUT;%d to prevent frequent calls, user should repeat after %d seconds
* 401 Unauthorized with protobuf entity DiagnosticMessageProtobufDTO which contains
IS_NOT_REGISTERED if this facebook user is not registered in system - use
*/
message RecoverWithSecurityWordRequestProtobufDTO {
required string userToken = 1;
required string securityWord = 2;
}