From 4c4546a4c585de820b7a7b5d7efd4e6b6d88bbdb Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Fri, 7 Sep 2018 16:56:05 +0300 Subject: [PATCH 1/9] NY-3130: Change the access token request --- auth-service/1.0/auth.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index dc1a9e5..99bb470 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -42,8 +42,8 @@ message GenerateAccessTokenRequest { string instanceId = 2; string appClass = 3; string orgId = 4; - string accountId = 5; - string clientCredential = 6; + GenerateTokenResponse verifyToken = 5; + string loginCode = 6; } enum ResponseTokenType { -- GitLab From bc38b25f5e5a32bbb4b9b9d168a96c4ba18cc6c4 Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Mon, 10 Sep 2018 11:55:36 +0300 Subject: [PATCH 2/9] NY-3130: Added clientCredential property required by documentation --- auth-service/1.0/auth.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index 99bb470..e863b5e 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -44,6 +44,7 @@ message GenerateAccessTokenRequest { string orgId = 4; GenerateTokenResponse verifyToken = 5; string loginCode = 6; + string clientCredential = 7; } enum ResponseTokenType { -- GitLab From 247b20e9f87c2b63467bd7efa6b4052eb0ba961b Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Mon, 10 Sep 2018 14:49:09 +0300 Subject: [PATCH 3/9] NY-3130: Added access token account --- auth-service/1.0/auth.proto | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index e863b5e..7eefc3b 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -64,3 +64,91 @@ message GenerateTokenResponse { int64 exp = 3; string refreshToken = 4; } + + +// TODO we should consider importing some of the properties from the other file +message AccessTokenResponse { + GenerateTokenResponse accessToken = 1; + oneof result { + PendingAccountDetails pendingAccount = 2; + AccountResponse account = 3; + } +} + +// NOTE: if any changes are made to account.proto they should be done here as well +// account.proto copy +message PendingAccountDetails { + string accountId = 1; +} + +message CreatePendingAccountResponse { + uint64 requestId = 1; + oneof result { + ErrorResponse error = 2; + PendingAccountDetails pendingAccountDetails = 3; + } +} + +message AccountResponse { + uint64 requestId = 1; + oneof result { + ErrorResponse error = 2; + AccountDetails accountDetails = 3; + } +} + +message AccountDetails { + string accountId = 1; + string profileId = 2; + string authenticationIdentifier = 3; + string authenticationType = 4; + bytes avatar = 5; + string accountMark = 6; + string accountName = 7; + string firstName = 8; + string lastName = 9; + string username = 10; + string accountStatus = 11; + string qrCode = 12; + repeated AuthProviderDetails communicationProviders = 13; +} + +message AuthProviderDetails { + AuthenticationType authenticationType = 1; // Request for creating an account by phone number, email address, etc. + string authenticationProvider = 2; +} + +enum AuthenticationType { + MISSING_TYPE = 0; + PHONE = 1; + EMAIL = 2; + FACEBOOK = 3; + GOOGLEPLUS = 4; +} + +message ErrorResponse { + enum Cause { + INTERNAL_SERVER_ERROR = 0; + MISSING_FIRST_NAME = 1; + EMAIL_ALREADY_USED = 2; + EMAIL_INVALID = 3; + PHONE_NUMBER_ALREADY_USED = 4; + PHONE_NUMBER_INVALID = 5; + USERNAME_ALREADY_USED = 6; + USERNAME_INVALID = 7; + ACCOUNT_NOT_FOUND = 8; + MISSING_AUTH_PROVIDER_TYPE = 9; + MISSING_AUTH_PROVIDER_IDENTIFIER = 10; + MISSING_PROFILE_ID = 11; + MISSING_ACCOUNT_ID = 12; + INVALID_FIRST_NAME = 13; + INVALID_LAST_NAME = 14; + INVALID_AUTH_PROVIDER_TYPE = 15; + ERROR_CREATING_ACCOUNT = 16; + ERROR_UPDATING_ACCOUNT = 17; + ERROR_UPDATING_PROFILE = 18; + } + Cause cause = 1; + string message = 2; +} +// account.proto copy \ No newline at end of file -- GitLab From 5bcc94deb001fbfc9996d290a5143ec26482e424 Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Mon, 10 Sep 2018 15:49:29 +0300 Subject: [PATCH 4/9] NY-3129: Added AccessTokenResponse --- auth-service/1.0/auth.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index 7eefc3b..fbf8a06 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -15,7 +15,7 @@ option java_outer_classname = "Authentication"; service AuthenticationService { rpc generateAuthToken(GenerateAuthTokenRequest) returns (GenerateTokenResponse); rpc generateVerifyToken(GenerateVerifyTokenRequest) returns (GenerateTokenResponse); - rpc generateAccessToken(GenerateAccessTokenRequest) returns (GenerateTokenResponse); + rpc generateAccessToken(GenerateAccessTokenRequest) returns (AccessTokenResponse); } message GenerateAuthTokenRequest { -- GitLab From dfbb830b72a1541a03939dc6c57602e51578a84f Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Mon, 10 Sep 2018 16:36:16 +0300 Subject: [PATCH 5/9] NY-3129: Test importing account.proto --- auth-service/1.0/auth.proto | 84 ++----------------------------------- 1 file changed, 3 insertions(+), 81 deletions(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index fbf8a06..5076b62 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -4,6 +4,8 @@ // syntax = "proto3"; +import "../../account-service/1.0/account.proto"; + // GRPC package, also used by the Go code generator package authentication; @@ -65,90 +67,10 @@ message GenerateTokenResponse { string refreshToken = 4; } - -// TODO we should consider importing some of the properties from the other file message AccessTokenResponse { GenerateTokenResponse accessToken = 1; oneof result { PendingAccountDetails pendingAccount = 2; AccountResponse account = 3; } -} - -// NOTE: if any changes are made to account.proto they should be done here as well -// account.proto copy -message PendingAccountDetails { - string accountId = 1; -} - -message CreatePendingAccountResponse { - uint64 requestId = 1; - oneof result { - ErrorResponse error = 2; - PendingAccountDetails pendingAccountDetails = 3; - } -} - -message AccountResponse { - uint64 requestId = 1; - oneof result { - ErrorResponse error = 2; - AccountDetails accountDetails = 3; - } -} - -message AccountDetails { - string accountId = 1; - string profileId = 2; - string authenticationIdentifier = 3; - string authenticationType = 4; - bytes avatar = 5; - string accountMark = 6; - string accountName = 7; - string firstName = 8; - string lastName = 9; - string username = 10; - string accountStatus = 11; - string qrCode = 12; - repeated AuthProviderDetails communicationProviders = 13; -} - -message AuthProviderDetails { - AuthenticationType authenticationType = 1; // Request for creating an account by phone number, email address, etc. - string authenticationProvider = 2; -} - -enum AuthenticationType { - MISSING_TYPE = 0; - PHONE = 1; - EMAIL = 2; - FACEBOOK = 3; - GOOGLEPLUS = 4; -} - -message ErrorResponse { - enum Cause { - INTERNAL_SERVER_ERROR = 0; - MISSING_FIRST_NAME = 1; - EMAIL_ALREADY_USED = 2; - EMAIL_INVALID = 3; - PHONE_NUMBER_ALREADY_USED = 4; - PHONE_NUMBER_INVALID = 5; - USERNAME_ALREADY_USED = 6; - USERNAME_INVALID = 7; - ACCOUNT_NOT_FOUND = 8; - MISSING_AUTH_PROVIDER_TYPE = 9; - MISSING_AUTH_PROVIDER_IDENTIFIER = 10; - MISSING_PROFILE_ID = 11; - MISSING_ACCOUNT_ID = 12; - INVALID_FIRST_NAME = 13; - INVALID_LAST_NAME = 14; - INVALID_AUTH_PROVIDER_TYPE = 15; - ERROR_CREATING_ACCOUNT = 16; - ERROR_UPDATING_ACCOUNT = 17; - ERROR_UPDATING_PROFILE = 18; - } - Cause cause = 1; - string message = 2; -} -// account.proto copy \ No newline at end of file +} \ No newline at end of file -- GitLab From bb68a11bbd506f6ebd638de3d830cc4dfb2a5eeb Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Mon, 10 Sep 2018 18:45:46 +0300 Subject: [PATCH 6/9] NY-3129: Another test import --- auth-service/1.0/auth.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index 5076b62..201b79d 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -4,7 +4,7 @@ // syntax = "proto3"; -import "../../account-service/1.0/account.proto"; +import "account.proto"; // GRPC package, also used by the Go code generator package authentication; @@ -70,7 +70,7 @@ message GenerateTokenResponse { message AccessTokenResponse { GenerateTokenResponse accessToken = 1; oneof result { - PendingAccountDetails pendingAccount = 2; - AccountResponse account = 3; + account.PendingAccountDetails pendingAccount = 2; + account.AccountResponse account = 3; } } \ No newline at end of file -- GitLab From ff57f72de9fe53266ada96290b2ffedf77d78af1 Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Tue, 11 Sep 2018 10:28:09 +0300 Subject: [PATCH 7/9] NY-3129: Another import test --- auth-service/1.0/auth.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index 201b79d..c13cf12 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -4,7 +4,7 @@ // syntax = "proto3"; -import "account.proto"; +import "..//..//account-service//account.proto"; // GRPC package, also used by the Go code generator package authentication; -- GitLab From aeae092ac6b944458f1ace09c126f1f8634bb8f0 Mon Sep 17 00:00:00 2001 From: Dragomir Todorov Date: Tue, 11 Sep 2018 11:24:02 +0300 Subject: [PATCH 8/9] NY-3129: Removed the account details from the access token response --- auth-service/1.0/auth.proto | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index c13cf12..e863b5e 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -4,8 +4,6 @@ // syntax = "proto3"; -import "..//..//account-service//account.proto"; - // GRPC package, also used by the Go code generator package authentication; @@ -17,7 +15,7 @@ option java_outer_classname = "Authentication"; service AuthenticationService { rpc generateAuthToken(GenerateAuthTokenRequest) returns (GenerateTokenResponse); rpc generateVerifyToken(GenerateVerifyTokenRequest) returns (GenerateTokenResponse); - rpc generateAccessToken(GenerateAccessTokenRequest) returns (AccessTokenResponse); + rpc generateAccessToken(GenerateAccessTokenRequest) returns (GenerateTokenResponse); } message GenerateAuthTokenRequest { @@ -66,11 +64,3 @@ message GenerateTokenResponse { int64 exp = 3; string refreshToken = 4; } - -message AccessTokenResponse { - GenerateTokenResponse accessToken = 1; - oneof result { - account.PendingAccountDetails pendingAccount = 2; - account.AccountResponse account = 3; - } -} \ No newline at end of file -- GitLab From f661ad64dcf9d5020c56ac2303a8ad8b3c8bb980 Mon Sep 17 00:00:00 2001 From: abotev-intracol Date: Mon, 10 Sep 2018 18:39:39 +0300 Subject: [PATCH 9/9] NY-2647 Generate verify token - add error response; Signed-off-by: abotev-intracol --- auth-service/1.0/auth.proto | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/auth-service/1.0/auth.proto b/auth-service/1.0/auth.proto index e863b5e..bf37b8d 100644 --- a/auth-service/1.0/auth.proto +++ b/auth-service/1.0/auth.proto @@ -58,9 +58,27 @@ enum RequestTokenType { ACCESS = 2; } -message GenerateTokenResponse { +message TokenResponseDetails { string token = 1; ResponseTokenType responseTokenType = 2; int64 exp = 3; string refreshToken = 4; } + +message GenerateTokenResponse { + oneof result { + ErrorResponse error = 1; + TokenResponseDetails tokenResponseDetails = 2; + } +} + +message ErrorResponse { + enum Cause { + INTERNAL_SERVER_ERROR = 0; + PHONE_NUMBER_INVALID = 1; + SID_INVALID = 2; + SID_TYPE_INVALID = 3; + } + Cause cause = 1; + string message = 2; +} \ No newline at end of file -- GitLab