@acequants/aegis-contracts 0.1.8 → 0.1.9
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 +129 -30
- package/dist/src/gen/auth/v1/auth.d.ts.map +1 -1
- package/dist/src/gen/auth/v1/auth.js +368 -36
- package/package.json +1 -1
- package/proto/auth/v1/auth.proto +46 -46
|
@@ -1,7 +1,6 @@
|
|
|
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 { Timestamp } from "../../google/protobuf/timestamp";
|
|
5
4
|
export declare const protobufPackage = "aegis.auth.v1";
|
|
6
5
|
export declare enum SortOrder {
|
|
7
6
|
ASC = 0,
|
|
@@ -14,23 +13,58 @@ export interface DtoPaginationMeta {
|
|
|
14
13
|
currentPage: number;
|
|
15
14
|
pageSize: number;
|
|
16
15
|
}
|
|
16
|
+
/** ---- AUTH ---- */
|
|
17
|
+
export interface AuthContext {
|
|
18
|
+
sessionPublicId: string;
|
|
19
|
+
userPublicId: string;
|
|
20
|
+
email: string;
|
|
21
|
+
displayName?: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface ValidateAccessRequest {
|
|
24
|
+
accessToken: string;
|
|
25
|
+
userAgent: string;
|
|
26
|
+
ip: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ValidateAccessResponse {
|
|
29
|
+
valid?: boolean | undefined;
|
|
30
|
+
reason?: string | undefined;
|
|
31
|
+
context?: AuthContext | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface AuthorizeRequest {
|
|
34
|
+
context?: AuthContext | undefined;
|
|
35
|
+
}
|
|
36
|
+
export interface AuthorizeResponse {
|
|
37
|
+
allowed: boolean;
|
|
38
|
+
reason: string;
|
|
39
|
+
}
|
|
17
40
|
/** ---- PERMISSION ---- */
|
|
18
41
|
export interface DtoPermission {
|
|
19
42
|
publicId: string;
|
|
20
43
|
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* google.protobuf.Timestamp created_at = 6;
|
|
46
|
+
* google.protobuf.Timestamp updated_at = 7;
|
|
47
|
+
* google.protobuf.Timestamp deleted_at = 8;
|
|
48
|
+
*/
|
|
21
49
|
description: string;
|
|
22
|
-
createdAt?: Timestamp | undefined;
|
|
23
|
-
updatedAt?: Timestamp | undefined;
|
|
24
|
-
deletedAt?: Timestamp | undefined;
|
|
25
50
|
}
|
|
26
51
|
export interface DtoPermissions {
|
|
27
52
|
meta?: DtoPaginationMeta | undefined;
|
|
28
53
|
items: DtoPermission[];
|
|
29
54
|
}
|
|
55
|
+
export interface PermissionsRequest {
|
|
56
|
+
page: number;
|
|
57
|
+
pageSize: number;
|
|
58
|
+
sortBy: string;
|
|
59
|
+
sortOrder: SortOrder;
|
|
60
|
+
}
|
|
61
|
+
export interface PermissionRequest {
|
|
62
|
+
publicId: string;
|
|
63
|
+
}
|
|
30
64
|
export interface InputPermission {
|
|
31
65
|
name: string;
|
|
32
66
|
}
|
|
33
|
-
export interface
|
|
67
|
+
export interface PermissionsSeedRequest {
|
|
34
68
|
permissions: InputPermission[];
|
|
35
69
|
}
|
|
36
70
|
export declare const AEGIS_AUTH_V1_PACKAGE_NAME = "aegis.auth.v1";
|
|
@@ -38,6 +72,26 @@ export declare const DtoPaginationMeta: {
|
|
|
38
72
|
encode(message: DtoPaginationMeta, writer?: _m0.Writer): _m0.Writer;
|
|
39
73
|
decode(input: _m0.Reader | Uint8Array, length?: number): DtoPaginationMeta;
|
|
40
74
|
};
|
|
75
|
+
export declare const AuthContext: {
|
|
76
|
+
encode(message: AuthContext, writer?: _m0.Writer): _m0.Writer;
|
|
77
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AuthContext;
|
|
78
|
+
};
|
|
79
|
+
export declare const ValidateAccessRequest: {
|
|
80
|
+
encode(message: ValidateAccessRequest, writer?: _m0.Writer): _m0.Writer;
|
|
81
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ValidateAccessRequest;
|
|
82
|
+
};
|
|
83
|
+
export declare const ValidateAccessResponse: {
|
|
84
|
+
encode(message: ValidateAccessResponse, writer?: _m0.Writer): _m0.Writer;
|
|
85
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ValidateAccessResponse;
|
|
86
|
+
};
|
|
87
|
+
export declare const AuthorizeRequest: {
|
|
88
|
+
encode(message: AuthorizeRequest, writer?: _m0.Writer): _m0.Writer;
|
|
89
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest;
|
|
90
|
+
};
|
|
91
|
+
export declare const AuthorizeResponse: {
|
|
92
|
+
encode(message: AuthorizeResponse, writer?: _m0.Writer): _m0.Writer;
|
|
93
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeResponse;
|
|
94
|
+
};
|
|
41
95
|
export declare const DtoPermission: {
|
|
42
96
|
encode(message: DtoPermission, writer?: _m0.Writer): _m0.Writer;
|
|
43
97
|
decode(input: _m0.Reader | Uint8Array, length?: number): DtoPermission;
|
|
@@ -46,54 +100,99 @@ export declare const DtoPermissions: {
|
|
|
46
100
|
encode(message: DtoPermissions, writer?: _m0.Writer): _m0.Writer;
|
|
47
101
|
decode(input: _m0.Reader | Uint8Array, length?: number): DtoPermissions;
|
|
48
102
|
};
|
|
103
|
+
export declare const PermissionsRequest: {
|
|
104
|
+
encode(message: PermissionsRequest, writer?: _m0.Writer): _m0.Writer;
|
|
105
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PermissionsRequest;
|
|
106
|
+
};
|
|
107
|
+
export declare const PermissionRequest: {
|
|
108
|
+
encode(message: PermissionRequest, writer?: _m0.Writer): _m0.Writer;
|
|
109
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PermissionRequest;
|
|
110
|
+
};
|
|
49
111
|
export declare const InputPermission: {
|
|
50
112
|
encode(message: InputPermission, writer?: _m0.Writer): _m0.Writer;
|
|
51
113
|
decode(input: _m0.Reader | Uint8Array, length?: number): InputPermission;
|
|
52
114
|
};
|
|
53
|
-
export declare const
|
|
54
|
-
encode(message:
|
|
55
|
-
decode(input: _m0.Reader | Uint8Array, length?: number):
|
|
115
|
+
export declare const PermissionsSeedRequest: {
|
|
116
|
+
encode(message: PermissionsSeedRequest, writer?: _m0.Writer): _m0.Writer;
|
|
117
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PermissionsSeedRequest;
|
|
56
118
|
};
|
|
57
|
-
/**
|
|
58
|
-
* --- Auth ---
|
|
59
|
-
* rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
60
|
-
* rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
61
|
-
*/
|
|
62
119
|
export interface AuthServiceClient {
|
|
120
|
+
/** --- Auth --- */
|
|
121
|
+
validateAccess(request: ValidateAccessRequest): Observable<ValidateAccessResponse>;
|
|
122
|
+
authorize(request: AuthorizeRequest): Observable<AuthorizeResponse>;
|
|
63
123
|
/** --- Permission --- */
|
|
64
|
-
|
|
124
|
+
permissionsSeed(request: PermissionsSeedRequest): Observable<DtoPermissions>;
|
|
125
|
+
permissions(request: PermissionsRequest): Observable<DtoPermissions>;
|
|
126
|
+
permission(request: PermissionRequest): Observable<DtoPermission>;
|
|
65
127
|
}
|
|
66
|
-
/**
|
|
67
|
-
* --- Auth ---
|
|
68
|
-
* rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
69
|
-
* rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
70
|
-
*/
|
|
71
128
|
export interface AuthServiceController {
|
|
129
|
+
/** --- Auth --- */
|
|
130
|
+
validateAccess(request: ValidateAccessRequest): Promise<ValidateAccessResponse> | Observable<ValidateAccessResponse> | ValidateAccessResponse;
|
|
131
|
+
authorize(request: AuthorizeRequest): Promise<AuthorizeResponse> | Observable<AuthorizeResponse> | AuthorizeResponse;
|
|
72
132
|
/** --- Permission --- */
|
|
73
|
-
|
|
133
|
+
permissionsSeed(request: PermissionsSeedRequest): Promise<DtoPermissions> | Observable<DtoPermissions> | DtoPermissions;
|
|
134
|
+
permissions(request: PermissionsRequest): Promise<DtoPermissions> | Observable<DtoPermissions> | DtoPermissions;
|
|
135
|
+
permission(request: PermissionRequest): Promise<DtoPermission> | Observable<DtoPermission> | DtoPermission;
|
|
74
136
|
}
|
|
75
137
|
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
76
138
|
export declare const AUTH_SERVICE_NAME = "AuthService";
|
|
77
|
-
/**
|
|
78
|
-
* --- Auth ---
|
|
79
|
-
* rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
80
|
-
* rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
81
|
-
*/
|
|
82
139
|
export type AuthServiceService = typeof AuthServiceService;
|
|
83
140
|
export declare const AuthServiceService: {
|
|
141
|
+
/** --- Auth --- */
|
|
142
|
+
readonly validateAccess: {
|
|
143
|
+
readonly path: "/aegis.auth.v1.AuthService/ValidateAccess";
|
|
144
|
+
readonly requestStream: false;
|
|
145
|
+
readonly responseStream: false;
|
|
146
|
+
readonly requestSerialize: (value: ValidateAccessRequest) => Buffer<ArrayBuffer>;
|
|
147
|
+
readonly requestDeserialize: (value: Buffer) => ValidateAccessRequest;
|
|
148
|
+
readonly responseSerialize: (value: ValidateAccessResponse) => Buffer<ArrayBuffer>;
|
|
149
|
+
readonly responseDeserialize: (value: Buffer) => ValidateAccessResponse;
|
|
150
|
+
};
|
|
151
|
+
readonly authorize: {
|
|
152
|
+
readonly path: "/aegis.auth.v1.AuthService/Authorize";
|
|
153
|
+
readonly requestStream: false;
|
|
154
|
+
readonly responseStream: false;
|
|
155
|
+
readonly requestSerialize: (value: AuthorizeRequest) => Buffer<ArrayBuffer>;
|
|
156
|
+
readonly requestDeserialize: (value: Buffer) => AuthorizeRequest;
|
|
157
|
+
readonly responseSerialize: (value: AuthorizeResponse) => Buffer<ArrayBuffer>;
|
|
158
|
+
readonly responseDeserialize: (value: Buffer) => AuthorizeResponse;
|
|
159
|
+
};
|
|
84
160
|
/** --- Permission --- */
|
|
85
|
-
readonly
|
|
86
|
-
readonly path: "/aegis.auth.v1.AuthService/
|
|
161
|
+
readonly permissionsSeed: {
|
|
162
|
+
readonly path: "/aegis.auth.v1.AuthService/PermissionsSeed";
|
|
87
163
|
readonly requestStream: false;
|
|
88
164
|
readonly responseStream: false;
|
|
89
|
-
readonly requestSerialize: (value:
|
|
90
|
-
readonly requestDeserialize: (value: Buffer) =>
|
|
165
|
+
readonly requestSerialize: (value: PermissionsSeedRequest) => Buffer<ArrayBuffer>;
|
|
166
|
+
readonly requestDeserialize: (value: Buffer) => PermissionsSeedRequest;
|
|
91
167
|
readonly responseSerialize: (value: DtoPermissions) => Buffer<ArrayBuffer>;
|
|
92
168
|
readonly responseDeserialize: (value: Buffer) => DtoPermissions;
|
|
93
169
|
};
|
|
170
|
+
readonly permissions: {
|
|
171
|
+
readonly path: "/aegis.auth.v1.AuthService/Permissions";
|
|
172
|
+
readonly requestStream: false;
|
|
173
|
+
readonly responseStream: false;
|
|
174
|
+
readonly requestSerialize: (value: PermissionsRequest) => Buffer<ArrayBuffer>;
|
|
175
|
+
readonly requestDeserialize: (value: Buffer) => PermissionsRequest;
|
|
176
|
+
readonly responseSerialize: (value: DtoPermissions) => Buffer<ArrayBuffer>;
|
|
177
|
+
readonly responseDeserialize: (value: Buffer) => DtoPermissions;
|
|
178
|
+
};
|
|
179
|
+
readonly permission: {
|
|
180
|
+
readonly path: "/aegis.auth.v1.AuthService/Permission";
|
|
181
|
+
readonly requestStream: false;
|
|
182
|
+
readonly responseStream: false;
|
|
183
|
+
readonly requestSerialize: (value: PermissionRequest) => Buffer<ArrayBuffer>;
|
|
184
|
+
readonly requestDeserialize: (value: Buffer) => PermissionRequest;
|
|
185
|
+
readonly responseSerialize: (value: DtoPermission) => Buffer<ArrayBuffer>;
|
|
186
|
+
readonly responseDeserialize: (value: Buffer) => DtoPermission;
|
|
187
|
+
};
|
|
94
188
|
};
|
|
95
189
|
export interface AuthServiceServer extends UntypedServiceImplementation {
|
|
190
|
+
/** --- Auth --- */
|
|
191
|
+
validateAccess: handleUnaryCall<ValidateAccessRequest, ValidateAccessResponse>;
|
|
192
|
+
authorize: handleUnaryCall<AuthorizeRequest, AuthorizeResponse>;
|
|
96
193
|
/** --- Permission --- */
|
|
97
|
-
|
|
194
|
+
permissionsSeed: handleUnaryCall<PermissionsSeedRequest, DtoPermissions>;
|
|
195
|
+
permissions: handleUnaryCall<PermissionsRequest, DtoPermissions>;
|
|
196
|
+
permission: handleUnaryCall<PermissionRequest, DtoPermission>;
|
|
98
197
|
}
|
|
99
198
|
//# 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;
|
|
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;AAElC,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,oBAAY,SAAS;IACnB,GAAG,IAAI;IACP,IAAI,IAAI;IACR,YAAY,KAAK;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;I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CACf,MAAM;4CACP,aAAa;8CACX,MAAM;;CAE7B,CAAC;AAEX,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;IACrE,mBAAmB;IACnB,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,sBAAsB,EAAE,cAAc,CAAC,CAAC;IACzE,WAAW,EAAE,eAAe,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;IACjE,UAAU,EAAE,eAAe,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;CAC/D"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
// source: auth/v1/auth.proto
|
|
6
6
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
7
7
|
import _m0 from "protobufjs/minimal";
|
|
8
|
-
import { Timestamp } from "../../google/protobuf/timestamp";
|
|
9
8
|
export const protobufPackage = "aegis.auth.v1";
|
|
10
9
|
export var SortOrder;
|
|
11
10
|
(function (SortOrder) {
|
|
@@ -73,6 +72,238 @@ export const DtoPaginationMeta = {
|
|
|
73
72
|
return message;
|
|
74
73
|
},
|
|
75
74
|
};
|
|
75
|
+
function createBaseAuthContext() {
|
|
76
|
+
return { sessionPublicId: "", userPublicId: "", email: "" };
|
|
77
|
+
}
|
|
78
|
+
export const AuthContext = {
|
|
79
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
80
|
+
if (message.sessionPublicId !== "") {
|
|
81
|
+
writer.uint32(10).string(message.sessionPublicId);
|
|
82
|
+
}
|
|
83
|
+
if (message.userPublicId !== "") {
|
|
84
|
+
writer.uint32(18).string(message.userPublicId);
|
|
85
|
+
}
|
|
86
|
+
if (message.email !== "") {
|
|
87
|
+
writer.uint32(26).string(message.email);
|
|
88
|
+
}
|
|
89
|
+
if (message.displayName !== undefined) {
|
|
90
|
+
writer.uint32(34).string(message.displayName);
|
|
91
|
+
}
|
|
92
|
+
return writer;
|
|
93
|
+
},
|
|
94
|
+
decode(input, length) {
|
|
95
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
96
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
97
|
+
const message = createBaseAuthContext();
|
|
98
|
+
while (reader.pos < end) {
|
|
99
|
+
const tag = reader.uint32();
|
|
100
|
+
switch (tag >>> 3) {
|
|
101
|
+
case 1:
|
|
102
|
+
if (tag !== 10) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.sessionPublicId = reader.string();
|
|
106
|
+
continue;
|
|
107
|
+
case 2:
|
|
108
|
+
if (tag !== 18) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
message.userPublicId = reader.string();
|
|
112
|
+
continue;
|
|
113
|
+
case 3:
|
|
114
|
+
if (tag !== 26) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
message.email = reader.string();
|
|
118
|
+
continue;
|
|
119
|
+
case 4:
|
|
120
|
+
if (tag !== 34) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
message.displayName = reader.string();
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
reader.skipType(tag & 7);
|
|
130
|
+
}
|
|
131
|
+
return message;
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
function createBaseValidateAccessRequest() {
|
|
135
|
+
return { accessToken: "", userAgent: "", ip: "" };
|
|
136
|
+
}
|
|
137
|
+
export const ValidateAccessRequest = {
|
|
138
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
139
|
+
if (message.accessToken !== "") {
|
|
140
|
+
writer.uint32(10).string(message.accessToken);
|
|
141
|
+
}
|
|
142
|
+
if (message.userAgent !== "") {
|
|
143
|
+
writer.uint32(18).string(message.userAgent);
|
|
144
|
+
}
|
|
145
|
+
if (message.ip !== "") {
|
|
146
|
+
writer.uint32(26).string(message.ip);
|
|
147
|
+
}
|
|
148
|
+
return writer;
|
|
149
|
+
},
|
|
150
|
+
decode(input, length) {
|
|
151
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
152
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
153
|
+
const message = createBaseValidateAccessRequest();
|
|
154
|
+
while (reader.pos < end) {
|
|
155
|
+
const tag = reader.uint32();
|
|
156
|
+
switch (tag >>> 3) {
|
|
157
|
+
case 1:
|
|
158
|
+
if (tag !== 10) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
message.accessToken = reader.string();
|
|
162
|
+
continue;
|
|
163
|
+
case 2:
|
|
164
|
+
if (tag !== 18) {
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
message.userAgent = reader.string();
|
|
168
|
+
continue;
|
|
169
|
+
case 3:
|
|
170
|
+
if (tag !== 26) {
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
message.ip = reader.string();
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
reader.skipType(tag & 7);
|
|
180
|
+
}
|
|
181
|
+
return message;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
function createBaseValidateAccessResponse() {
|
|
185
|
+
return {};
|
|
186
|
+
}
|
|
187
|
+
export const ValidateAccessResponse = {
|
|
188
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
189
|
+
if (message.valid !== undefined) {
|
|
190
|
+
writer.uint32(8).bool(message.valid);
|
|
191
|
+
}
|
|
192
|
+
if (message.reason !== undefined) {
|
|
193
|
+
writer.uint32(18).string(message.reason);
|
|
194
|
+
}
|
|
195
|
+
if (message.context !== undefined) {
|
|
196
|
+
AuthContext.encode(message.context, writer.uint32(26).fork()).ldelim();
|
|
197
|
+
}
|
|
198
|
+
return writer;
|
|
199
|
+
},
|
|
200
|
+
decode(input, length) {
|
|
201
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
202
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
203
|
+
const message = createBaseValidateAccessResponse();
|
|
204
|
+
while (reader.pos < end) {
|
|
205
|
+
const tag = reader.uint32();
|
|
206
|
+
switch (tag >>> 3) {
|
|
207
|
+
case 1:
|
|
208
|
+
if (tag !== 8) {
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
message.valid = reader.bool();
|
|
212
|
+
continue;
|
|
213
|
+
case 2:
|
|
214
|
+
if (tag !== 18) {
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
message.reason = reader.string();
|
|
218
|
+
continue;
|
|
219
|
+
case 3:
|
|
220
|
+
if (tag !== 26) {
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
message.context = AuthContext.decode(reader, reader.uint32());
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
reader.skipType(tag & 7);
|
|
230
|
+
}
|
|
231
|
+
return message;
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
function createBaseAuthorizeRequest() {
|
|
235
|
+
return {};
|
|
236
|
+
}
|
|
237
|
+
export const AuthorizeRequest = {
|
|
238
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
239
|
+
if (message.context !== undefined) {
|
|
240
|
+
AuthContext.encode(message.context, writer.uint32(10).fork()).ldelim();
|
|
241
|
+
}
|
|
242
|
+
return writer;
|
|
243
|
+
},
|
|
244
|
+
decode(input, length) {
|
|
245
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
246
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
247
|
+
const message = createBaseAuthorizeRequest();
|
|
248
|
+
while (reader.pos < end) {
|
|
249
|
+
const tag = reader.uint32();
|
|
250
|
+
switch (tag >>> 3) {
|
|
251
|
+
case 1:
|
|
252
|
+
if (tag !== 10) {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
message.context = AuthContext.decode(reader, reader.uint32());
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
reader.skipType(tag & 7);
|
|
262
|
+
}
|
|
263
|
+
return message;
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
function createBaseAuthorizeResponse() {
|
|
267
|
+
return { allowed: false, reason: "" };
|
|
268
|
+
}
|
|
269
|
+
export const AuthorizeResponse = {
|
|
270
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
271
|
+
if (message.allowed !== false) {
|
|
272
|
+
writer.uint32(8).bool(message.allowed);
|
|
273
|
+
}
|
|
274
|
+
if (message.reason !== "") {
|
|
275
|
+
writer.uint32(18).string(message.reason);
|
|
276
|
+
}
|
|
277
|
+
return writer;
|
|
278
|
+
},
|
|
279
|
+
decode(input, length) {
|
|
280
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
281
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
282
|
+
const message = createBaseAuthorizeResponse();
|
|
283
|
+
while (reader.pos < end) {
|
|
284
|
+
const tag = reader.uint32();
|
|
285
|
+
switch (tag >>> 3) {
|
|
286
|
+
case 1:
|
|
287
|
+
if (tag !== 8) {
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
message.allowed = reader.bool();
|
|
291
|
+
continue;
|
|
292
|
+
case 2:
|
|
293
|
+
if (tag !== 18) {
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
message.reason = 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
|
+
};
|
|
76
307
|
function createBaseDtoPermission() {
|
|
77
308
|
return { publicId: "", name: "", description: "" };
|
|
78
309
|
}
|
|
@@ -87,15 +318,6 @@ export const DtoPermission = {
|
|
|
87
318
|
if (message.description !== "") {
|
|
88
319
|
writer.uint32(26).string(message.description);
|
|
89
320
|
}
|
|
90
|
-
if (message.createdAt !== undefined) {
|
|
91
|
-
Timestamp.encode(message.createdAt, writer.uint32(50).fork()).ldelim();
|
|
92
|
-
}
|
|
93
|
-
if (message.updatedAt !== undefined) {
|
|
94
|
-
Timestamp.encode(message.updatedAt, writer.uint32(58).fork()).ldelim();
|
|
95
|
-
}
|
|
96
|
-
if (message.deletedAt !== undefined) {
|
|
97
|
-
Timestamp.encode(message.deletedAt, writer.uint32(66).fork()).ldelim();
|
|
98
|
-
}
|
|
99
321
|
return writer;
|
|
100
322
|
},
|
|
101
323
|
decode(input, length) {
|
|
@@ -123,24 +345,6 @@ export const DtoPermission = {
|
|
|
123
345
|
}
|
|
124
346
|
message.description = reader.string();
|
|
125
347
|
continue;
|
|
126
|
-
case 6:
|
|
127
|
-
if (tag !== 50) {
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
message.createdAt = Timestamp.decode(reader, reader.uint32());
|
|
131
|
-
continue;
|
|
132
|
-
case 7:
|
|
133
|
-
if (tag !== 58) {
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
message.updatedAt = Timestamp.decode(reader, reader.uint32());
|
|
137
|
-
continue;
|
|
138
|
-
case 8:
|
|
139
|
-
if (tag !== 66) {
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
message.deletedAt = Timestamp.decode(reader, reader.uint32());
|
|
143
|
-
continue;
|
|
144
348
|
}
|
|
145
349
|
if ((tag & 7) === 4 || tag === 0) {
|
|
146
350
|
break;
|
|
@@ -191,6 +395,97 @@ export const DtoPermissions = {
|
|
|
191
395
|
return message;
|
|
192
396
|
},
|
|
193
397
|
};
|
|
398
|
+
function createBasePermissionsRequest() {
|
|
399
|
+
return { page: 0, pageSize: 0, sortBy: "", sortOrder: 0 };
|
|
400
|
+
}
|
|
401
|
+
export const PermissionsRequest = {
|
|
402
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
403
|
+
if (message.page !== 0) {
|
|
404
|
+
writer.uint32(8).int32(message.page);
|
|
405
|
+
}
|
|
406
|
+
if (message.pageSize !== 0) {
|
|
407
|
+
writer.uint32(16).int32(message.pageSize);
|
|
408
|
+
}
|
|
409
|
+
if (message.sortBy !== "") {
|
|
410
|
+
writer.uint32(26).string(message.sortBy);
|
|
411
|
+
}
|
|
412
|
+
if (message.sortOrder !== 0) {
|
|
413
|
+
writer.uint32(32).int32(message.sortOrder);
|
|
414
|
+
}
|
|
415
|
+
return writer;
|
|
416
|
+
},
|
|
417
|
+
decode(input, length) {
|
|
418
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
419
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
420
|
+
const message = createBasePermissionsRequest();
|
|
421
|
+
while (reader.pos < end) {
|
|
422
|
+
const tag = reader.uint32();
|
|
423
|
+
switch (tag >>> 3) {
|
|
424
|
+
case 1:
|
|
425
|
+
if (tag !== 8) {
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
message.page = reader.int32();
|
|
429
|
+
continue;
|
|
430
|
+
case 2:
|
|
431
|
+
if (tag !== 16) {
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
message.pageSize = reader.int32();
|
|
435
|
+
continue;
|
|
436
|
+
case 3:
|
|
437
|
+
if (tag !== 26) {
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
message.sortBy = reader.string();
|
|
441
|
+
continue;
|
|
442
|
+
case 4:
|
|
443
|
+
if (tag !== 32) {
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
message.sortOrder = reader.int32();
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
reader.skipType(tag & 7);
|
|
453
|
+
}
|
|
454
|
+
return message;
|
|
455
|
+
},
|
|
456
|
+
};
|
|
457
|
+
function createBasePermissionRequest() {
|
|
458
|
+
return { publicId: "" };
|
|
459
|
+
}
|
|
460
|
+
export const PermissionRequest = {
|
|
461
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
462
|
+
if (message.publicId !== "") {
|
|
463
|
+
writer.uint32(10).string(message.publicId);
|
|
464
|
+
}
|
|
465
|
+
return writer;
|
|
466
|
+
},
|
|
467
|
+
decode(input, length) {
|
|
468
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
469
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
470
|
+
const message = createBasePermissionRequest();
|
|
471
|
+
while (reader.pos < end) {
|
|
472
|
+
const tag = reader.uint32();
|
|
473
|
+
switch (tag >>> 3) {
|
|
474
|
+
case 1:
|
|
475
|
+
if (tag !== 10) {
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
message.publicId = reader.string();
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
reader.skipType(tag & 7);
|
|
485
|
+
}
|
|
486
|
+
return message;
|
|
487
|
+
},
|
|
488
|
+
};
|
|
194
489
|
function createBaseInputPermission() {
|
|
195
490
|
return { name: "" };
|
|
196
491
|
}
|
|
@@ -223,10 +518,10 @@ export const InputPermission = {
|
|
|
223
518
|
return message;
|
|
224
519
|
},
|
|
225
520
|
};
|
|
226
|
-
function
|
|
521
|
+
function createBasePermissionsSeedRequest() {
|
|
227
522
|
return { permissions: [] };
|
|
228
523
|
}
|
|
229
|
-
export const
|
|
524
|
+
export const PermissionsSeedRequest = {
|
|
230
525
|
encode(message, writer = _m0.Writer.create()) {
|
|
231
526
|
for (const v of message.permissions) {
|
|
232
527
|
InputPermission.encode(v, writer.uint32(10).fork()).ldelim();
|
|
@@ -236,7 +531,7 @@ export const PermissionSeedRequest = {
|
|
|
236
531
|
decode(input, length) {
|
|
237
532
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
238
533
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
239
|
-
const message =
|
|
534
|
+
const message = createBasePermissionsSeedRequest();
|
|
240
535
|
while (reader.pos < end) {
|
|
241
536
|
const tag = reader.uint32();
|
|
242
537
|
switch (tag >>> 3) {
|
|
@@ -257,7 +552,7 @@ export const PermissionSeedRequest = {
|
|
|
257
552
|
};
|
|
258
553
|
export function AuthServiceControllerMethods() {
|
|
259
554
|
return function (constructor) {
|
|
260
|
-
const grpcMethods = ["
|
|
555
|
+
const grpcMethods = ["validateAccess", "authorize", "permissionsSeed", "permissions", "permission"];
|
|
261
556
|
for (const method of grpcMethods) {
|
|
262
557
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
263
558
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -271,14 +566,51 @@ export function AuthServiceControllerMethods() {
|
|
|
271
566
|
}
|
|
272
567
|
export const AUTH_SERVICE_NAME = "AuthService";
|
|
273
568
|
export const AuthServiceService = {
|
|
569
|
+
/** --- Auth --- */
|
|
570
|
+
validateAccess: {
|
|
571
|
+
path: "/aegis.auth.v1.AuthService/ValidateAccess",
|
|
572
|
+
requestStream: false,
|
|
573
|
+
responseStream: false,
|
|
574
|
+
requestSerialize: (value) => Buffer.from(ValidateAccessRequest.encode(value).finish()),
|
|
575
|
+
requestDeserialize: (value) => ValidateAccessRequest.decode(value),
|
|
576
|
+
responseSerialize: (value) => Buffer.from(ValidateAccessResponse.encode(value).finish()),
|
|
577
|
+
responseDeserialize: (value) => ValidateAccessResponse.decode(value),
|
|
578
|
+
},
|
|
579
|
+
authorize: {
|
|
580
|
+
path: "/aegis.auth.v1.AuthService/Authorize",
|
|
581
|
+
requestStream: false,
|
|
582
|
+
responseStream: false,
|
|
583
|
+
requestSerialize: (value) => Buffer.from(AuthorizeRequest.encode(value).finish()),
|
|
584
|
+
requestDeserialize: (value) => AuthorizeRequest.decode(value),
|
|
585
|
+
responseSerialize: (value) => Buffer.from(AuthorizeResponse.encode(value).finish()),
|
|
586
|
+
responseDeserialize: (value) => AuthorizeResponse.decode(value),
|
|
587
|
+
},
|
|
274
588
|
/** --- Permission --- */
|
|
275
|
-
|
|
276
|
-
path: "/aegis.auth.v1.AuthService/
|
|
589
|
+
permissionsSeed: {
|
|
590
|
+
path: "/aegis.auth.v1.AuthService/PermissionsSeed",
|
|
277
591
|
requestStream: false,
|
|
278
592
|
responseStream: false,
|
|
279
|
-
requestSerialize: (value) => Buffer.from(
|
|
280
|
-
requestDeserialize: (value) =>
|
|
593
|
+
requestSerialize: (value) => Buffer.from(PermissionsSeedRequest.encode(value).finish()),
|
|
594
|
+
requestDeserialize: (value) => PermissionsSeedRequest.decode(value),
|
|
281
595
|
responseSerialize: (value) => Buffer.from(DtoPermissions.encode(value).finish()),
|
|
282
596
|
responseDeserialize: (value) => DtoPermissions.decode(value),
|
|
283
597
|
},
|
|
598
|
+
permissions: {
|
|
599
|
+
path: "/aegis.auth.v1.AuthService/Permissions",
|
|
600
|
+
requestStream: false,
|
|
601
|
+
responseStream: false,
|
|
602
|
+
requestSerialize: (value) => Buffer.from(PermissionsRequest.encode(value).finish()),
|
|
603
|
+
requestDeserialize: (value) => PermissionsRequest.decode(value),
|
|
604
|
+
responseSerialize: (value) => Buffer.from(DtoPermissions.encode(value).finish()),
|
|
605
|
+
responseDeserialize: (value) => DtoPermissions.decode(value),
|
|
606
|
+
},
|
|
607
|
+
permission: {
|
|
608
|
+
path: "/aegis.auth.v1.AuthService/Permission",
|
|
609
|
+
requestStream: false,
|
|
610
|
+
responseStream: false,
|
|
611
|
+
requestSerialize: (value) => Buffer.from(PermissionRequest.encode(value).finish()),
|
|
612
|
+
requestDeserialize: (value) => PermissionRequest.decode(value),
|
|
613
|
+
responseSerialize: (value) => Buffer.from(DtoPermission.encode(value).finish()),
|
|
614
|
+
responseDeserialize: (value) => DtoPermission.decode(value),
|
|
615
|
+
},
|
|
284
616
|
};
|
package/package.json
CHANGED
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -4,7 +4,7 @@ package aegis.auth.v1;
|
|
|
4
4
|
|
|
5
5
|
option java_multiple_files = true;
|
|
6
6
|
|
|
7
|
-
import "google/protobuf/timestamp.proto";
|
|
7
|
+
// import "google/protobuf/timestamp.proto";
|
|
8
8
|
|
|
9
9
|
enum SortOrder {
|
|
10
10
|
ASC = 0;
|
|
@@ -19,42 +19,42 @@ message DtoPaginationMeta {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// ---- AUTH ----
|
|
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
|
-
|
|
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;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message ValidateAccessRequest {
|
|
30
|
+
string access_token = 1;
|
|
31
|
+
string user_agent = 2;
|
|
32
|
+
string ip = 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message ValidateAccessResponse {
|
|
36
|
+
optional bool valid = 1;
|
|
37
|
+
optional string reason = 2;
|
|
38
|
+
optional AuthContext context = 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message AuthorizeRequest {
|
|
42
|
+
AuthContext context = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message AuthorizeResponse {
|
|
46
|
+
bool allowed = 1;
|
|
47
|
+
string reason = 2;
|
|
48
|
+
}
|
|
49
49
|
|
|
50
50
|
// ---- PERMISSION ----
|
|
51
51
|
message DtoPermission {
|
|
52
52
|
string public_id = 1;
|
|
53
53
|
string name = 2;
|
|
54
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;
|
|
55
|
+
// google.protobuf.Timestamp created_at = 6;
|
|
56
|
+
// google.protobuf.Timestamp updated_at = 7;
|
|
57
|
+
// google.protobuf.Timestamp deleted_at = 8;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
message DtoPermissions {
|
|
@@ -62,32 +62,32 @@ message DtoPermissions {
|
|
|
62
62
|
repeated DtoPermission items = 2;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
message PermissionsRequest {
|
|
66
|
+
int32 page = 1;
|
|
67
|
+
int32 pageSize = 2;
|
|
68
|
+
string sortBy = 3;
|
|
69
|
+
SortOrder sortOrder = 4;
|
|
70
|
+
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
message PermissionRequest {
|
|
73
|
+
string publicId = 1;
|
|
74
|
+
}
|
|
75
75
|
|
|
76
76
|
message InputPermission {
|
|
77
77
|
string name = 1;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
message
|
|
80
|
+
message PermissionsSeedRequest {
|
|
81
81
|
repeated InputPermission permissions = 1;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
service AuthService {
|
|
85
85
|
// --- Auth ---
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
|
|
87
|
+
rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
|
|
88
88
|
|
|
89
89
|
// --- Permission ---
|
|
90
|
-
rpc
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
rpc PermissionsSeed (PermissionsSeedRequest) returns (DtoPermissions);
|
|
91
|
+
rpc Permissions (PermissionsRequest) returns (DtoPermissions);
|
|
92
|
+
rpc Permission (PermissionRequest) returns (DtoPermission);
|
|
93
93
|
}
|