@acequants/aegis-contracts 0.1.1 → 0.1.2
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.
|
@@ -3,17 +3,15 @@ import _m0 from "protobufjs/minimal";
|
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
export declare const protobufPackage = "aegis.auth.v1";
|
|
5
5
|
export interface AuthContext {
|
|
6
|
-
sessionId: string;
|
|
7
6
|
userId: string;
|
|
8
7
|
email: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
permissions: string[];
|
|
8
|
+
sessionId: string;
|
|
9
|
+
displayName: string;
|
|
12
10
|
}
|
|
13
11
|
export interface ValidateAccessRequest {
|
|
14
|
-
accessToken: string;
|
|
15
12
|
ip: string;
|
|
16
13
|
userAgent: string;
|
|
14
|
+
accessToken: string;
|
|
17
15
|
}
|
|
18
16
|
export interface ValidateAccessResponse {
|
|
19
17
|
valid: boolean;
|
|
@@ -23,16 +21,6 @@ export interface ValidateAccessResponse {
|
|
|
23
21
|
}
|
|
24
22
|
export interface AuthorizeRequest {
|
|
25
23
|
context?: AuthContext | undefined;
|
|
26
|
-
/** e.g. "order.read" */
|
|
27
|
-
policy: string;
|
|
28
|
-
/** resource/user attributes for ABAC */
|
|
29
|
-
attributes: {
|
|
30
|
-
[key: string]: string;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface AuthorizeRequest_AttributesEntry {
|
|
34
|
-
key: string;
|
|
35
|
-
value: string;
|
|
36
24
|
}
|
|
37
25
|
export interface AuthorizeResponse {
|
|
38
26
|
allowed: boolean;
|
|
@@ -55,10 +43,6 @@ export declare const AuthorizeRequest: {
|
|
|
55
43
|
encode(message: AuthorizeRequest, writer?: _m0.Writer): _m0.Writer;
|
|
56
44
|
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest;
|
|
57
45
|
};
|
|
58
|
-
export declare const AuthorizeRequest_AttributesEntry: {
|
|
59
|
-
encode(message: AuthorizeRequest_AttributesEntry, writer?: _m0.Writer): _m0.Writer;
|
|
60
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest_AttributesEntry;
|
|
61
|
-
};
|
|
62
46
|
export declare const AuthorizeResponse: {
|
|
63
47
|
encode(message: AuthorizeResponse, writer?: _m0.Writer): _m0.Writer;
|
|
64
48
|
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeResponse;
|
|
@@ -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,WAAW;IAC1B,
|
|
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,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,iCAAiC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,CAAC,CAAC;IAEnF,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CACZ,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,GAAG,UAAU,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IAEjG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;CACtH;AAED,wBAAgB,4BAA4B,KACzB,aAAa,QAAQ,UAYvC;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAC3D,eAAO,MAAM,kBAAkB;;;;;2CAKD,qBAAqB;6CACnB,MAAM;4CACP,sBAAsB;8CACpB,MAAM;;;;;;2CAMT,gBAAgB;6CACd,MAAM;4CACP,iBAAiB;8CACf,MAAM;;CAE7B,CAAC;AAEX,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;IACrE,cAAc,EAAE,eAAe,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;IAC/E,SAAS,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;CACjE"}
|
|
@@ -8,24 +8,21 @@ import _m0 from "protobufjs/minimal";
|
|
|
8
8
|
export const protobufPackage = "aegis.auth.v1";
|
|
9
9
|
export const AEGIS_AUTH_V1_PACKAGE_NAME = "aegis.auth.v1";
|
|
10
10
|
function createBaseAuthContext() {
|
|
11
|
-
return {
|
|
11
|
+
return { userId: "", email: "", sessionId: "", displayName: "" };
|
|
12
12
|
}
|
|
13
13
|
export const AuthContext = {
|
|
14
14
|
encode(message, writer = _m0.Writer.create()) {
|
|
15
|
-
if (message.sessionId !== "") {
|
|
16
|
-
writer.uint32(10).string(message.sessionId);
|
|
17
|
-
}
|
|
18
15
|
if (message.userId !== "") {
|
|
19
|
-
writer.uint32(
|
|
16
|
+
writer.uint32(10).string(message.userId);
|
|
20
17
|
}
|
|
21
18
|
if (message.email !== "") {
|
|
22
|
-
writer.uint32(
|
|
19
|
+
writer.uint32(18).string(message.email);
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
writer.uint32(
|
|
21
|
+
if (message.sessionId !== "") {
|
|
22
|
+
writer.uint32(26).string(message.sessionId);
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
writer.uint32(
|
|
24
|
+
if (message.displayName !== "") {
|
|
25
|
+
writer.uint32(34).string(message.displayName);
|
|
29
26
|
}
|
|
30
27
|
return writer;
|
|
31
28
|
},
|
|
@@ -40,31 +37,25 @@ export const AuthContext = {
|
|
|
40
37
|
if (tag !== 10) {
|
|
41
38
|
break;
|
|
42
39
|
}
|
|
43
|
-
message.
|
|
40
|
+
message.userId = reader.string();
|
|
44
41
|
continue;
|
|
45
42
|
case 2:
|
|
46
43
|
if (tag !== 18) {
|
|
47
44
|
break;
|
|
48
45
|
}
|
|
49
|
-
message.
|
|
46
|
+
message.email = reader.string();
|
|
50
47
|
continue;
|
|
51
48
|
case 3:
|
|
52
49
|
if (tag !== 26) {
|
|
53
50
|
break;
|
|
54
51
|
}
|
|
55
|
-
message.
|
|
52
|
+
message.sessionId = reader.string();
|
|
56
53
|
continue;
|
|
57
54
|
case 4:
|
|
58
55
|
if (tag !== 34) {
|
|
59
56
|
break;
|
|
60
57
|
}
|
|
61
|
-
message.
|
|
62
|
-
continue;
|
|
63
|
-
case 5:
|
|
64
|
-
if (tag !== 42) {
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
message.permissions.push(reader.string());
|
|
58
|
+
message.displayName = reader.string();
|
|
68
59
|
continue;
|
|
69
60
|
}
|
|
70
61
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -76,18 +67,18 @@ export const AuthContext = {
|
|
|
76
67
|
},
|
|
77
68
|
};
|
|
78
69
|
function createBaseValidateAccessRequest() {
|
|
79
|
-
return {
|
|
70
|
+
return { ip: "", userAgent: "", accessToken: "" };
|
|
80
71
|
}
|
|
81
72
|
export const ValidateAccessRequest = {
|
|
82
73
|
encode(message, writer = _m0.Writer.create()) {
|
|
83
|
-
if (message.accessToken !== "") {
|
|
84
|
-
writer.uint32(10).string(message.accessToken);
|
|
85
|
-
}
|
|
86
74
|
if (message.ip !== "") {
|
|
87
|
-
writer.uint32(
|
|
75
|
+
writer.uint32(10).string(message.ip);
|
|
88
76
|
}
|
|
89
77
|
if (message.userAgent !== "") {
|
|
90
|
-
writer.uint32(
|
|
78
|
+
writer.uint32(18).string(message.userAgent);
|
|
79
|
+
}
|
|
80
|
+
if (message.accessToken !== "") {
|
|
81
|
+
writer.uint32(26).string(message.accessToken);
|
|
91
82
|
}
|
|
92
83
|
return writer;
|
|
93
84
|
},
|
|
@@ -102,19 +93,19 @@ export const ValidateAccessRequest = {
|
|
|
102
93
|
if (tag !== 10) {
|
|
103
94
|
break;
|
|
104
95
|
}
|
|
105
|
-
message.
|
|
96
|
+
message.ip = reader.string();
|
|
106
97
|
continue;
|
|
107
98
|
case 2:
|
|
108
99
|
if (tag !== 18) {
|
|
109
100
|
break;
|
|
110
101
|
}
|
|
111
|
-
message.
|
|
102
|
+
message.userAgent = reader.string();
|
|
112
103
|
continue;
|
|
113
104
|
case 3:
|
|
114
105
|
if (tag !== 26) {
|
|
115
106
|
break;
|
|
116
107
|
}
|
|
117
|
-
message.
|
|
108
|
+
message.accessToken = reader.string();
|
|
118
109
|
continue;
|
|
119
110
|
}
|
|
120
111
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -176,19 +167,13 @@ export const ValidateAccessResponse = {
|
|
|
176
167
|
},
|
|
177
168
|
};
|
|
178
169
|
function createBaseAuthorizeRequest() {
|
|
179
|
-
return {
|
|
170
|
+
return {};
|
|
180
171
|
}
|
|
181
172
|
export const AuthorizeRequest = {
|
|
182
173
|
encode(message, writer = _m0.Writer.create()) {
|
|
183
174
|
if (message.context !== undefined) {
|
|
184
175
|
AuthContext.encode(message.context, writer.uint32(10).fork()).ldelim();
|
|
185
176
|
}
|
|
186
|
-
if (message.policy !== "") {
|
|
187
|
-
writer.uint32(18).string(message.policy);
|
|
188
|
-
}
|
|
189
|
-
Object.entries(message.attributes).forEach(([key, value]) => {
|
|
190
|
-
AuthorizeRequest_AttributesEntry.encode({ key: key, value }, writer.uint32(26).fork()).ldelim();
|
|
191
|
-
});
|
|
192
177
|
return writer;
|
|
193
178
|
},
|
|
194
179
|
decode(input, length) {
|
|
@@ -204,62 +189,6 @@ export const AuthorizeRequest = {
|
|
|
204
189
|
}
|
|
205
190
|
message.context = AuthContext.decode(reader, reader.uint32());
|
|
206
191
|
continue;
|
|
207
|
-
case 2:
|
|
208
|
-
if (tag !== 18) {
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
message.policy = reader.string();
|
|
212
|
-
continue;
|
|
213
|
-
case 3:
|
|
214
|
-
if (tag !== 26) {
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
const entry3 = AuthorizeRequest_AttributesEntry.decode(reader, reader.uint32());
|
|
218
|
-
if (entry3.value !== undefined) {
|
|
219
|
-
message.attributes[entry3.key] = entry3.value;
|
|
220
|
-
}
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
reader.skipType(tag & 7);
|
|
227
|
-
}
|
|
228
|
-
return message;
|
|
229
|
-
},
|
|
230
|
-
};
|
|
231
|
-
function createBaseAuthorizeRequest_AttributesEntry() {
|
|
232
|
-
return { key: "", value: "" };
|
|
233
|
-
}
|
|
234
|
-
export const AuthorizeRequest_AttributesEntry = {
|
|
235
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
236
|
-
if (message.key !== "") {
|
|
237
|
-
writer.uint32(10).string(message.key);
|
|
238
|
-
}
|
|
239
|
-
if (message.value !== "") {
|
|
240
|
-
writer.uint32(18).string(message.value);
|
|
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_AttributesEntry();
|
|
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.key = reader.string();
|
|
256
|
-
continue;
|
|
257
|
-
case 2:
|
|
258
|
-
if (tag !== 18) {
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
message.value = reader.string();
|
|
262
|
-
continue;
|
|
263
192
|
}
|
|
264
193
|
if ((tag & 7) === 4 || tag === 0) {
|
|
265
194
|
break;
|
package/package.json
CHANGED
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -10,18 +10,16 @@ service AuthService {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
message AuthContext {
|
|
13
|
-
string
|
|
14
|
-
string
|
|
15
|
-
string
|
|
16
|
-
|
|
17
|
-
repeated string roles = 4;
|
|
18
|
-
repeated string permissions = 5;
|
|
13
|
+
string user_id = 1;
|
|
14
|
+
string email = 2;
|
|
15
|
+
string session_id = 3;
|
|
16
|
+
string display_name = 4;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
message ValidateAccessRequest {
|
|
22
|
-
string
|
|
23
|
-
string
|
|
24
|
-
string
|
|
20
|
+
string ip = 1;
|
|
21
|
+
string user_agent = 2;
|
|
22
|
+
string access_token = 3;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
message ValidateAccessResponse {
|
|
@@ -32,8 +30,6 @@ message ValidateAccessResponse {
|
|
|
32
30
|
|
|
33
31
|
message AuthorizeRequest {
|
|
34
32
|
AuthContext context = 1;
|
|
35
|
-
string policy = 2; // e.g. "order.read"
|
|
36
|
-
map<string, string> attributes = 3; // resource/user attributes for ABAC
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
message AuthorizeResponse {
|