@citec-spbu/contracts 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gen/ts/auth.ts +17 -8
- package/package.json +1 -1
- package/proto/auth.proto +12 -4
package/gen/ts/auth.ts
CHANGED
|
@@ -10,12 +10,21 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
-
export
|
|
14
|
-
|
|
13
|
+
export enum Provider {
|
|
14
|
+
PROVIDER_UNSPECIFIED = 0,
|
|
15
|
+
PROVIDER_GITHUB = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GithubLoginRequest {
|
|
20
|
+
provider: Provider;
|
|
15
21
|
providerId: string;
|
|
22
|
+
username: string;
|
|
23
|
+
profileUrl: string;
|
|
24
|
+
avatarUrl: string;
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
export interface
|
|
27
|
+
export interface GithubLoginResponse {
|
|
19
28
|
tokens: TokenPair | undefined;
|
|
20
29
|
}
|
|
21
30
|
|
|
@@ -44,7 +53,7 @@ export interface TokenPair {
|
|
|
44
53
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
45
54
|
|
|
46
55
|
export interface AuthServiceClient {
|
|
47
|
-
|
|
56
|
+
githubLogin(request: GithubLoginRequest): Observable<GithubLoginResponse>;
|
|
48
57
|
|
|
49
58
|
validateJwt(request: ValidateJwtRequest): Observable<ValidateJwtResponse>;
|
|
50
59
|
|
|
@@ -52,9 +61,9 @@ export interface AuthServiceClient {
|
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
export interface AuthServiceController {
|
|
55
|
-
|
|
56
|
-
request:
|
|
57
|
-
): Promise<
|
|
64
|
+
githubLogin(
|
|
65
|
+
request: GithubLoginRequest,
|
|
66
|
+
): Promise<GithubLoginResponse> | Observable<GithubLoginResponse> | GithubLoginResponse;
|
|
58
67
|
|
|
59
68
|
validateJwt(
|
|
60
69
|
request: ValidateJwtRequest,
|
|
@@ -65,7 +74,7 @@ export interface AuthServiceController {
|
|
|
65
74
|
|
|
66
75
|
export function AuthServiceControllerMethods() {
|
|
67
76
|
return function (constructor: Function) {
|
|
68
|
-
const grpcMethods: string[] = ["
|
|
77
|
+
const grpcMethods: string[] = ["githubLogin", "validateJwt", "refresh"];
|
|
69
78
|
for (const method of grpcMethods) {
|
|
70
79
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
71
80
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -3,19 +3,22 @@ syntax = "proto3";
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
5
|
service AuthService {
|
|
6
|
-
rpc
|
|
6
|
+
rpc GithubLogin(GithubLoginRequest) returns (GithubLoginResponse);
|
|
7
7
|
|
|
8
8
|
rpc ValidateJwt(ValidateJwtRequest) returns (ValidateJwtResponse);
|
|
9
9
|
|
|
10
10
|
rpc Refresh(RefreshRequest) returns (RefreshResponse);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
message
|
|
14
|
-
|
|
13
|
+
message GithubLoginRequest {
|
|
14
|
+
Provider provider = 1;
|
|
15
15
|
string provider_id = 2;
|
|
16
|
+
string username = 3;
|
|
17
|
+
string profile_url = 4;
|
|
18
|
+
string avatar_url = 5;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
message
|
|
21
|
+
message GithubLoginResponse {
|
|
19
22
|
TokenPair tokens = 1;
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -40,3 +43,8 @@ message TokenPair {
|
|
|
40
43
|
string access_token = 1;
|
|
41
44
|
string refresh_token = 2;
|
|
42
45
|
}
|
|
46
|
+
|
|
47
|
+
enum Provider {
|
|
48
|
+
PROVIDER_UNSPECIFIED = 0;
|
|
49
|
+
PROVIDER_GITHUB = 1;
|
|
50
|
+
}
|