generated from y9vad9/kotlin-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
426 additions
and
264 deletions.
There are no files selected for viewing
62 changes: 0 additions & 62 deletions
62
...re/rsocket-api/src/main/proto/org/timemates/api/authorizations/AuthorizationService.proto
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...api/src/main/proto/org/timemates/api/authorizations/options/OmitAuthorizationOption.proto
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...rc/main/proto/org/timemates/api/authorizations/requests/ConfirmAuthorizationRequest.proto
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...i/src/main/proto/org/timemates/api/authorizations/requests/GetAuthorizationsRequest.proto
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
.../src/main/proto/org/timemates/api/authorizations/requests/StartAuthorizationRequest.proto
This file was deleted.
Oops, something went wrong.
74 changes: 0 additions & 74 deletions
74
infrastructure/rsocket-api/src/main/proto/org/timemates/api/timers/TimersService.proto
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
infrastructure/rsocket-api/src/main/proto/org/timemates/api/users/UsersService.proto
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
infrastructure/rsocket-api/src/main/proto/timemates/auth/core/CoreAuthService.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
syntax = "proto3"; | ||
|
||
import "/timemates/auth/core/requests/ObtainAuthRequest.proto"; | ||
import "/timemates/auth/core/requests/GetAuthorizationsRequest.proto"; | ||
import "/timemates/auth/core/requests/RenewAuthorizationRequest.proto"; | ||
import "/timemates/auth/core/requests/LinkAuthMethodRequest.proto"; | ||
import "/timemates/auth/core/types/Authorization.proto"; | ||
import "google/protobuf/empty.proto"; | ||
|
||
option java_package = "org.timemates.api.auth.core"; | ||
|
||
// Core authentication service responsible for managing user authentication and authorizations. | ||
service CoreAuthService { | ||
// Retrieves the authentication status of the user. | ||
// This method returns the authentication status of the user. | ||
rpc ObtainAuth(ObtainAuthRequest) returns (ObtainAuthRequest.Response); | ||
|
||
// Links a new auth method / replaces existing with the given one that was used in the | ||
// auth session. | ||
rpc LinkAuthMethod(LinkAuthMethodRequest) returns (LinkAuthMethodRequest.Response); | ||
|
||
// Creates a new authorization from refresh token of old authorization that is expired | ||
// or is about to be expired. | ||
rpc RenewAuth(RenewAuthorizationRequest) returns (RenewAuthorizationRequest.Response); | ||
|
||
// Gets all active authorizations. | ||
// This method retrieves all active authorizations. | ||
rpc GetAuthList(GetAuthorizationsRequest) returns (GetAuthorizationsRequest.Response); | ||
|
||
// Terminates authorization by given identifier. | ||
// This method terminates authorization by the given identifier. | ||
// It returns an empty response upon successful termination. | ||
rpc TerminateAuth(google.protobuf.Empty) returns (google.protobuf.Empty); | ||
} |
18 changes: 18 additions & 0 deletions
18
...re/rsocket-api/src/main/proto/timemates/auth/core/requests/GetAuthorizationsRequest.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
syntax = "proto3"; | ||
|
||
import "/timemates/auth/core/types/Authorization.proto"; | ||
import "/timemates/auth/core/types/AuthorizationView.proto"; | ||
|
||
|
||
option java_package = "org.timemates.api.auth.core.requests"; | ||
|
||
message GetAuthorizationsRequest { | ||
// null if it's start of pagination | ||
optional string pageToken = 1; | ||
optional int32 pageSize = 2; | ||
|
||
message Response { | ||
repeated AuthorizationView authorizations = 1; | ||
string nextPageToken = 2; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...cture/rsocket-api/src/main/proto/timemates/auth/core/requests/LinkAuthMethodRequest.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
syntax = "proto3"; | ||
|
||
import "/timemates/auth/core/types/Authorization.proto"; | ||
|
||
option java_package = "org.timemates.api.auth.core.requests"; | ||
|
||
message LinkAuthMethodRequest { | ||
// Verification hash obtained in the corresponding service (TelegramAuthService, EmailAuthService) | ||
string verificationHash = 1; | ||
// Access hash of the authorized user that wants to link an auth method | ||
string accessHash = 2; | ||
|
||
message Response { | ||
Status status = 1; | ||
|
||
enum Status { | ||
// Linking is successful, a new auth method is added or is replaced with. | ||
SUCCESSFULLY_LINKED = 0; | ||
// Linking is failed: given auth method is already linked to the another account. | ||
ALREADY_LINKED = 1; | ||
// Linking is failed: given auth method is | ||
AUTH_IS_NOT_FINISHED = 2; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...structure/rsocket-api/src/main/proto/timemates/auth/core/requests/ObtainAuthRequest.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
syntax = "proto3"; | ||
|
||
option java_package = "org.timemates.api.auth.core"; | ||
|
||
import "/timemates/auth/core/types/Authorization.proto"; | ||
|
||
message ObtainAuthRequest { | ||
string verificationHash = 1; | ||
|
||
message Response { | ||
oneof status { | ||
Unfinished unfinished = 1; | ||
Authorized authorized = 2; | ||
Expired expired = 3; | ||
} | ||
|
||
message Unfinished {} | ||
message Authorized { | ||
bool hasAccount = 1; | ||
// Authorization is present if [hasAccount] is true. | ||
// Otherwise, client should proceed to profile configuration to obtain authorization. | ||
Authorization authorization = 2; | ||
} | ||
message Expired {} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
.../requests/RenewAuthorizationRequest.proto → .../requests/RenewAuthorizationRequest.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.