@acequants/aegis-contracts 0.1.11 → 0.1.13

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.
@@ -9,35 +9,52 @@ export interface DtoPagination {
9
9
  pageSize: number;
10
10
  }
11
11
  /** ---- AUTH ---- */
12
- export interface AuthContext {
13
- sessionPublicId: string;
14
- userPublicId: string;
12
+ export interface DtoRole {
13
+ publicId: string;
14
+ name: string;
15
+ }
16
+ export interface DtoUserRoles {
17
+ role?: DtoRole | undefined;
18
+ }
19
+ export interface DtoUser {
20
+ publicId: string;
15
21
  email: string;
22
+ phone: string;
16
23
  displayName?: string | undefined;
24
+ roles: DtoUserRoles[];
17
25
  }
18
- export interface ValidateAccessRequest {
19
- accessToken: string;
20
- userAgent: string;
21
- ip: string;
26
+ export interface DtoService {
27
+ publicId: string;
28
+ namespace: string;
29
+ }
30
+ export interface DtoSession {
31
+ publicId: string;
32
+ service?: DtoService | undefined;
33
+ user?: DtoUser | undefined;
22
34
  }
23
- export interface ValidateAccessResponse {
35
+ export interface DtoAuthenticate {
24
36
  valid?: boolean | undefined;
25
37
  reason?: string | undefined;
26
- context?: AuthContext | undefined;
38
+ context?: DtoSession | undefined;
27
39
  }
28
- export interface AuthorizeRequest {
29
- context?: AuthContext | undefined;
30
- }
31
- export interface AuthorizeResponse {
40
+ export interface DtoAuthorize {
32
41
  allowed: boolean;
33
42
  reason: string;
34
43
  }
44
+ export interface InputAuthenticate {
45
+ accessToken: string;
46
+ userAgent: string;
47
+ ip: string;
48
+ }
49
+ export interface InputAuthorize {
50
+ context?: DtoSession | undefined;
51
+ }
35
52
  export interface InputPermission {
36
53
  publicId: string;
37
54
  }
38
55
  export interface InputPermissions {
39
- page: number;
40
- pageSize: number;
56
+ page?: number | undefined;
57
+ pageSize?: number | undefined;
41
58
  search?: string | undefined;
42
59
  sortBy?: string | undefined;
43
60
  sortOrder?: string | undefined;
@@ -70,25 +87,41 @@ export declare const DtoPagination: {
70
87
  encode(message: DtoPagination, writer?: _m0.Writer): _m0.Writer;
71
88
  decode(input: _m0.Reader | Uint8Array, length?: number): DtoPagination;
72
89
  };
73
- export declare const AuthContext: {
74
- encode(message: AuthContext, writer?: _m0.Writer): _m0.Writer;
75
- decode(input: _m0.Reader | Uint8Array, length?: number): AuthContext;
90
+ export declare const DtoRole: {
91
+ encode(message: DtoRole, writer?: _m0.Writer): _m0.Writer;
92
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoRole;
93
+ };
94
+ export declare const DtoUserRoles: {
95
+ encode(message: DtoUserRoles, writer?: _m0.Writer): _m0.Writer;
96
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoUserRoles;
97
+ };
98
+ export declare const DtoUser: {
99
+ encode(message: DtoUser, writer?: _m0.Writer): _m0.Writer;
100
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoUser;
101
+ };
102
+ export declare const DtoService: {
103
+ encode(message: DtoService, writer?: _m0.Writer): _m0.Writer;
104
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoService;
105
+ };
106
+ export declare const DtoSession: {
107
+ encode(message: DtoSession, writer?: _m0.Writer): _m0.Writer;
108
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoSession;
76
109
  };
77
- export declare const ValidateAccessRequest: {
78
- encode(message: ValidateAccessRequest, writer?: _m0.Writer): _m0.Writer;
79
- decode(input: _m0.Reader | Uint8Array, length?: number): ValidateAccessRequest;
110
+ export declare const DtoAuthenticate: {
111
+ encode(message: DtoAuthenticate, writer?: _m0.Writer): _m0.Writer;
112
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoAuthenticate;
80
113
  };
81
- export declare const ValidateAccessResponse: {
82
- encode(message: ValidateAccessResponse, writer?: _m0.Writer): _m0.Writer;
83
- decode(input: _m0.Reader | Uint8Array, length?: number): ValidateAccessResponse;
114
+ export declare const DtoAuthorize: {
115
+ encode(message: DtoAuthorize, writer?: _m0.Writer): _m0.Writer;
116
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoAuthorize;
84
117
  };
85
- export declare const AuthorizeRequest: {
86
- encode(message: AuthorizeRequest, writer?: _m0.Writer): _m0.Writer;
87
- decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest;
118
+ export declare const InputAuthenticate: {
119
+ encode(message: InputAuthenticate, writer?: _m0.Writer): _m0.Writer;
120
+ decode(input: _m0.Reader | Uint8Array, length?: number): InputAuthenticate;
88
121
  };
89
- export declare const AuthorizeResponse: {
90
- encode(message: AuthorizeResponse, writer?: _m0.Writer): _m0.Writer;
91
- decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeResponse;
122
+ export declare const InputAuthorize: {
123
+ encode(message: InputAuthorize, writer?: _m0.Writer): _m0.Writer;
124
+ decode(input: _m0.Reader | Uint8Array, length?: number): InputAuthorize;
92
125
  };
93
126
  export declare const InputPermission: {
94
127
  encode(message: InputPermission, writer?: _m0.Writer): _m0.Writer;
@@ -119,18 +152,18 @@ export declare const DtoPermissionsPaginated: {
119
152
  decode(input: _m0.Reader | Uint8Array, length?: number): DtoPermissionsPaginated;
120
153
  };
121
154
  export interface AuthServiceClient {
122
- /** --- Authentication --- */
123
- validateAccess(request: ValidateAccessRequest): Observable<ValidateAccessResponse>;
124
- authorize(request: AuthorizeRequest): Observable<AuthorizeResponse>;
155
+ /** --- Authe --- */
156
+ authenticate(request: InputAuthenticate): Observable<DtoAuthenticate>;
157
+ authorize(request: InputAuthorize): Observable<DtoAuthorize>;
125
158
  /** --- Permission --- */
126
159
  permissionsSeed(request: InputSeedPermissions): Observable<DtoPermissions>;
127
160
  permissions(request: InputPermissions): Observable<DtoPermissionsPaginated>;
128
161
  permission(request: InputPermission): Observable<DtoPermission>;
129
162
  }
130
163
  export interface AuthServiceController {
131
- /** --- Authentication --- */
132
- validateAccess(request: ValidateAccessRequest): Promise<ValidateAccessResponse> | Observable<ValidateAccessResponse> | ValidateAccessResponse;
133
- authorize(request: AuthorizeRequest): Promise<AuthorizeResponse> | Observable<AuthorizeResponse> | AuthorizeResponse;
164
+ /** --- Authe --- */
165
+ authenticate(request: InputAuthenticate): Promise<DtoAuthenticate> | Observable<DtoAuthenticate> | DtoAuthenticate;
166
+ authorize(request: InputAuthorize): Promise<DtoAuthorize> | Observable<DtoAuthorize> | DtoAuthorize;
134
167
  /** --- Permission --- */
135
168
  permissionsSeed(request: InputSeedPermissions): Promise<DtoPermissions> | Observable<DtoPermissions> | DtoPermissions;
136
169
  permissions(request: InputPermissions): Promise<DtoPermissionsPaginated> | Observable<DtoPermissionsPaginated> | DtoPermissionsPaginated;
@@ -140,24 +173,24 @@ export declare function AuthServiceControllerMethods(): (constructor: Function)
140
173
  export declare const AUTH_SERVICE_NAME = "AuthService";
141
174
  export type AuthServiceService = typeof AuthServiceService;
142
175
  export declare const AuthServiceService: {
143
- /** --- Authentication --- */
144
- readonly validateAccess: {
145
- readonly path: "/aegis.auth.v1.AuthService/ValidateAccess";
176
+ /** --- Authe --- */
177
+ readonly authenticate: {
178
+ readonly path: "/aegis.auth.v1.AuthService/Authenticate";
146
179
  readonly requestStream: false;
147
180
  readonly responseStream: false;
148
- readonly requestSerialize: (value: ValidateAccessRequest) => Buffer<ArrayBuffer>;
149
- readonly requestDeserialize: (value: Buffer) => ValidateAccessRequest;
150
- readonly responseSerialize: (value: ValidateAccessResponse) => Buffer<ArrayBuffer>;
151
- readonly responseDeserialize: (value: Buffer) => ValidateAccessResponse;
181
+ readonly requestSerialize: (value: InputAuthenticate) => Buffer<ArrayBuffer>;
182
+ readonly requestDeserialize: (value: Buffer) => InputAuthenticate;
183
+ readonly responseSerialize: (value: DtoAuthenticate) => Buffer<ArrayBuffer>;
184
+ readonly responseDeserialize: (value: Buffer) => DtoAuthenticate;
152
185
  };
153
186
  readonly authorize: {
154
187
  readonly path: "/aegis.auth.v1.AuthService/Authorize";
155
188
  readonly requestStream: false;
156
189
  readonly responseStream: false;
157
- readonly requestSerialize: (value: AuthorizeRequest) => Buffer<ArrayBuffer>;
158
- readonly requestDeserialize: (value: Buffer) => AuthorizeRequest;
159
- readonly responseSerialize: (value: AuthorizeResponse) => Buffer<ArrayBuffer>;
160
- readonly responseDeserialize: (value: Buffer) => AuthorizeResponse;
190
+ readonly requestSerialize: (value: InputAuthorize) => Buffer<ArrayBuffer>;
191
+ readonly requestDeserialize: (value: Buffer) => InputAuthorize;
192
+ readonly responseSerialize: (value: DtoAuthorize) => Buffer<ArrayBuffer>;
193
+ readonly responseDeserialize: (value: Buffer) => DtoAuthorize;
161
194
  };
162
195
  /** --- Permission --- */
163
196
  readonly permissionsSeed: {
@@ -189,9 +222,9 @@ export declare const AuthServiceService: {
189
222
  };
190
223
  };
191
224
  export interface AuthServiceServer extends UntypedServiceImplementation {
192
- /** --- Authentication --- */
193
- validateAccess: handleUnaryCall<ValidateAccessRequest, ValidateAccessResponse>;
194
- authorize: handleUnaryCall<AuthorizeRequest, AuthorizeResponse>;
225
+ /** --- Authe --- */
226
+ authenticate: handleUnaryCall<InputAuthenticate, DtoAuthenticate>;
227
+ authorize: handleUnaryCall<InputAuthorize, DtoAuthorize>;
195
228
  /** --- Permission --- */
196
229
  permissionsSeed: handleUnaryCall<InputSeedPermissions, DtoPermissions>;
197
230
  permissions: handleUnaryCall<InputPermissions, DtoPermissionsPaginated>;
@@ -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;AAElC,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB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AuB;8CACrB,MAAM;;;;;;2CAMT,eAAe;6CACb,MAAM;4CACP,aAAa;8CACX,MAAM;;CAE7B,CAAC;AAEX,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;IACrE,oBAAoB;IACpB,YAAY,EAAE,eAAe,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IAClE,SAAS,EAAE,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACzD,yBAAyB;IACzB,eAAe,EAAE,eAAe,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;IACvE,WAAW,EAAE,eAAe,CAAC,gBAAgB,EAAE,uBAAuB,CAAC,CAAC;IACxE,UAAU,EAAE,eAAe,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;CAC7D"}
@@ -66,29 +66,105 @@ export const DtoPagination = {
66
66
  return message;
67
67
  },
68
68
  };
69
- function createBaseAuthContext() {
70
- return { sessionPublicId: "", userPublicId: "", email: "" };
69
+ function createBaseDtoRole() {
70
+ return { publicId: "", name: "" };
71
71
  }
72
- export const AuthContext = {
72
+ export const DtoRole = {
73
73
  encode(message, writer = _m0.Writer.create()) {
74
- if (message.sessionPublicId !== "") {
75
- writer.uint32(10).string(message.sessionPublicId);
74
+ if (message.publicId !== "") {
75
+ writer.uint32(10).string(message.publicId);
76
76
  }
77
- if (message.userPublicId !== "") {
78
- writer.uint32(18).string(message.userPublicId);
77
+ if (message.name !== "") {
78
+ writer.uint32(18).string(message.name);
79
+ }
80
+ return writer;
81
+ },
82
+ decode(input, length) {
83
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
84
+ let end = length === undefined ? reader.len : reader.pos + length;
85
+ const message = createBaseDtoRole();
86
+ while (reader.pos < end) {
87
+ const tag = reader.uint32();
88
+ switch (tag >>> 3) {
89
+ case 1:
90
+ if (tag !== 10) {
91
+ break;
92
+ }
93
+ message.publicId = reader.string();
94
+ continue;
95
+ case 2:
96
+ if (tag !== 18) {
97
+ break;
98
+ }
99
+ message.name = reader.string();
100
+ continue;
101
+ }
102
+ if ((tag & 7) === 4 || tag === 0) {
103
+ break;
104
+ }
105
+ reader.skipType(tag & 7);
106
+ }
107
+ return message;
108
+ },
109
+ };
110
+ function createBaseDtoUserRoles() {
111
+ return {};
112
+ }
113
+ export const DtoUserRoles = {
114
+ encode(message, writer = _m0.Writer.create()) {
115
+ if (message.role !== undefined) {
116
+ DtoRole.encode(message.role, writer.uint32(10).fork()).ldelim();
117
+ }
118
+ return writer;
119
+ },
120
+ decode(input, length) {
121
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
122
+ let end = length === undefined ? reader.len : reader.pos + length;
123
+ const message = createBaseDtoUserRoles();
124
+ while (reader.pos < end) {
125
+ const tag = reader.uint32();
126
+ switch (tag >>> 3) {
127
+ case 1:
128
+ if (tag !== 10) {
129
+ break;
130
+ }
131
+ message.role = DtoRole.decode(reader, reader.uint32());
132
+ continue;
133
+ }
134
+ if ((tag & 7) === 4 || tag === 0) {
135
+ break;
136
+ }
137
+ reader.skipType(tag & 7);
138
+ }
139
+ return message;
140
+ },
141
+ };
142
+ function createBaseDtoUser() {
143
+ return { publicId: "", email: "", phone: "", roles: [] };
144
+ }
145
+ export const DtoUser = {
146
+ encode(message, writer = _m0.Writer.create()) {
147
+ if (message.publicId !== "") {
148
+ writer.uint32(10).string(message.publicId);
79
149
  }
80
150
  if (message.email !== "") {
81
- writer.uint32(26).string(message.email);
151
+ writer.uint32(18).string(message.email);
152
+ }
153
+ if (message.phone !== "") {
154
+ writer.uint32(26).string(message.phone);
82
155
  }
83
156
  if (message.displayName !== undefined) {
84
157
  writer.uint32(34).string(message.displayName);
85
158
  }
159
+ for (const v of message.roles) {
160
+ DtoUserRoles.encode(v, writer.uint32(42).fork()).ldelim();
161
+ }
86
162
  return writer;
87
163
  },
88
164
  decode(input, length) {
89
165
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
90
166
  let end = length === undefined ? reader.len : reader.pos + length;
91
- const message = createBaseAuthContext();
167
+ const message = createBaseDtoUser();
92
168
  while (reader.pos < end) {
93
169
  const tag = reader.uint32();
94
170
  switch (tag >>> 3) {
@@ -96,19 +172,19 @@ export const AuthContext = {
96
172
  if (tag !== 10) {
97
173
  break;
98
174
  }
99
- message.sessionPublicId = reader.string();
175
+ message.publicId = reader.string();
100
176
  continue;
101
177
  case 2:
102
178
  if (tag !== 18) {
103
179
  break;
104
180
  }
105
- message.userPublicId = reader.string();
181
+ message.email = reader.string();
106
182
  continue;
107
183
  case 3:
108
184
  if (tag !== 26) {
109
185
  break;
110
186
  }
111
- message.email = reader.string();
187
+ message.phone = reader.string();
112
188
  continue;
113
189
  case 4:
114
190
  if (tag !== 34) {
@@ -116,6 +192,12 @@ export const AuthContext = {
116
192
  }
117
193
  message.displayName = reader.string();
118
194
  continue;
195
+ case 5:
196
+ if (tag !== 42) {
197
+ break;
198
+ }
199
+ message.roles.push(DtoUserRoles.decode(reader, reader.uint32()));
200
+ continue;
119
201
  }
120
202
  if ((tag & 7) === 4 || tag === 0) {
121
203
  break;
@@ -125,26 +207,67 @@ export const AuthContext = {
125
207
  return message;
126
208
  },
127
209
  };
128
- function createBaseValidateAccessRequest() {
129
- return { accessToken: "", userAgent: "", ip: "" };
210
+ function createBaseDtoService() {
211
+ return { publicId: "", namespace: "" };
130
212
  }
131
- export const ValidateAccessRequest = {
213
+ export const DtoService = {
132
214
  encode(message, writer = _m0.Writer.create()) {
133
- if (message.accessToken !== "") {
134
- writer.uint32(10).string(message.accessToken);
215
+ if (message.publicId !== "") {
216
+ writer.uint32(10).string(message.publicId);
135
217
  }
136
- if (message.userAgent !== "") {
137
- writer.uint32(18).string(message.userAgent);
218
+ if (message.namespace !== "") {
219
+ writer.uint32(18).string(message.namespace);
138
220
  }
139
- if (message.ip !== "") {
140
- writer.uint32(26).string(message.ip);
221
+ return writer;
222
+ },
223
+ decode(input, length) {
224
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
225
+ let end = length === undefined ? reader.len : reader.pos + length;
226
+ const message = createBaseDtoService();
227
+ while (reader.pos < end) {
228
+ const tag = reader.uint32();
229
+ switch (tag >>> 3) {
230
+ case 1:
231
+ if (tag !== 10) {
232
+ break;
233
+ }
234
+ message.publicId = reader.string();
235
+ continue;
236
+ case 2:
237
+ if (tag !== 18) {
238
+ break;
239
+ }
240
+ message.namespace = reader.string();
241
+ continue;
242
+ }
243
+ if ((tag & 7) === 4 || tag === 0) {
244
+ break;
245
+ }
246
+ reader.skipType(tag & 7);
247
+ }
248
+ return message;
249
+ },
250
+ };
251
+ function createBaseDtoSession() {
252
+ return { publicId: "" };
253
+ }
254
+ export const DtoSession = {
255
+ encode(message, writer = _m0.Writer.create()) {
256
+ if (message.publicId !== "") {
257
+ writer.uint32(10).string(message.publicId);
258
+ }
259
+ if (message.service !== undefined) {
260
+ DtoService.encode(message.service, writer.uint32(18).fork()).ldelim();
261
+ }
262
+ if (message.user !== undefined) {
263
+ DtoUser.encode(message.user, writer.uint32(26).fork()).ldelim();
141
264
  }
142
265
  return writer;
143
266
  },
144
267
  decode(input, length) {
145
268
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
146
269
  let end = length === undefined ? reader.len : reader.pos + length;
147
- const message = createBaseValidateAccessRequest();
270
+ const message = createBaseDtoSession();
148
271
  while (reader.pos < end) {
149
272
  const tag = reader.uint32();
150
273
  switch (tag >>> 3) {
@@ -152,19 +275,19 @@ export const ValidateAccessRequest = {
152
275
  if (tag !== 10) {
153
276
  break;
154
277
  }
155
- message.accessToken = reader.string();
278
+ message.publicId = reader.string();
156
279
  continue;
157
280
  case 2:
158
281
  if (tag !== 18) {
159
282
  break;
160
283
  }
161
- message.userAgent = reader.string();
284
+ message.service = DtoService.decode(reader, reader.uint32());
162
285
  continue;
163
286
  case 3:
164
287
  if (tag !== 26) {
165
288
  break;
166
289
  }
167
- message.ip = reader.string();
290
+ message.user = DtoUser.decode(reader, reader.uint32());
168
291
  continue;
169
292
  }
170
293
  if ((tag & 7) === 4 || tag === 0) {
@@ -175,10 +298,10 @@ export const ValidateAccessRequest = {
175
298
  return message;
176
299
  },
177
300
  };
178
- function createBaseValidateAccessResponse() {
301
+ function createBaseDtoAuthenticate() {
179
302
  return {};
180
303
  }
181
- export const ValidateAccessResponse = {
304
+ export const DtoAuthenticate = {
182
305
  encode(message, writer = _m0.Writer.create()) {
183
306
  if (message.valid !== undefined) {
184
307
  writer.uint32(8).bool(message.valid);
@@ -187,14 +310,14 @@ export const ValidateAccessResponse = {
187
310
  writer.uint32(18).string(message.reason);
188
311
  }
189
312
  if (message.context !== undefined) {
190
- AuthContext.encode(message.context, writer.uint32(26).fork()).ldelim();
313
+ DtoSession.encode(message.context, writer.uint32(26).fork()).ldelim();
191
314
  }
192
315
  return writer;
193
316
  },
194
317
  decode(input, length) {
195
318
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
196
319
  let end = length === undefined ? reader.len : reader.pos + length;
197
- const message = createBaseValidateAccessResponse();
320
+ const message = createBaseDtoAuthenticate();
198
321
  while (reader.pos < end) {
199
322
  const tag = reader.uint32();
200
323
  switch (tag >>> 3) {
@@ -214,7 +337,7 @@ export const ValidateAccessResponse = {
214
337
  if (tag !== 26) {
215
338
  break;
216
339
  }
217
- message.context = AuthContext.decode(reader, reader.uint32());
340
+ message.context = DtoSession.decode(reader, reader.uint32());
218
341
  continue;
219
342
  }
220
343
  if ((tag & 7) === 4 || tag === 0) {
@@ -225,28 +348,37 @@ export const ValidateAccessResponse = {
225
348
  return message;
226
349
  },
227
350
  };
228
- function createBaseAuthorizeRequest() {
229
- return {};
351
+ function createBaseDtoAuthorize() {
352
+ return { allowed: false, reason: "" };
230
353
  }
231
- export const AuthorizeRequest = {
354
+ export const DtoAuthorize = {
232
355
  encode(message, writer = _m0.Writer.create()) {
233
- if (message.context !== undefined) {
234
- AuthContext.encode(message.context, writer.uint32(10).fork()).ldelim();
356
+ if (message.allowed !== false) {
357
+ writer.uint32(8).bool(message.allowed);
358
+ }
359
+ if (message.reason !== "") {
360
+ writer.uint32(18).string(message.reason);
235
361
  }
236
362
  return writer;
237
363
  },
238
364
  decode(input, length) {
239
365
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
240
366
  let end = length === undefined ? reader.len : reader.pos + length;
241
- const message = createBaseAuthorizeRequest();
367
+ const message = createBaseDtoAuthorize();
242
368
  while (reader.pos < end) {
243
369
  const tag = reader.uint32();
244
370
  switch (tag >>> 3) {
245
371
  case 1:
246
- if (tag !== 10) {
372
+ if (tag !== 8) {
373
+ break;
374
+ }
375
+ message.allowed = reader.bool();
376
+ continue;
377
+ case 2:
378
+ if (tag !== 18) {
247
379
  break;
248
380
  }
249
- message.context = AuthContext.decode(reader, reader.uint32());
381
+ message.reason = reader.string();
250
382
  continue;
251
383
  }
252
384
  if ((tag & 7) === 4 || tag === 0) {
@@ -257,37 +389,78 @@ export const AuthorizeRequest = {
257
389
  return message;
258
390
  },
259
391
  };
260
- function createBaseAuthorizeResponse() {
261
- return { allowed: false, reason: "" };
392
+ function createBaseInputAuthenticate() {
393
+ return { accessToken: "", userAgent: "", ip: "" };
262
394
  }
263
- export const AuthorizeResponse = {
395
+ export const InputAuthenticate = {
264
396
  encode(message, writer = _m0.Writer.create()) {
265
- if (message.allowed !== false) {
266
- writer.uint32(8).bool(message.allowed);
397
+ if (message.accessToken !== "") {
398
+ writer.uint32(10).string(message.accessToken);
267
399
  }
268
- if (message.reason !== "") {
269
- writer.uint32(18).string(message.reason);
400
+ if (message.userAgent !== "") {
401
+ writer.uint32(18).string(message.userAgent);
402
+ }
403
+ if (message.ip !== "") {
404
+ writer.uint32(26).string(message.ip);
270
405
  }
271
406
  return writer;
272
407
  },
273
408
  decode(input, length) {
274
409
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
275
410
  let end = length === undefined ? reader.len : reader.pos + length;
276
- const message = createBaseAuthorizeResponse();
411
+ const message = createBaseInputAuthenticate();
277
412
  while (reader.pos < end) {
278
413
  const tag = reader.uint32();
279
414
  switch (tag >>> 3) {
280
415
  case 1:
281
- if (tag !== 8) {
416
+ if (tag !== 10) {
282
417
  break;
283
418
  }
284
- message.allowed = reader.bool();
419
+ message.accessToken = reader.string();
285
420
  continue;
286
421
  case 2:
287
422
  if (tag !== 18) {
288
423
  break;
289
424
  }
290
- message.reason = reader.string();
425
+ message.userAgent = reader.string();
426
+ continue;
427
+ case 3:
428
+ if (tag !== 26) {
429
+ break;
430
+ }
431
+ message.ip = reader.string();
432
+ continue;
433
+ }
434
+ if ((tag & 7) === 4 || tag === 0) {
435
+ break;
436
+ }
437
+ reader.skipType(tag & 7);
438
+ }
439
+ return message;
440
+ },
441
+ };
442
+ function createBaseInputAuthorize() {
443
+ return {};
444
+ }
445
+ export const InputAuthorize = {
446
+ encode(message, writer = _m0.Writer.create()) {
447
+ if (message.context !== undefined) {
448
+ DtoSession.encode(message.context, writer.uint32(10).fork()).ldelim();
449
+ }
450
+ return writer;
451
+ },
452
+ decode(input, length) {
453
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
454
+ let end = length === undefined ? reader.len : reader.pos + length;
455
+ const message = createBaseInputAuthorize();
456
+ while (reader.pos < end) {
457
+ const tag = reader.uint32();
458
+ switch (tag >>> 3) {
459
+ case 1:
460
+ if (tag !== 10) {
461
+ break;
462
+ }
463
+ message.context = DtoSession.decode(reader, reader.uint32());
291
464
  continue;
292
465
  }
293
466
  if ((tag & 7) === 4 || tag === 0) {
@@ -331,14 +504,14 @@ export const InputPermission = {
331
504
  },
332
505
  };
333
506
  function createBaseInputPermissions() {
334
- return { page: 0, pageSize: 0 };
507
+ return {};
335
508
  }
336
509
  export const InputPermissions = {
337
510
  encode(message, writer = _m0.Writer.create()) {
338
- if (message.page !== 0) {
511
+ if (message.page !== undefined) {
339
512
  writer.uint32(8).int32(message.page);
340
513
  }
341
- if (message.pageSize !== 0) {
514
+ if (message.pageSize !== undefined) {
342
515
  writer.uint32(16).int32(message.pageSize);
343
516
  }
344
517
  if (message.search !== undefined) {
@@ -587,7 +760,7 @@ export const DtoPermissionsPaginated = {
587
760
  };
588
761
  export function AuthServiceControllerMethods() {
589
762
  return function (constructor) {
590
- const grpcMethods = ["validateAccess", "authorize", "permissionsSeed", "permissions", "permission"];
763
+ const grpcMethods = ["authenticate", "authorize", "permissionsSeed", "permissions", "permission"];
591
764
  for (const method of grpcMethods) {
592
765
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
593
766
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -601,24 +774,24 @@ export function AuthServiceControllerMethods() {
601
774
  }
602
775
  export const AUTH_SERVICE_NAME = "AuthService";
603
776
  export const AuthServiceService = {
604
- /** --- Authentication --- */
605
- validateAccess: {
606
- path: "/aegis.auth.v1.AuthService/ValidateAccess",
777
+ /** --- Authe --- */
778
+ authenticate: {
779
+ path: "/aegis.auth.v1.AuthService/Authenticate",
607
780
  requestStream: false,
608
781
  responseStream: false,
609
- requestSerialize: (value) => Buffer.from(ValidateAccessRequest.encode(value).finish()),
610
- requestDeserialize: (value) => ValidateAccessRequest.decode(value),
611
- responseSerialize: (value) => Buffer.from(ValidateAccessResponse.encode(value).finish()),
612
- responseDeserialize: (value) => ValidateAccessResponse.decode(value),
782
+ requestSerialize: (value) => Buffer.from(InputAuthenticate.encode(value).finish()),
783
+ requestDeserialize: (value) => InputAuthenticate.decode(value),
784
+ responseSerialize: (value) => Buffer.from(DtoAuthenticate.encode(value).finish()),
785
+ responseDeserialize: (value) => DtoAuthenticate.decode(value),
613
786
  },
614
787
  authorize: {
615
788
  path: "/aegis.auth.v1.AuthService/Authorize",
616
789
  requestStream: false,
617
790
  responseStream: false,
618
- requestSerialize: (value) => Buffer.from(AuthorizeRequest.encode(value).finish()),
619
- requestDeserialize: (value) => AuthorizeRequest.decode(value),
620
- responseSerialize: (value) => Buffer.from(AuthorizeResponse.encode(value).finish()),
621
- responseDeserialize: (value) => AuthorizeResponse.decode(value),
791
+ requestSerialize: (value) => Buffer.from(InputAuthorize.encode(value).finish()),
792
+ requestDeserialize: (value) => InputAuthorize.decode(value),
793
+ responseSerialize: (value) => Buffer.from(DtoAuthorize.encode(value).finish()),
794
+ responseDeserialize: (value) => DtoAuthorize.decode(value),
622
795
  },
623
796
  /** --- Permission --- */
624
797
  permissionsSeed: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acequants/aegis-contracts",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,34 +15,55 @@ message DtoPagination {
15
15
  }
16
16
 
17
17
  // ---- AUTH ----
18
- message AuthContext {
19
- string session_public_id = 1;
20
- string user_public_id = 2;
21
- string email = 3;
22
- optional string display_name = 4;
18
+ message DtoRole {
19
+ string public_id = 1;
20
+ string name = 2;
23
21
  }
24
22
 
25
- message ValidateAccessRequest {
26
- string access_token = 1;
27
- string user_agent = 2;
28
- string ip = 3;
23
+ message DtoUserRoles {
24
+ DtoRole role = 1;
29
25
  }
30
26
 
31
- message ValidateAccessResponse {
32
- optional bool valid = 1;
33
- optional string reason = 2;
34
- optional AuthContext context = 3;
27
+ message DtoUser {
28
+ string public_id = 1;
29
+ string email = 2;
30
+ string phone = 3;
31
+ optional string display_name = 4;
32
+ repeated DtoUserRoles roles = 5;
33
+ }
34
+
35
+ message DtoService {
36
+ string publicId = 1;
37
+ string namespace = 2;
35
38
  }
36
39
 
37
- message AuthorizeRequest {
38
- AuthContext context = 1;
40
+ message DtoSession {
41
+ string public_id = 1;
42
+ DtoService service = 2;
43
+ DtoUser user = 3;
39
44
  }
40
45
 
41
- message AuthorizeResponse {
46
+ message DtoAuthenticate {
47
+ optional bool valid = 1;
48
+ optional string reason = 2;
49
+ optional DtoSession context = 3;
50
+ }
51
+
52
+ message DtoAuthorize {
42
53
  bool allowed = 1;
43
54
  string reason = 2;
44
55
  }
45
56
 
57
+ message InputAuthenticate {
58
+ string access_token = 1;
59
+ string user_agent = 2;
60
+ string ip = 3;
61
+ }
62
+
63
+ message InputAuthorize {
64
+ DtoSession context = 1;
65
+ }
66
+
46
67
  // ---- PERMISSION ----
47
68
 
48
69
  message InputPermission {
@@ -50,8 +71,8 @@ message InputPermission {
50
71
  }
51
72
 
52
73
  message InputPermissions {
53
- int32 page = 1;
54
- int32 page_size = 2;
74
+ optional int32 page = 1;
75
+ optional int32 page_size = 2;
55
76
  optional string search = 3;
56
77
  optional string sort_by = 4;
57
78
  optional string sort_order = 5;
@@ -84,9 +105,9 @@ message DtoPermissionsPaginated {
84
105
  }
85
106
 
86
107
  service AuthService {
87
- // --- Authentication ---
88
- rpc ValidateAccess (ValidateAccessRequest) returns (ValidateAccessResponse);
89
- rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
108
+ // --- Authe ---
109
+ rpc Authenticate (InputAuthenticate) returns (DtoAuthenticate);
110
+ rpc Authorize (InputAuthorize) returns (DtoAuthorize);
90
111
 
91
112
  // --- Permission ---
92
113
  rpc PermissionsSeed (InputSeedPermissions) returns (DtoPermissions);