@acequants/aegis-contracts 0.1.8 → 0.1.10
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/dist/src/gen/auth/v1/auth.d.ts +128 -55
- package/dist/src/gen/auth/v1/auth.d.ts.map +1 -1
- package/dist/src/gen/auth/v1/auth.js +281 -81
- package/dist/src/gen/google/protobuf/empty.d.ts +19 -0
- package/dist/src/gen/google/protobuf/empty.d.ts.map +1 -0
- package/dist/src/gen/google/protobuf/empty.js +32 -0
- package/package.json +1 -1
- package/proto/auth/v1/auth.proto +58 -64
|
@@ -1,42 +1,86 @@
|
|
|
1
1
|
import type { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Empty } from "../../google/protobuf/empty";
|
|
5
5
|
export declare const protobufPackage = "aegis.auth.v1";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/** ---- AUTH ---- */
|
|
7
|
+
export interface AuthContext {
|
|
8
|
+
sessionPublicId: string;
|
|
9
|
+
userPublicId: string;
|
|
10
|
+
email: string;
|
|
11
|
+
displayName?: string | undefined;
|
|
10
12
|
}
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
pageSize: number;
|
|
13
|
+
export interface ValidateAccessRequest {
|
|
14
|
+
accessToken: string;
|
|
15
|
+
userAgent: string;
|
|
16
|
+
ip: string;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
export interface ValidateAccessResponse {
|
|
19
|
+
valid?: boolean | undefined;
|
|
20
|
+
reason?: string | undefined;
|
|
21
|
+
context?: AuthContext | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface AuthorizeRequest {
|
|
24
|
+
context?: AuthContext | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface AuthorizeResponse {
|
|
27
|
+
allowed: boolean;
|
|
28
|
+
reason: string;
|
|
29
|
+
}
|
|
30
|
+
export interface InputPermission {
|
|
19
31
|
publicId: string;
|
|
32
|
+
}
|
|
33
|
+
export interface InputSeedPermission {
|
|
20
34
|
name: string;
|
|
21
|
-
description: string;
|
|
22
|
-
createdAt?: Timestamp | undefined;
|
|
23
|
-
updatedAt?: Timestamp | undefined;
|
|
24
|
-
deletedAt?: Timestamp | undefined;
|
|
25
35
|
}
|
|
26
|
-
export interface
|
|
27
|
-
|
|
28
|
-
items: DtoPermission[];
|
|
36
|
+
export interface InputSeedPermissions {
|
|
37
|
+
permissions: InputSeedPermission[];
|
|
29
38
|
}
|
|
30
|
-
export interface
|
|
39
|
+
export interface DtoPermission {
|
|
40
|
+
publicId: string;
|
|
31
41
|
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* google.protobuf.Timestamp created_at = 6;
|
|
44
|
+
* google.protobuf.Timestamp updated_at = 7;
|
|
45
|
+
* google.protobuf.Timestamp deleted_at = 8;
|
|
46
|
+
*/
|
|
47
|
+
description: string;
|
|
32
48
|
}
|
|
33
|
-
export interface
|
|
34
|
-
permissions:
|
|
49
|
+
export interface DtoPermissions {
|
|
50
|
+
permissions: DtoPermission[];
|
|
35
51
|
}
|
|
36
52
|
export declare const AEGIS_AUTH_V1_PACKAGE_NAME = "aegis.auth.v1";
|
|
37
|
-
export declare const
|
|
38
|
-
encode(message:
|
|
39
|
-
decode(input: _m0.Reader | Uint8Array, length?: number):
|
|
53
|
+
export declare const AuthContext: {
|
|
54
|
+
encode(message: AuthContext, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AuthContext;
|
|
56
|
+
};
|
|
57
|
+
export declare const ValidateAccessRequest: {
|
|
58
|
+
encode(message: ValidateAccessRequest, writer?: _m0.Writer): _m0.Writer;
|
|
59
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ValidateAccessRequest;
|
|
60
|
+
};
|
|
61
|
+
export declare const ValidateAccessResponse: {
|
|
62
|
+
encode(message: ValidateAccessResponse, writer?: _m0.Writer): _m0.Writer;
|
|
63
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ValidateAccessResponse;
|
|
64
|
+
};
|
|
65
|
+
export declare const AuthorizeRequest: {
|
|
66
|
+
encode(message: AuthorizeRequest, writer?: _m0.Writer): _m0.Writer;
|
|
67
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest;
|
|
68
|
+
};
|
|
69
|
+
export declare const AuthorizeResponse: {
|
|
70
|
+
encode(message: AuthorizeResponse, writer?: _m0.Writer): _m0.Writer;
|
|
71
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeResponse;
|
|
72
|
+
};
|
|
73
|
+
export declare const InputPermission: {
|
|
74
|
+
encode(message: InputPermission, writer?: _m0.Writer): _m0.Writer;
|
|
75
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InputPermission;
|
|
76
|
+
};
|
|
77
|
+
export declare const InputSeedPermission: {
|
|
78
|
+
encode(message: InputSeedPermission, writer?: _m0.Writer): _m0.Writer;
|
|
79
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InputSeedPermission;
|
|
80
|
+
};
|
|
81
|
+
export declare const InputSeedPermissions: {
|
|
82
|
+
encode(message: InputSeedPermissions, writer?: _m0.Writer): _m0.Writer;
|
|
83
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InputSeedPermissions;
|
|
40
84
|
};
|
|
41
85
|
export declare const DtoPermission: {
|
|
42
86
|
encode(message: DtoPermission, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -46,54 +90,83 @@ export declare const DtoPermissions: {
|
|
|
46
90
|
encode(message: DtoPermissions, writer?: _m0.Writer): _m0.Writer;
|
|
47
91
|
decode(input: _m0.Reader | Uint8Array, length?: number): DtoPermissions;
|
|
48
92
|
};
|
|
49
|
-
export declare const InputPermission: {
|
|
50
|
-
encode(message: InputPermission, writer?: _m0.Writer): _m0.Writer;
|
|
51
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): InputPermission;
|
|
52
|
-
};
|
|
53
|
-
export declare const PermissionSeedRequest: {
|
|
54
|
-
encode(message: PermissionSeedRequest, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): PermissionSeedRequest;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* --- Auth ---
|
|
59
|
-
* rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
60
|
-
* rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
61
|
-
*/
|
|
62
93
|
export interface AuthServiceClient {
|
|
94
|
+
/** --- Authentication --- */
|
|
95
|
+
validateAccess(request: ValidateAccessRequest): Observable<ValidateAccessResponse>;
|
|
96
|
+
authorize(request: AuthorizeRequest): Observable<AuthorizeResponse>;
|
|
63
97
|
/** --- Permission --- */
|
|
64
|
-
|
|
98
|
+
permissionsSeed(request: InputSeedPermissions): Observable<DtoPermissions>;
|
|
99
|
+
permissions(request: Empty): Observable<DtoPermissions>;
|
|
100
|
+
permission(request: InputPermission): Observable<DtoPermission>;
|
|
65
101
|
}
|
|
66
|
-
/**
|
|
67
|
-
* --- Auth ---
|
|
68
|
-
* rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
69
|
-
* rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
70
|
-
*/
|
|
71
102
|
export interface AuthServiceController {
|
|
103
|
+
/** --- Authentication --- */
|
|
104
|
+
validateAccess(request: ValidateAccessRequest): Promise<ValidateAccessResponse> | Observable<ValidateAccessResponse> | ValidateAccessResponse;
|
|
105
|
+
authorize(request: AuthorizeRequest): Promise<AuthorizeResponse> | Observable<AuthorizeResponse> | AuthorizeResponse;
|
|
72
106
|
/** --- Permission --- */
|
|
73
|
-
|
|
107
|
+
permissionsSeed(request: InputSeedPermissions): Promise<DtoPermissions> | Observable<DtoPermissions> | DtoPermissions;
|
|
108
|
+
permissions(request: Empty): Promise<DtoPermissions> | Observable<DtoPermissions> | DtoPermissions;
|
|
109
|
+
permission(request: InputPermission): Promise<DtoPermission> | Observable<DtoPermission> | DtoPermission;
|
|
74
110
|
}
|
|
75
111
|
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
76
112
|
export declare const AUTH_SERVICE_NAME = "AuthService";
|
|
77
|
-
/**
|
|
78
|
-
* --- Auth ---
|
|
79
|
-
* rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
80
|
-
* rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
81
|
-
*/
|
|
82
113
|
export type AuthServiceService = typeof AuthServiceService;
|
|
83
114
|
export declare const AuthServiceService: {
|
|
115
|
+
/** --- Authentication --- */
|
|
116
|
+
readonly validateAccess: {
|
|
117
|
+
readonly path: "/aegis.auth.v1.AuthService/ValidateAccess";
|
|
118
|
+
readonly requestStream: false;
|
|
119
|
+
readonly responseStream: false;
|
|
120
|
+
readonly requestSerialize: (value: ValidateAccessRequest) => Buffer<ArrayBuffer>;
|
|
121
|
+
readonly requestDeserialize: (value: Buffer) => ValidateAccessRequest;
|
|
122
|
+
readonly responseSerialize: (value: ValidateAccessResponse) => Buffer<ArrayBuffer>;
|
|
123
|
+
readonly responseDeserialize: (value: Buffer) => ValidateAccessResponse;
|
|
124
|
+
};
|
|
125
|
+
readonly authorize: {
|
|
126
|
+
readonly path: "/aegis.auth.v1.AuthService/Authorize";
|
|
127
|
+
readonly requestStream: false;
|
|
128
|
+
readonly responseStream: false;
|
|
129
|
+
readonly requestSerialize: (value: AuthorizeRequest) => Buffer<ArrayBuffer>;
|
|
130
|
+
readonly requestDeserialize: (value: Buffer) => AuthorizeRequest;
|
|
131
|
+
readonly responseSerialize: (value: AuthorizeResponse) => Buffer<ArrayBuffer>;
|
|
132
|
+
readonly responseDeserialize: (value: Buffer) => AuthorizeResponse;
|
|
133
|
+
};
|
|
84
134
|
/** --- Permission --- */
|
|
85
|
-
readonly
|
|
86
|
-
readonly path: "/aegis.auth.v1.AuthService/
|
|
135
|
+
readonly permissionsSeed: {
|
|
136
|
+
readonly path: "/aegis.auth.v1.AuthService/PermissionsSeed";
|
|
137
|
+
readonly requestStream: false;
|
|
138
|
+
readonly responseStream: false;
|
|
139
|
+
readonly requestSerialize: (value: InputSeedPermissions) => Buffer<ArrayBuffer>;
|
|
140
|
+
readonly requestDeserialize: (value: Buffer) => InputSeedPermissions;
|
|
141
|
+
readonly responseSerialize: (value: DtoPermissions) => Buffer<ArrayBuffer>;
|
|
142
|
+
readonly responseDeserialize: (value: Buffer) => DtoPermissions;
|
|
143
|
+
};
|
|
144
|
+
readonly permissions: {
|
|
145
|
+
readonly path: "/aegis.auth.v1.AuthService/Permissions";
|
|
87
146
|
readonly requestStream: false;
|
|
88
147
|
readonly responseStream: false;
|
|
89
|
-
readonly requestSerialize: (value:
|
|
90
|
-
readonly requestDeserialize: (value: Buffer) =>
|
|
148
|
+
readonly requestSerialize: (value: Empty) => Buffer<ArrayBuffer>;
|
|
149
|
+
readonly requestDeserialize: (value: Buffer) => Empty;
|
|
91
150
|
readonly responseSerialize: (value: DtoPermissions) => Buffer<ArrayBuffer>;
|
|
92
151
|
readonly responseDeserialize: (value: Buffer) => DtoPermissions;
|
|
93
152
|
};
|
|
153
|
+
readonly permission: {
|
|
154
|
+
readonly path: "/aegis.auth.v1.AuthService/Permission";
|
|
155
|
+
readonly requestStream: false;
|
|
156
|
+
readonly responseStream: false;
|
|
157
|
+
readonly requestSerialize: (value: InputPermission) => Buffer<ArrayBuffer>;
|
|
158
|
+
readonly requestDeserialize: (value: Buffer) => InputPermission;
|
|
159
|
+
readonly responseSerialize: (value: DtoPermission) => Buffer<ArrayBuffer>;
|
|
160
|
+
readonly responseDeserialize: (value: Buffer) => DtoPermission;
|
|
161
|
+
};
|
|
94
162
|
};
|
|
95
163
|
export interface AuthServiceServer extends UntypedServiceImplementation {
|
|
164
|
+
/** --- Authentication --- */
|
|
165
|
+
validateAccess: handleUnaryCall<ValidateAccessRequest, ValidateAccessResponse>;
|
|
166
|
+
authorize: handleUnaryCall<AuthorizeRequest, AuthorizeResponse>;
|
|
96
167
|
/** --- Permission --- */
|
|
97
|
-
|
|
168
|
+
permissionsSeed: handleUnaryCall<InputSeedPermissions, DtoPermissions>;
|
|
169
|
+
permissions: handleUnaryCall<Empty, DtoPermissions>;
|
|
170
|
+
permission: handleUnaryCall<InputPermission, DtoPermission>;
|
|
98
171
|
}
|
|
99
172
|
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../../src/gen/auth/v1/auth.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../../src/gen/auth/v1/auth.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEpD,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,qBAAqB;AACrB,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EA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,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAC3D,eAAO,MAAM,kBAAkB;IAC7B,6BAA6B;;;;;2CAKD,qBAAqB;6CACnB,MAAM;4CACP,sBAAsB;8CACpB,MAAM;;;;;;2CAMT,gBAAgB;6CACd,MAAM;4CACP,iBAAiB;8CACf,MAAM;;IAErC,yBAAyB;;;;;2CAKG,oBAAoB;6CAClB,MAAM;4CACP,cAAc;8CACZ,MAAM;;;;;;2CAMT,KAAK;6CACH,MAAM;4CACP,cAAc;8CACZ,MAAM;;;;;;2CAMT,eAAe;6CACb,MAAM;4CACP,aAAa;8CACX,MAAM;;CAE7B,CAAC;AAEX,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;IACrE,6BAA6B;IAC7B,cAAc,EAAE,eAAe,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;IAC/E,SAAS,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAChE,yBAAyB;IACzB,eAAe,EAAE,eAAe,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;IACvE,WAAW,EAAE,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IACpD,UAAU,EAAE,eAAe,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;CAC7D"}
|
|
@@ -5,64 +5,58 @@
|
|
|
5
5
|
// source: auth/v1/auth.proto
|
|
6
6
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
7
7
|
import _m0 from "protobufjs/minimal";
|
|
8
|
-
import {
|
|
8
|
+
import { Empty } from "../../google/protobuf/empty";
|
|
9
9
|
export const protobufPackage = "aegis.auth.v1";
|
|
10
|
-
export var SortOrder;
|
|
11
|
-
(function (SortOrder) {
|
|
12
|
-
SortOrder[SortOrder["ASC"] = 0] = "ASC";
|
|
13
|
-
SortOrder[SortOrder["DESC"] = 1] = "DESC";
|
|
14
|
-
SortOrder[SortOrder["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
15
|
-
})(SortOrder || (SortOrder = {}));
|
|
16
10
|
export const AEGIS_AUTH_V1_PACKAGE_NAME = "aegis.auth.v1";
|
|
17
|
-
function
|
|
18
|
-
return {
|
|
11
|
+
function createBaseAuthContext() {
|
|
12
|
+
return { sessionPublicId: "", userPublicId: "", email: "" };
|
|
19
13
|
}
|
|
20
|
-
export const
|
|
14
|
+
export const AuthContext = {
|
|
21
15
|
encode(message, writer = _m0.Writer.create()) {
|
|
22
|
-
if (message.
|
|
23
|
-
writer.uint32(
|
|
16
|
+
if (message.sessionPublicId !== "") {
|
|
17
|
+
writer.uint32(10).string(message.sessionPublicId);
|
|
24
18
|
}
|
|
25
|
-
if (message.
|
|
26
|
-
writer.uint32(
|
|
19
|
+
if (message.userPublicId !== "") {
|
|
20
|
+
writer.uint32(18).string(message.userPublicId);
|
|
27
21
|
}
|
|
28
|
-
if (message.
|
|
29
|
-
writer.uint32(
|
|
22
|
+
if (message.email !== "") {
|
|
23
|
+
writer.uint32(26).string(message.email);
|
|
30
24
|
}
|
|
31
|
-
if (message.
|
|
32
|
-
writer.uint32(
|
|
25
|
+
if (message.displayName !== undefined) {
|
|
26
|
+
writer.uint32(34).string(message.displayName);
|
|
33
27
|
}
|
|
34
28
|
return writer;
|
|
35
29
|
},
|
|
36
30
|
decode(input, length) {
|
|
37
31
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
38
32
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
39
|
-
const message =
|
|
33
|
+
const message = createBaseAuthContext();
|
|
40
34
|
while (reader.pos < end) {
|
|
41
35
|
const tag = reader.uint32();
|
|
42
36
|
switch (tag >>> 3) {
|
|
43
37
|
case 1:
|
|
44
|
-
if (tag !==
|
|
38
|
+
if (tag !== 10) {
|
|
45
39
|
break;
|
|
46
40
|
}
|
|
47
|
-
message.
|
|
41
|
+
message.sessionPublicId = reader.string();
|
|
48
42
|
continue;
|
|
49
43
|
case 2:
|
|
50
|
-
if (tag !==
|
|
44
|
+
if (tag !== 18) {
|
|
51
45
|
break;
|
|
52
46
|
}
|
|
53
|
-
message.
|
|
47
|
+
message.userPublicId = reader.string();
|
|
54
48
|
continue;
|
|
55
49
|
case 3:
|
|
56
|
-
if (tag !==
|
|
50
|
+
if (tag !== 26) {
|
|
57
51
|
break;
|
|
58
52
|
}
|
|
59
|
-
message.
|
|
53
|
+
message.email = reader.string();
|
|
60
54
|
continue;
|
|
61
55
|
case 4:
|
|
62
|
-
if (tag !==
|
|
56
|
+
if (tag !== 34) {
|
|
63
57
|
break;
|
|
64
58
|
}
|
|
65
|
-
message.
|
|
59
|
+
message.displayName = reader.string();
|
|
66
60
|
continue;
|
|
67
61
|
}
|
|
68
62
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -73,35 +67,26 @@ export const DtoPaginationMeta = {
|
|
|
73
67
|
return message;
|
|
74
68
|
},
|
|
75
69
|
};
|
|
76
|
-
function
|
|
77
|
-
return {
|
|
70
|
+
function createBaseValidateAccessRequest() {
|
|
71
|
+
return { accessToken: "", userAgent: "", ip: "" };
|
|
78
72
|
}
|
|
79
|
-
export const
|
|
73
|
+
export const ValidateAccessRequest = {
|
|
80
74
|
encode(message, writer = _m0.Writer.create()) {
|
|
81
|
-
if (message.
|
|
82
|
-
writer.uint32(10).string(message.
|
|
83
|
-
}
|
|
84
|
-
if (message.name !== "") {
|
|
85
|
-
writer.uint32(18).string(message.name);
|
|
86
|
-
}
|
|
87
|
-
if (message.description !== "") {
|
|
88
|
-
writer.uint32(26).string(message.description);
|
|
75
|
+
if (message.accessToken !== "") {
|
|
76
|
+
writer.uint32(10).string(message.accessToken);
|
|
89
77
|
}
|
|
90
|
-
if (message.
|
|
91
|
-
|
|
78
|
+
if (message.userAgent !== "") {
|
|
79
|
+
writer.uint32(18).string(message.userAgent);
|
|
92
80
|
}
|
|
93
|
-
if (message.
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
if (message.deletedAt !== undefined) {
|
|
97
|
-
Timestamp.encode(message.deletedAt, writer.uint32(66).fork()).ldelim();
|
|
81
|
+
if (message.ip !== "") {
|
|
82
|
+
writer.uint32(26).string(message.ip);
|
|
98
83
|
}
|
|
99
84
|
return writer;
|
|
100
85
|
},
|
|
101
86
|
decode(input, length) {
|
|
102
87
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
103
88
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
104
|
-
const message =
|
|
89
|
+
const message = createBaseValidateAccessRequest();
|
|
105
90
|
while (reader.pos < end) {
|
|
106
91
|
const tag = reader.uint32();
|
|
107
92
|
switch (tag >>> 3) {
|
|
@@ -109,37 +94,69 @@ export const DtoPermission = {
|
|
|
109
94
|
if (tag !== 10) {
|
|
110
95
|
break;
|
|
111
96
|
}
|
|
112
|
-
message.
|
|
97
|
+
message.accessToken = reader.string();
|
|
113
98
|
continue;
|
|
114
99
|
case 2:
|
|
115
100
|
if (tag !== 18) {
|
|
116
101
|
break;
|
|
117
102
|
}
|
|
118
|
-
message.
|
|
103
|
+
message.userAgent = reader.string();
|
|
119
104
|
continue;
|
|
120
105
|
case 3:
|
|
121
106
|
if (tag !== 26) {
|
|
122
107
|
break;
|
|
123
108
|
}
|
|
124
|
-
message.
|
|
109
|
+
message.ip = reader.string();
|
|
125
110
|
continue;
|
|
126
|
-
|
|
127
|
-
|
|
111
|
+
}
|
|
112
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
reader.skipType(tag & 7);
|
|
116
|
+
}
|
|
117
|
+
return message;
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
function createBaseValidateAccessResponse() {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
export const ValidateAccessResponse = {
|
|
124
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
125
|
+
if (message.valid !== undefined) {
|
|
126
|
+
writer.uint32(8).bool(message.valid);
|
|
127
|
+
}
|
|
128
|
+
if (message.reason !== undefined) {
|
|
129
|
+
writer.uint32(18).string(message.reason);
|
|
130
|
+
}
|
|
131
|
+
if (message.context !== undefined) {
|
|
132
|
+
AuthContext.encode(message.context, writer.uint32(26).fork()).ldelim();
|
|
133
|
+
}
|
|
134
|
+
return writer;
|
|
135
|
+
},
|
|
136
|
+
decode(input, length) {
|
|
137
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
138
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
139
|
+
const message = createBaseValidateAccessResponse();
|
|
140
|
+
while (reader.pos < end) {
|
|
141
|
+
const tag = reader.uint32();
|
|
142
|
+
switch (tag >>> 3) {
|
|
143
|
+
case 1:
|
|
144
|
+
if (tag !== 8) {
|
|
128
145
|
break;
|
|
129
146
|
}
|
|
130
|
-
message.
|
|
147
|
+
message.valid = reader.bool();
|
|
131
148
|
continue;
|
|
132
|
-
case
|
|
133
|
-
if (tag !==
|
|
149
|
+
case 2:
|
|
150
|
+
if (tag !== 18) {
|
|
134
151
|
break;
|
|
135
152
|
}
|
|
136
|
-
message.
|
|
153
|
+
message.reason = reader.string();
|
|
137
154
|
continue;
|
|
138
|
-
case
|
|
139
|
-
if (tag !==
|
|
155
|
+
case 3:
|
|
156
|
+
if (tag !== 26) {
|
|
140
157
|
break;
|
|
141
158
|
}
|
|
142
|
-
message.
|
|
159
|
+
message.context = AuthContext.decode(reader, reader.uint32());
|
|
143
160
|
continue;
|
|
144
161
|
}
|
|
145
162
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -150,23 +167,20 @@ export const DtoPermission = {
|
|
|
150
167
|
return message;
|
|
151
168
|
},
|
|
152
169
|
};
|
|
153
|
-
function
|
|
154
|
-
return {
|
|
170
|
+
function createBaseAuthorizeRequest() {
|
|
171
|
+
return {};
|
|
155
172
|
}
|
|
156
|
-
export const
|
|
173
|
+
export const AuthorizeRequest = {
|
|
157
174
|
encode(message, writer = _m0.Writer.create()) {
|
|
158
|
-
if (message.
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
for (const v of message.items) {
|
|
162
|
-
DtoPermission.encode(v, writer.uint32(18).fork()).ldelim();
|
|
175
|
+
if (message.context !== undefined) {
|
|
176
|
+
AuthContext.encode(message.context, writer.uint32(10).fork()).ldelim();
|
|
163
177
|
}
|
|
164
178
|
return writer;
|
|
165
179
|
},
|
|
166
180
|
decode(input, length) {
|
|
167
181
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
168
182
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
169
|
-
const message =
|
|
183
|
+
const message = createBaseAuthorizeRequest();
|
|
170
184
|
while (reader.pos < end) {
|
|
171
185
|
const tag = reader.uint32();
|
|
172
186
|
switch (tag >>> 3) {
|
|
@@ -174,13 +188,48 @@ export const DtoPermissions = {
|
|
|
174
188
|
if (tag !== 10) {
|
|
175
189
|
break;
|
|
176
190
|
}
|
|
177
|
-
message.
|
|
191
|
+
message.context = AuthContext.decode(reader, reader.uint32());
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
reader.skipType(tag & 7);
|
|
198
|
+
}
|
|
199
|
+
return message;
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
function createBaseAuthorizeResponse() {
|
|
203
|
+
return { allowed: false, reason: "" };
|
|
204
|
+
}
|
|
205
|
+
export const AuthorizeResponse = {
|
|
206
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
207
|
+
if (message.allowed !== false) {
|
|
208
|
+
writer.uint32(8).bool(message.allowed);
|
|
209
|
+
}
|
|
210
|
+
if (message.reason !== "") {
|
|
211
|
+
writer.uint32(18).string(message.reason);
|
|
212
|
+
}
|
|
213
|
+
return writer;
|
|
214
|
+
},
|
|
215
|
+
decode(input, length) {
|
|
216
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
217
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
218
|
+
const message = createBaseAuthorizeResponse();
|
|
219
|
+
while (reader.pos < end) {
|
|
220
|
+
const tag = reader.uint32();
|
|
221
|
+
switch (tag >>> 3) {
|
|
222
|
+
case 1:
|
|
223
|
+
if (tag !== 8) {
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
message.allowed = reader.bool();
|
|
178
227
|
continue;
|
|
179
228
|
case 2:
|
|
180
229
|
if (tag !== 18) {
|
|
181
230
|
break;
|
|
182
231
|
}
|
|
183
|
-
message.
|
|
232
|
+
message.reason = reader.string();
|
|
184
233
|
continue;
|
|
185
234
|
}
|
|
186
235
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -192,9 +241,41 @@ export const DtoPermissions = {
|
|
|
192
241
|
},
|
|
193
242
|
};
|
|
194
243
|
function createBaseInputPermission() {
|
|
195
|
-
return {
|
|
244
|
+
return { publicId: "" };
|
|
196
245
|
}
|
|
197
246
|
export const InputPermission = {
|
|
247
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
248
|
+
if (message.publicId !== "") {
|
|
249
|
+
writer.uint32(10).string(message.publicId);
|
|
250
|
+
}
|
|
251
|
+
return writer;
|
|
252
|
+
},
|
|
253
|
+
decode(input, length) {
|
|
254
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
255
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
256
|
+
const message = createBaseInputPermission();
|
|
257
|
+
while (reader.pos < end) {
|
|
258
|
+
const tag = reader.uint32();
|
|
259
|
+
switch (tag >>> 3) {
|
|
260
|
+
case 1:
|
|
261
|
+
if (tag !== 10) {
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
message.publicId = reader.string();
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
reader.skipType(tag & 7);
|
|
271
|
+
}
|
|
272
|
+
return message;
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
function createBaseInputSeedPermission() {
|
|
276
|
+
return { name: "" };
|
|
277
|
+
}
|
|
278
|
+
export const InputSeedPermission = {
|
|
198
279
|
encode(message, writer = _m0.Writer.create()) {
|
|
199
280
|
if (message.name !== "") {
|
|
200
281
|
writer.uint32(10).string(message.name);
|
|
@@ -204,7 +285,77 @@ export const InputPermission = {
|
|
|
204
285
|
decode(input, length) {
|
|
205
286
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
206
287
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
207
|
-
const message =
|
|
288
|
+
const message = createBaseInputSeedPermission();
|
|
289
|
+
while (reader.pos < end) {
|
|
290
|
+
const tag = reader.uint32();
|
|
291
|
+
switch (tag >>> 3) {
|
|
292
|
+
case 1:
|
|
293
|
+
if (tag !== 10) {
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
message.name = reader.string();
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
reader.skipType(tag & 7);
|
|
303
|
+
}
|
|
304
|
+
return message;
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
function createBaseInputSeedPermissions() {
|
|
308
|
+
return { permissions: [] };
|
|
309
|
+
}
|
|
310
|
+
export const InputSeedPermissions = {
|
|
311
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
312
|
+
for (const v of message.permissions) {
|
|
313
|
+
InputSeedPermission.encode(v, writer.uint32(10).fork()).ldelim();
|
|
314
|
+
}
|
|
315
|
+
return writer;
|
|
316
|
+
},
|
|
317
|
+
decode(input, length) {
|
|
318
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
319
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
320
|
+
const message = createBaseInputSeedPermissions();
|
|
321
|
+
while (reader.pos < end) {
|
|
322
|
+
const tag = reader.uint32();
|
|
323
|
+
switch (tag >>> 3) {
|
|
324
|
+
case 1:
|
|
325
|
+
if (tag !== 10) {
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
message.permissions.push(InputSeedPermission.decode(reader, reader.uint32()));
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
reader.skipType(tag & 7);
|
|
335
|
+
}
|
|
336
|
+
return message;
|
|
337
|
+
},
|
|
338
|
+
};
|
|
339
|
+
function createBaseDtoPermission() {
|
|
340
|
+
return { publicId: "", name: "", description: "" };
|
|
341
|
+
}
|
|
342
|
+
export const DtoPermission = {
|
|
343
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
344
|
+
if (message.publicId !== "") {
|
|
345
|
+
writer.uint32(10).string(message.publicId);
|
|
346
|
+
}
|
|
347
|
+
if (message.name !== "") {
|
|
348
|
+
writer.uint32(18).string(message.name);
|
|
349
|
+
}
|
|
350
|
+
if (message.description !== "") {
|
|
351
|
+
writer.uint32(26).string(message.description);
|
|
352
|
+
}
|
|
353
|
+
return writer;
|
|
354
|
+
},
|
|
355
|
+
decode(input, length) {
|
|
356
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
357
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
358
|
+
const message = createBaseDtoPermission();
|
|
208
359
|
while (reader.pos < end) {
|
|
209
360
|
const tag = reader.uint32();
|
|
210
361
|
switch (tag >>> 3) {
|
|
@@ -212,8 +363,20 @@ export const InputPermission = {
|
|
|
212
363
|
if (tag !== 10) {
|
|
213
364
|
break;
|
|
214
365
|
}
|
|
366
|
+
message.publicId = reader.string();
|
|
367
|
+
continue;
|
|
368
|
+
case 2:
|
|
369
|
+
if (tag !== 18) {
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
215
372
|
message.name = reader.string();
|
|
216
373
|
continue;
|
|
374
|
+
case 3:
|
|
375
|
+
if (tag !== 26) {
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
message.description = reader.string();
|
|
379
|
+
continue;
|
|
217
380
|
}
|
|
218
381
|
if ((tag & 7) === 4 || tag === 0) {
|
|
219
382
|
break;
|
|
@@ -223,20 +386,20 @@ export const InputPermission = {
|
|
|
223
386
|
return message;
|
|
224
387
|
},
|
|
225
388
|
};
|
|
226
|
-
function
|
|
389
|
+
function createBaseDtoPermissions() {
|
|
227
390
|
return { permissions: [] };
|
|
228
391
|
}
|
|
229
|
-
export const
|
|
392
|
+
export const DtoPermissions = {
|
|
230
393
|
encode(message, writer = _m0.Writer.create()) {
|
|
231
394
|
for (const v of message.permissions) {
|
|
232
|
-
|
|
395
|
+
DtoPermission.encode(v, writer.uint32(10).fork()).ldelim();
|
|
233
396
|
}
|
|
234
397
|
return writer;
|
|
235
398
|
},
|
|
236
399
|
decode(input, length) {
|
|
237
400
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
238
401
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
239
|
-
const message =
|
|
402
|
+
const message = createBaseDtoPermissions();
|
|
240
403
|
while (reader.pos < end) {
|
|
241
404
|
const tag = reader.uint32();
|
|
242
405
|
switch (tag >>> 3) {
|
|
@@ -244,7 +407,7 @@ export const PermissionSeedRequest = {
|
|
|
244
407
|
if (tag !== 10) {
|
|
245
408
|
break;
|
|
246
409
|
}
|
|
247
|
-
message.permissions.push(
|
|
410
|
+
message.permissions.push(DtoPermission.decode(reader, reader.uint32()));
|
|
248
411
|
continue;
|
|
249
412
|
}
|
|
250
413
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -257,7 +420,7 @@ export const PermissionSeedRequest = {
|
|
|
257
420
|
};
|
|
258
421
|
export function AuthServiceControllerMethods() {
|
|
259
422
|
return function (constructor) {
|
|
260
|
-
const grpcMethods = ["
|
|
423
|
+
const grpcMethods = ["validateAccess", "authorize", "permissionsSeed", "permissions", "permission"];
|
|
261
424
|
for (const method of grpcMethods) {
|
|
262
425
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
263
426
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -271,14 +434,51 @@ export function AuthServiceControllerMethods() {
|
|
|
271
434
|
}
|
|
272
435
|
export const AUTH_SERVICE_NAME = "AuthService";
|
|
273
436
|
export const AuthServiceService = {
|
|
437
|
+
/** --- Authentication --- */
|
|
438
|
+
validateAccess: {
|
|
439
|
+
path: "/aegis.auth.v1.AuthService/ValidateAccess",
|
|
440
|
+
requestStream: false,
|
|
441
|
+
responseStream: false,
|
|
442
|
+
requestSerialize: (value) => Buffer.from(ValidateAccessRequest.encode(value).finish()),
|
|
443
|
+
requestDeserialize: (value) => ValidateAccessRequest.decode(value),
|
|
444
|
+
responseSerialize: (value) => Buffer.from(ValidateAccessResponse.encode(value).finish()),
|
|
445
|
+
responseDeserialize: (value) => ValidateAccessResponse.decode(value),
|
|
446
|
+
},
|
|
447
|
+
authorize: {
|
|
448
|
+
path: "/aegis.auth.v1.AuthService/Authorize",
|
|
449
|
+
requestStream: false,
|
|
450
|
+
responseStream: false,
|
|
451
|
+
requestSerialize: (value) => Buffer.from(AuthorizeRequest.encode(value).finish()),
|
|
452
|
+
requestDeserialize: (value) => AuthorizeRequest.decode(value),
|
|
453
|
+
responseSerialize: (value) => Buffer.from(AuthorizeResponse.encode(value).finish()),
|
|
454
|
+
responseDeserialize: (value) => AuthorizeResponse.decode(value),
|
|
455
|
+
},
|
|
274
456
|
/** --- Permission --- */
|
|
275
|
-
|
|
276
|
-
path: "/aegis.auth.v1.AuthService/
|
|
457
|
+
permissionsSeed: {
|
|
458
|
+
path: "/aegis.auth.v1.AuthService/PermissionsSeed",
|
|
459
|
+
requestStream: false,
|
|
460
|
+
responseStream: false,
|
|
461
|
+
requestSerialize: (value) => Buffer.from(InputSeedPermissions.encode(value).finish()),
|
|
462
|
+
requestDeserialize: (value) => InputSeedPermissions.decode(value),
|
|
463
|
+
responseSerialize: (value) => Buffer.from(DtoPermissions.encode(value).finish()),
|
|
464
|
+
responseDeserialize: (value) => DtoPermissions.decode(value),
|
|
465
|
+
},
|
|
466
|
+
permissions: {
|
|
467
|
+
path: "/aegis.auth.v1.AuthService/Permissions",
|
|
277
468
|
requestStream: false,
|
|
278
469
|
responseStream: false,
|
|
279
|
-
requestSerialize: (value) => Buffer.from(
|
|
280
|
-
requestDeserialize: (value) =>
|
|
470
|
+
requestSerialize: (value) => Buffer.from(Empty.encode(value).finish()),
|
|
471
|
+
requestDeserialize: (value) => Empty.decode(value),
|
|
281
472
|
responseSerialize: (value) => Buffer.from(DtoPermissions.encode(value).finish()),
|
|
282
473
|
responseDeserialize: (value) => DtoPermissions.decode(value),
|
|
283
474
|
},
|
|
475
|
+
permission: {
|
|
476
|
+
path: "/aegis.auth.v1.AuthService/Permission",
|
|
477
|
+
requestStream: false,
|
|
478
|
+
responseStream: false,
|
|
479
|
+
requestSerialize: (value) => Buffer.from(InputPermission.encode(value).finish()),
|
|
480
|
+
requestDeserialize: (value) => InputPermission.decode(value),
|
|
481
|
+
responseSerialize: (value) => Buffer.from(DtoPermission.encode(value).finish()),
|
|
482
|
+
responseDeserialize: (value) => DtoPermission.decode(value),
|
|
483
|
+
},
|
|
284
484
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
5
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
6
|
+
* or the response type of an API method. For instance:
|
|
7
|
+
*
|
|
8
|
+
* service Foo {
|
|
9
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface Empty {
|
|
13
|
+
}
|
|
14
|
+
export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
15
|
+
export declare const Empty: {
|
|
16
|
+
encode(_: Empty, writer?: _m0.Writer): _m0.Writer;
|
|
17
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Empty;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../../../../src/gen/google/protobuf/empty.ts"],"names":[],"mappings":"AAOA,OAAO,GAAG,MAAM,oBAAoB,CAAC;AAErC,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;CACrB;AAED,eAAO,MAAM,4BAA4B,oBAAoB,CAAC;AAM9D,eAAO,MAAM,KAAK;cACN,KAAK,WAAU,GAAG,CAAC,MAAM,GAAyB,GAAG,CAAC,MAAM;kBAIxD,GAAG,CAAC,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,KAAK;CAe/D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.181.2
|
|
4
|
+
// protoc v6.32.0
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import _m0 from "protobufjs/minimal";
|
|
8
|
+
export const protobufPackage = "google.protobuf";
|
|
9
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
10
|
+
function createBaseEmpty() {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
export const Empty = {
|
|
14
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
15
|
+
return writer;
|
|
16
|
+
},
|
|
17
|
+
decode(input, length) {
|
|
18
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
19
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
20
|
+
const message = createBaseEmpty();
|
|
21
|
+
while (reader.pos < end) {
|
|
22
|
+
const tag = reader.uint32();
|
|
23
|
+
switch (tag >>> 3) {
|
|
24
|
+
}
|
|
25
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
reader.skipType(tag & 7);
|
|
29
|
+
}
|
|
30
|
+
return message;
|
|
31
|
+
},
|
|
32
|
+
};
|
package/package.json
CHANGED
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -4,90 +4,84 @@ package aegis.auth.v1;
|
|
|
4
4
|
|
|
5
5
|
option java_multiple_files = true;
|
|
6
6
|
|
|
7
|
-
import "google/protobuf/
|
|
7
|
+
import "google/protobuf/empty.proto";
|
|
8
|
+
// import "google/protobuf/timestamp.proto";
|
|
8
9
|
|
|
9
|
-
enum SortOrder {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
message DtoPaginationMeta {
|
|
15
|
-
int32 total_items = 1;
|
|
16
|
-
int32 total_pages = 2;
|
|
17
|
-
int32 current_page = 3;
|
|
18
|
-
int32 page_size = 4;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// ---- AUTH ----
|
|
22
|
-
// message AuthContext {
|
|
23
|
-
// string session_public_id = 1;
|
|
24
|
-
// string user_public_id = 2;
|
|
25
|
-
// string email = 3;
|
|
26
|
-
// optional string display_name = 4;
|
|
10
|
+
// enum SortOrder {
|
|
11
|
+
// ASC = 0;
|
|
12
|
+
// DESC = 1;
|
|
27
13
|
// }
|
|
28
14
|
|
|
29
|
-
// message
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
15
|
+
// message DtoPaginationMeta {
|
|
16
|
+
// int32 total_items = 1;
|
|
17
|
+
// int32 total_pages = 2;
|
|
18
|
+
// int32 current_page = 3;
|
|
19
|
+
// int32 page_size = 4;
|
|
33
20
|
// }
|
|
34
21
|
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// AuthContext context = 1;
|
|
43
|
-
// }
|
|
22
|
+
// ---- AUTH ----
|
|
23
|
+
message AuthContext {
|
|
24
|
+
string session_public_id = 1;
|
|
25
|
+
string user_public_id = 2;
|
|
26
|
+
string email = 3;
|
|
27
|
+
optional string display_name = 4;
|
|
28
|
+
}
|
|
44
29
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
message ValidateAccessRequest {
|
|
31
|
+
string access_token = 1;
|
|
32
|
+
string user_agent = 2;
|
|
33
|
+
string ip = 3;
|
|
34
|
+
}
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
string description = 3;
|
|
55
|
-
google.protobuf.Timestamp created_at = 6;
|
|
56
|
-
google.protobuf.Timestamp updated_at = 7;
|
|
57
|
-
google.protobuf.Timestamp deleted_at = 8;
|
|
36
|
+
message ValidateAccessResponse {
|
|
37
|
+
optional bool valid = 1;
|
|
38
|
+
optional string reason = 2;
|
|
39
|
+
optional AuthContext context = 3;
|
|
58
40
|
}
|
|
59
41
|
|
|
60
|
-
message
|
|
61
|
-
|
|
62
|
-
repeated DtoPermission items = 2;
|
|
42
|
+
message AuthorizeRequest {
|
|
43
|
+
AuthContext context = 1;
|
|
63
44
|
}
|
|
64
45
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// SortOrder sortOrder = 4;
|
|
70
|
-
// }
|
|
46
|
+
message AuthorizeResponse {
|
|
47
|
+
bool allowed = 1;
|
|
48
|
+
string reason = 2;
|
|
49
|
+
}
|
|
71
50
|
|
|
72
|
-
//
|
|
73
|
-
// string publicId = 1;
|
|
74
|
-
// }
|
|
51
|
+
// ---- PERMISSION ----
|
|
75
52
|
|
|
76
53
|
message InputPermission {
|
|
54
|
+
string publicId = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message InputSeedPermission {
|
|
77
58
|
string name = 1;
|
|
78
59
|
}
|
|
79
60
|
|
|
80
|
-
message
|
|
81
|
-
repeated
|
|
61
|
+
message InputSeedPermissions {
|
|
62
|
+
repeated InputSeedPermission permissions = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message DtoPermission {
|
|
66
|
+
string public_id = 1;
|
|
67
|
+
string name = 2;
|
|
68
|
+
string description = 3;
|
|
69
|
+
// google.protobuf.Timestamp created_at = 6;
|
|
70
|
+
// google.protobuf.Timestamp updated_at = 7;
|
|
71
|
+
// google.protobuf.Timestamp deleted_at = 8;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message DtoPermissions {
|
|
75
|
+
repeated DtoPermission permissions = 1;
|
|
82
76
|
}
|
|
83
77
|
|
|
84
78
|
service AuthService {
|
|
85
|
-
// ---
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
// --- Authentication ---
|
|
80
|
+
rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
81
|
+
rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
88
82
|
|
|
89
83
|
// --- Permission ---
|
|
90
|
-
rpc
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
rpc PermissionsSeed (InputSeedPermissions) returns (DtoPermissions);
|
|
85
|
+
rpc Permissions (google.protobuf.Empty) returns (DtoPermissions);
|
|
86
|
+
rpc Permission (InputPermission) returns (DtoPermission);
|
|
93
87
|
}
|