@lansweeper/permissions-grpc 0.0.1 → 0.0.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.
- package/CHANGELOG.md +8 -0
- package/buf.yaml +0 -1
- package/gen-proto/image.json +1 -1
- package/gen-proto/permissions_pb.d.ts +35 -35
- package/gen-proto/permissions_pb.js +64 -64
- package/package.json +2 -2
- package/proto/permissions.proto +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.0.2](https://github.com/Lansweeper/lansweeperapis/compare/@lansweeper/permissions-grpc@0.0.1...@lansweeper/permissions-grpc@0.0.2) (2021-08-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @lansweeper/permissions-grpc
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 0.0.1 (2021-06-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @lansweeper/permissions-grpc
|
package/buf.yaml
CHANGED
package/gen-proto/image.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":[{"name":"permissions.proto","package":"checkpermission","messageType":[{"name":"CheckPermissionRequest","field":[{"name":"
|
|
1
|
+
{"file":[{"name":"permissions.proto","package":"checkpermission","messageType":[{"name":"CheckPermissionRequest","field":[{"name":"site_id","number":1,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"siteId"},{"name":"account_id","number":2,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"accountId"},{"name":"action","number":3,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"action"},{"name":"trace_id","number":4,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"traceId"}]},{"name":"CheckPermissionResponse","field":[{"name":"granted","number":1,"label":"LABEL_OPTIONAL","type":"TYPE_BOOL","jsonName":"granted"},{"name":"installations","number":2,"label":"LABEL_REPEATED","type":"TYPE_STRING","jsonName":"installations"},{"name":"asset_scopes","number":3,"label":"LABEL_REPEATED","type":"TYPE_STRING","jsonName":"assetScopes"},{"name":"derived_permissions","number":4,"label":"LABEL_REPEATED","type":"TYPE_STRING","jsonName":"derivedPermissions"}]},{"name":"GetUserPermissionsRequest","field":[{"name":"user_id","number":1,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"userId"},{"name":"site_id","number":2,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"siteId"},{"name":"trace_id","number":3,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","oneofIndex":0,"jsonName":"traceId","proto3Optional":true}],"oneofDecl":[{"name":"_trace_id"}]},{"name":"GetUserPermissionsResponse","field":[{"name":"permissions","number":1,"label":"LABEL_REPEATED","type":"TYPE_MESSAGE","typeName":".checkpermission.GetUserPermissionsResponse.PermissionsEntry","jsonName":"permissions"}],"nestedType":[{"name":"Permissions","field":[{"name":"installations","number":1,"label":"LABEL_REPEATED","type":"TYPE_STRING","jsonName":"installations"},{"name":"asset_scopes","number":2,"label":"LABEL_REPEATED","type":"TYPE_STRING","jsonName":"assetScopes"}]},{"name":"PermissionsEntry","field":[{"name":"key","number":1,"label":"LABEL_OPTIONAL","type":"TYPE_STRING","jsonName":"key"},{"name":"value","number":2,"label":"LABEL_OPTIONAL","type":"TYPE_MESSAGE","typeName":".checkpermission.GetUserPermissionsResponse.Permissions","jsonName":"value"}],"options":{"mapEntry":true}}]}],"service":[{"name":"CheckPermissionService","method":[{"name":"CheckPermission","inputType":".checkpermission.CheckPermissionRequest","outputType":".checkpermission.CheckPermissionResponse","options":{}},{"name":"GetUserPermissions","inputType":".checkpermission.GetUserPermissionsRequest","outputType":".checkpermission.GetUserPermissionsResponse","options":{}}]}],"sourceCodeInfo":{"location":[{"span":[0,0,36,1]},{"path":[12],"span":[0,0,18]},{"path":[2],"span":[2,0,24]},{"path":[4,0],"span":[4,0,9,1]},{"path":[4,0,1],"span":[4,8,30]},{"path":[4,0,2,0],"span":[5,2,21]},{"path":[4,0,2,0,5],"span":[5,2,8]},{"path":[4,0,2,0,1],"span":[5,9,16]},{"path":[4,0,2,0,3],"span":[5,19,20]},{"path":[4,0,2,1],"span":[6,2,24]},{"path":[4,0,2,1,5],"span":[6,2,8]},{"path":[4,0,2,1,1],"span":[6,9,19]},{"path":[4,0,2,1,3],"span":[6,22,23]},{"path":[4,0,2,2],"span":[7,2,20]},{"path":[4,0,2,2,5],"span":[7,2,8]},{"path":[4,0,2,2,1],"span":[7,9,15]},{"path":[4,0,2,2,3],"span":[7,18,19]},{"path":[4,0,2,3],"span":[8,2,22]},{"path":[4,0,2,3,5],"span":[8,2,8]},{"path":[4,0,2,3,1],"span":[8,9,17]},{"path":[4,0,2,3,3],"span":[8,20,21]},{"path":[4,1],"span":[11,0,16,1]},{"path":[4,1,1],"span":[11,8,31]},{"path":[4,1,2,0],"span":[12,2,19]},{"path":[4,1,2,0,5],"span":[12,2,6]},{"path":[4,1,2,0,1],"span":[12,7,14]},{"path":[4,1,2,0,3],"span":[12,17,18]},{"path":[4,1,2,1],"span":[13,2,36]},{"path":[4,1,2,1,4],"span":[13,2,10]},{"path":[4,1,2,1,5],"span":[13,11,17]},{"path":[4,1,2,1,1],"span":[13,18,31]},{"path":[4,1,2,1,3],"span":[13,34,35]},{"path":[4,1,2,2],"span":[14,2,35]},{"path":[4,1,2,2,4],"span":[14,2,10]},{"path":[4,1,2,2,5],"span":[14,11,17]},{"path":[4,1,2,2,1],"span":[14,18,30]},{"path":[4,1,2,2,3],"span":[14,33,34]},{"path":[4,1,2,3],"span":[15,2,42]},{"path":[4,1,2,3,4],"span":[15,2,10]},{"path":[4,1,2,3,5],"span":[15,11,17]},{"path":[4,1,2,3,1],"span":[15,18,37]},{"path":[4,1,2,3,3],"span":[15,40,41]},{"path":[4,2],"span":[18,0,22,1]},{"path":[4,2,1],"span":[18,8,33]},{"path":[4,2,2,0],"span":[19,2,21]},{"path":[4,2,2,0,5],"span":[19,2,8]},{"path":[4,2,2,0,1],"span":[19,9,16]},{"path":[4,2,2,0,3],"span":[19,19,20]},{"path":[4,2,2,1],"span":[20,2,21]},{"path":[4,2,2,1,5],"span":[20,2,8]},{"path":[4,2,2,1,1],"span":[20,9,16]},{"path":[4,2,2,1,3],"span":[20,19,20]},{"path":[4,2,2,2],"span":[21,2,31]},{"path":[4,2,2,2,4],"span":[21,2,10]},{"path":[4,2,2,2,5],"span":[21,11,17]},{"path":[4,2,2,2,1],"span":[21,18,26]},{"path":[4,2,2,2,3],"span":[21,29,30]},{"path":[4,3],"span":[24,0,30,1]},{"path":[4,3,1],"span":[24,8,34]},{"path":[4,3,3,0],"span":[25,2,28,3]},{"path":[4,3,3,0,1],"span":[25,10,21]},{"path":[4,3,3,0,2,0],"span":[26,4,38]},{"path":[4,3,3,0,2,0,4],"span":[26,4,12]},{"path":[4,3,3,0,2,0,5],"span":[26,13,19]},{"path":[4,3,3,0,2,0,1],"span":[26,20,33]},{"path":[4,3,3,0,2,0,3],"span":[26,36,37]},{"path":[4,3,3,0,2,1],"span":[27,4,37]},{"path":[4,3,3,0,2,1,4],"span":[27,4,12]},{"path":[4,3,3,0,2,1,5],"span":[27,13,19]},{"path":[4,3,3,0,2,1,1],"span":[27,20,32]},{"path":[4,3,3,0,2,1,3],"span":[27,35,36]},{"path":[4,3,2,0],"span":[29,2,43]},{"path":[4,3,2,0,6],"span":[29,2,26]},{"path":[4,3,2,0,1],"span":[29,27,38]},{"path":[4,3,2,0,3],"span":[29,41,42]},{"path":[6,0],"span":[33,0,36,1]},{"path":[6,0,1],"span":[33,8,30]},{"path":[6,0,2,0],"span":[34,2,83]},{"path":[6,0,2,0,1],"span":[34,6,21]},{"path":[6,0,2,0,2],"span":[34,23,45]},{"path":[6,0,2,0,3],"span":[34,56,79]},{"path":[6,0,2,1],"span":[35,2,92]},{"path":[6,0,2,1,1],"span":[35,6,24]},{"path":[6,0,2,1,2],"span":[35,26,51]},{"path":[6,0,2,1,3],"span":[35,62,88]}]},"syntax":"proto3"}],"bufbuildImageExtension":{}}
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
import * as jspb from "google-protobuf";
|
|
8
8
|
|
|
9
9
|
export class CheckPermissionRequest extends jspb.Message {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
getSiteId(): string;
|
|
11
|
+
setSiteId(value: string): CheckPermissionRequest;
|
|
12
|
+
getAccountId(): string;
|
|
13
|
+
setAccountId(value: string): CheckPermissionRequest;
|
|
14
14
|
getAction(): string;
|
|
15
15
|
setAction(value: string): CheckPermissionRequest;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
getTraceId(): string;
|
|
17
|
+
setTraceId(value: string): CheckPermissionRequest;
|
|
18
18
|
|
|
19
19
|
serializeBinary(): Uint8Array;
|
|
20
20
|
toObject(includeInstance?: boolean): CheckPermissionRequest.AsObject;
|
|
@@ -28,10 +28,10 @@ export class CheckPermissionRequest extends jspb.Message {
|
|
|
28
28
|
|
|
29
29
|
export namespace CheckPermissionRequest {
|
|
30
30
|
export type AsObject = {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
siteId: string,
|
|
32
|
+
accountId: string,
|
|
33
33
|
action: string,
|
|
34
|
-
|
|
34
|
+
traceId: string,
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -42,14 +42,14 @@ export class CheckPermissionResponse extends jspb.Message {
|
|
|
42
42
|
getInstallationsList(): Array<string>;
|
|
43
43
|
setInstallationsList(value: Array<string>): CheckPermissionResponse;
|
|
44
44
|
addInstallations(value: string, index?: number): string;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
clearAssetScopesList(): void;
|
|
46
|
+
getAssetScopesList(): Array<string>;
|
|
47
|
+
setAssetScopesList(value: Array<string>): CheckPermissionResponse;
|
|
48
|
+
addAssetScopes(value: string, index?: number): string;
|
|
49
|
+
clearDerivedPermissionsList(): void;
|
|
50
|
+
getDerivedPermissionsList(): Array<string>;
|
|
51
|
+
setDerivedPermissionsList(value: Array<string>): CheckPermissionResponse;
|
|
52
|
+
addDerivedPermissions(value: string, index?: number): string;
|
|
53
53
|
|
|
54
54
|
serializeBinary(): Uint8Array;
|
|
55
55
|
toObject(includeInstance?: boolean): CheckPermissionResponse.AsObject;
|
|
@@ -65,21 +65,21 @@ export namespace CheckPermissionResponse {
|
|
|
65
65
|
export type AsObject = {
|
|
66
66
|
granted: boolean,
|
|
67
67
|
installationsList: Array<string>,
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
assetScopesList: Array<string>,
|
|
69
|
+
derivedPermissionsList: Array<string>,
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export class GetUserPermissionsRequest extends jspb.Message {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
getUserId(): string;
|
|
75
|
+
setUserId(value: string): GetUserPermissionsRequest;
|
|
76
|
+
getSiteId(): string;
|
|
77
|
+
setSiteId(value: string): GetUserPermissionsRequest;
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
hasTraceId(): boolean;
|
|
80
|
+
clearTraceId(): void;
|
|
81
|
+
getTraceId(): string | undefined;
|
|
82
|
+
setTraceId(value: string): GetUserPermissionsRequest;
|
|
83
83
|
|
|
84
84
|
serializeBinary(): Uint8Array;
|
|
85
85
|
toObject(includeInstance?: boolean): GetUserPermissionsRequest.AsObject;
|
|
@@ -93,9 +93,9 @@ export class GetUserPermissionsRequest extends jspb.Message {
|
|
|
93
93
|
|
|
94
94
|
export namespace GetUserPermissionsRequest {
|
|
95
95
|
export type AsObject = {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
userId: string,
|
|
97
|
+
siteId: string,
|
|
98
|
+
traceId?: string,
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -126,10 +126,10 @@ export namespace GetUserPermissionsResponse {
|
|
|
126
126
|
getInstallationsList(): Array<string>;
|
|
127
127
|
setInstallationsList(value: Array<string>): Permissions;
|
|
128
128
|
addInstallations(value: string, index?: number): string;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
clearAssetScopesList(): void;
|
|
130
|
+
getAssetScopesList(): Array<string>;
|
|
131
|
+
setAssetScopesList(value: Array<string>): Permissions;
|
|
132
|
+
addAssetScopes(value: string, index?: number): string;
|
|
133
133
|
|
|
134
134
|
serializeBinary(): Uint8Array;
|
|
135
135
|
toObject(includeInstance?: boolean): Permissions.AsObject;
|
|
@@ -144,7 +144,7 @@ export namespace GetUserPermissionsResponse {
|
|
|
144
144
|
export namespace Permissions {
|
|
145
145
|
export type AsObject = {
|
|
146
146
|
installationsList: Array<string>,
|
|
147
|
-
|
|
147
|
+
assetScopesList: Array<string>,
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -157,10 +157,10 @@ proto.checkpermission.CheckPermissionRequest.prototype.toObject = function(opt_i
|
|
|
157
157
|
*/
|
|
158
158
|
proto.checkpermission.CheckPermissionRequest.toObject = function(includeInstance, msg) {
|
|
159
159
|
var f, obj = {
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
siteId: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
161
|
+
accountId: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
162
162
|
action: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
163
|
-
|
|
163
|
+
traceId: jspb.Message.getFieldWithDefault(msg, 4, "")
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
if (includeInstance) {
|
|
@@ -199,11 +199,11 @@ proto.checkpermission.CheckPermissionRequest.deserializeBinaryFromReader = funct
|
|
|
199
199
|
switch (field) {
|
|
200
200
|
case 1:
|
|
201
201
|
var value = /** @type {string} */ (reader.readString());
|
|
202
|
-
msg.
|
|
202
|
+
msg.setSiteId(value);
|
|
203
203
|
break;
|
|
204
204
|
case 2:
|
|
205
205
|
var value = /** @type {string} */ (reader.readString());
|
|
206
|
-
msg.
|
|
206
|
+
msg.setAccountId(value);
|
|
207
207
|
break;
|
|
208
208
|
case 3:
|
|
209
209
|
var value = /** @type {string} */ (reader.readString());
|
|
@@ -211,7 +211,7 @@ proto.checkpermission.CheckPermissionRequest.deserializeBinaryFromReader = funct
|
|
|
211
211
|
break;
|
|
212
212
|
case 4:
|
|
213
213
|
var value = /** @type {string} */ (reader.readString());
|
|
214
|
-
msg.
|
|
214
|
+
msg.setTraceId(value);
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
217
|
reader.skipField();
|
|
@@ -242,14 +242,14 @@ proto.checkpermission.CheckPermissionRequest.prototype.serializeBinary = functio
|
|
|
242
242
|
*/
|
|
243
243
|
proto.checkpermission.CheckPermissionRequest.serializeBinaryToWriter = function(message, writer) {
|
|
244
244
|
var f = undefined;
|
|
245
|
-
f = message.
|
|
245
|
+
f = message.getSiteId();
|
|
246
246
|
if (f.length > 0) {
|
|
247
247
|
writer.writeString(
|
|
248
248
|
1,
|
|
249
249
|
f
|
|
250
250
|
);
|
|
251
251
|
}
|
|
252
|
-
f = message.
|
|
252
|
+
f = message.getAccountId();
|
|
253
253
|
if (f.length > 0) {
|
|
254
254
|
writer.writeString(
|
|
255
255
|
2,
|
|
@@ -263,7 +263,7 @@ proto.checkpermission.CheckPermissionRequest.serializeBinaryToWriter = function(
|
|
|
263
263
|
f
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
|
-
f = message.
|
|
266
|
+
f = message.getTraceId();
|
|
267
267
|
if (f.length > 0) {
|
|
268
268
|
writer.writeString(
|
|
269
269
|
4,
|
|
@@ -274,10 +274,10 @@ proto.checkpermission.CheckPermissionRequest.serializeBinaryToWriter = function(
|
|
|
274
274
|
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
|
-
* optional string
|
|
277
|
+
* optional string site_id = 1;
|
|
278
278
|
* @return {string}
|
|
279
279
|
*/
|
|
280
|
-
proto.checkpermission.CheckPermissionRequest.prototype.
|
|
280
|
+
proto.checkpermission.CheckPermissionRequest.prototype.getSiteId = function() {
|
|
281
281
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
282
282
|
};
|
|
283
283
|
|
|
@@ -286,16 +286,16 @@ proto.checkpermission.CheckPermissionRequest.prototype.getSiteid = function() {
|
|
|
286
286
|
* @param {string} value
|
|
287
287
|
* @return {!proto.checkpermission.CheckPermissionRequest} returns this
|
|
288
288
|
*/
|
|
289
|
-
proto.checkpermission.CheckPermissionRequest.prototype.
|
|
289
|
+
proto.checkpermission.CheckPermissionRequest.prototype.setSiteId = function(value) {
|
|
290
290
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
291
291
|
};
|
|
292
292
|
|
|
293
293
|
|
|
294
294
|
/**
|
|
295
|
-
* optional string
|
|
295
|
+
* optional string account_id = 2;
|
|
296
296
|
* @return {string}
|
|
297
297
|
*/
|
|
298
|
-
proto.checkpermission.CheckPermissionRequest.prototype.
|
|
298
|
+
proto.checkpermission.CheckPermissionRequest.prototype.getAccountId = function() {
|
|
299
299
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
300
300
|
};
|
|
301
301
|
|
|
@@ -304,7 +304,7 @@ proto.checkpermission.CheckPermissionRequest.prototype.getAccountid = function()
|
|
|
304
304
|
* @param {string} value
|
|
305
305
|
* @return {!proto.checkpermission.CheckPermissionRequest} returns this
|
|
306
306
|
*/
|
|
307
|
-
proto.checkpermission.CheckPermissionRequest.prototype.
|
|
307
|
+
proto.checkpermission.CheckPermissionRequest.prototype.setAccountId = function(value) {
|
|
308
308
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
309
309
|
};
|
|
310
310
|
|
|
@@ -328,10 +328,10 @@ proto.checkpermission.CheckPermissionRequest.prototype.setAction = function(valu
|
|
|
328
328
|
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
|
-
* optional string
|
|
331
|
+
* optional string trace_id = 4;
|
|
332
332
|
* @return {string}
|
|
333
333
|
*/
|
|
334
|
-
proto.checkpermission.CheckPermissionRequest.prototype.
|
|
334
|
+
proto.checkpermission.CheckPermissionRequest.prototype.getTraceId = function() {
|
|
335
335
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
336
336
|
};
|
|
337
337
|
|
|
@@ -340,7 +340,7 @@ proto.checkpermission.CheckPermissionRequest.prototype.getTraceid = function() {
|
|
|
340
340
|
* @param {string} value
|
|
341
341
|
* @return {!proto.checkpermission.CheckPermissionRequest} returns this
|
|
342
342
|
*/
|
|
343
|
-
proto.checkpermission.CheckPermissionRequest.prototype.
|
|
343
|
+
proto.checkpermission.CheckPermissionRequest.prototype.setTraceId = function(value) {
|
|
344
344
|
return jspb.Message.setProto3StringField(this, 4, value);
|
|
345
345
|
};
|
|
346
346
|
|
|
@@ -386,8 +386,8 @@ proto.checkpermission.CheckPermissionResponse.toObject = function(includeInstanc
|
|
|
386
386
|
var f, obj = {
|
|
387
387
|
granted: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
|
|
388
388
|
installationsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f,
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
assetScopesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
|
|
390
|
+
derivedPermissionsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f
|
|
391
391
|
};
|
|
392
392
|
|
|
393
393
|
if (includeInstance) {
|
|
@@ -434,11 +434,11 @@ proto.checkpermission.CheckPermissionResponse.deserializeBinaryFromReader = func
|
|
|
434
434
|
break;
|
|
435
435
|
case 3:
|
|
436
436
|
var value = /** @type {string} */ (reader.readString());
|
|
437
|
-
msg.
|
|
437
|
+
msg.addAssetScopes(value);
|
|
438
438
|
break;
|
|
439
439
|
case 4:
|
|
440
440
|
var value = /** @type {string} */ (reader.readString());
|
|
441
|
-
msg.
|
|
441
|
+
msg.addDerivedPermissions(value);
|
|
442
442
|
break;
|
|
443
443
|
default:
|
|
444
444
|
reader.skipField();
|
|
@@ -483,14 +483,14 @@ proto.checkpermission.CheckPermissionResponse.serializeBinaryToWriter = function
|
|
|
483
483
|
f
|
|
484
484
|
);
|
|
485
485
|
}
|
|
486
|
-
f = message.
|
|
486
|
+
f = message.getAssetScopesList();
|
|
487
487
|
if (f.length > 0) {
|
|
488
488
|
writer.writeRepeatedString(
|
|
489
489
|
3,
|
|
490
490
|
f
|
|
491
491
|
);
|
|
492
492
|
}
|
|
493
|
-
f = message.
|
|
493
|
+
f = message.getDerivedPermissionsList();
|
|
494
494
|
if (f.length > 0) {
|
|
495
495
|
writer.writeRepeatedString(
|
|
496
496
|
4,
|
|
@@ -556,10 +556,10 @@ proto.checkpermission.CheckPermissionResponse.prototype.clearInstallationsList =
|
|
|
556
556
|
|
|
557
557
|
|
|
558
558
|
/**
|
|
559
|
-
* repeated string
|
|
559
|
+
* repeated string asset_scopes = 3;
|
|
560
560
|
* @return {!Array<string>}
|
|
561
561
|
*/
|
|
562
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
562
|
+
proto.checkpermission.CheckPermissionResponse.prototype.getAssetScopesList = function() {
|
|
563
563
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
|
|
564
564
|
};
|
|
565
565
|
|
|
@@ -568,7 +568,7 @@ proto.checkpermission.CheckPermissionResponse.prototype.getAssetscopesList = fun
|
|
|
568
568
|
* @param {!Array<string>} value
|
|
569
569
|
* @return {!proto.checkpermission.CheckPermissionResponse} returns this
|
|
570
570
|
*/
|
|
571
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
571
|
+
proto.checkpermission.CheckPermissionResponse.prototype.setAssetScopesList = function(value) {
|
|
572
572
|
return jspb.Message.setField(this, 3, value || []);
|
|
573
573
|
};
|
|
574
574
|
|
|
@@ -578,7 +578,7 @@ proto.checkpermission.CheckPermissionResponse.prototype.setAssetscopesList = fun
|
|
|
578
578
|
* @param {number=} opt_index
|
|
579
579
|
* @return {!proto.checkpermission.CheckPermissionResponse} returns this
|
|
580
580
|
*/
|
|
581
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
581
|
+
proto.checkpermission.CheckPermissionResponse.prototype.addAssetScopes = function(value, opt_index) {
|
|
582
582
|
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
|
583
583
|
};
|
|
584
584
|
|
|
@@ -587,16 +587,16 @@ proto.checkpermission.CheckPermissionResponse.prototype.addAssetscopes = functio
|
|
|
587
587
|
* Clears the list making it empty but non-null.
|
|
588
588
|
* @return {!proto.checkpermission.CheckPermissionResponse} returns this
|
|
589
589
|
*/
|
|
590
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
591
|
-
return this.
|
|
590
|
+
proto.checkpermission.CheckPermissionResponse.prototype.clearAssetScopesList = function() {
|
|
591
|
+
return this.setAssetScopesList([]);
|
|
592
592
|
};
|
|
593
593
|
|
|
594
594
|
|
|
595
595
|
/**
|
|
596
|
-
* repeated string
|
|
596
|
+
* repeated string derived_permissions = 4;
|
|
597
597
|
* @return {!Array<string>}
|
|
598
598
|
*/
|
|
599
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
599
|
+
proto.checkpermission.CheckPermissionResponse.prototype.getDerivedPermissionsList = function() {
|
|
600
600
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
|
|
601
601
|
};
|
|
602
602
|
|
|
@@ -605,7 +605,7 @@ proto.checkpermission.CheckPermissionResponse.prototype.getDerivedpermissionsLis
|
|
|
605
605
|
* @param {!Array<string>} value
|
|
606
606
|
* @return {!proto.checkpermission.CheckPermissionResponse} returns this
|
|
607
607
|
*/
|
|
608
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
608
|
+
proto.checkpermission.CheckPermissionResponse.prototype.setDerivedPermissionsList = function(value) {
|
|
609
609
|
return jspb.Message.setField(this, 4, value || []);
|
|
610
610
|
};
|
|
611
611
|
|
|
@@ -615,7 +615,7 @@ proto.checkpermission.CheckPermissionResponse.prototype.setDerivedpermissionsLis
|
|
|
615
615
|
* @param {number=} opt_index
|
|
616
616
|
* @return {!proto.checkpermission.CheckPermissionResponse} returns this
|
|
617
617
|
*/
|
|
618
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
618
|
+
proto.checkpermission.CheckPermissionResponse.prototype.addDerivedPermissions = function(value, opt_index) {
|
|
619
619
|
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
|
620
620
|
};
|
|
621
621
|
|
|
@@ -624,8 +624,8 @@ proto.checkpermission.CheckPermissionResponse.prototype.addDerivedpermissions =
|
|
|
624
624
|
* Clears the list making it empty but non-null.
|
|
625
625
|
* @return {!proto.checkpermission.CheckPermissionResponse} returns this
|
|
626
626
|
*/
|
|
627
|
-
proto.checkpermission.CheckPermissionResponse.prototype.
|
|
628
|
-
return this.
|
|
627
|
+
proto.checkpermission.CheckPermissionResponse.prototype.clearDerivedPermissionsList = function() {
|
|
628
|
+
return this.setDerivedPermissionsList([]);
|
|
629
629
|
};
|
|
630
630
|
|
|
631
631
|
|
|
@@ -661,9 +661,9 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.toObject = function(op
|
|
|
661
661
|
*/
|
|
662
662
|
proto.checkpermission.GetUserPermissionsRequest.toObject = function(includeInstance, msg) {
|
|
663
663
|
var f, obj = {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
userId: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
665
|
+
siteId: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
666
|
+
traceId: jspb.Message.getFieldWithDefault(msg, 3, "")
|
|
667
667
|
};
|
|
668
668
|
|
|
669
669
|
if (includeInstance) {
|
|
@@ -702,15 +702,15 @@ proto.checkpermission.GetUserPermissionsRequest.deserializeBinaryFromReader = fu
|
|
|
702
702
|
switch (field) {
|
|
703
703
|
case 1:
|
|
704
704
|
var value = /** @type {string} */ (reader.readString());
|
|
705
|
-
msg.
|
|
705
|
+
msg.setUserId(value);
|
|
706
706
|
break;
|
|
707
707
|
case 2:
|
|
708
708
|
var value = /** @type {string} */ (reader.readString());
|
|
709
|
-
msg.
|
|
709
|
+
msg.setSiteId(value);
|
|
710
710
|
break;
|
|
711
711
|
case 3:
|
|
712
712
|
var value = /** @type {string} */ (reader.readString());
|
|
713
|
-
msg.
|
|
713
|
+
msg.setTraceId(value);
|
|
714
714
|
break;
|
|
715
715
|
default:
|
|
716
716
|
reader.skipField();
|
|
@@ -741,14 +741,14 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.serializeBinary = func
|
|
|
741
741
|
*/
|
|
742
742
|
proto.checkpermission.GetUserPermissionsRequest.serializeBinaryToWriter = function(message, writer) {
|
|
743
743
|
var f = undefined;
|
|
744
|
-
f = message.
|
|
744
|
+
f = message.getUserId();
|
|
745
745
|
if (f.length > 0) {
|
|
746
746
|
writer.writeString(
|
|
747
747
|
1,
|
|
748
748
|
f
|
|
749
749
|
);
|
|
750
750
|
}
|
|
751
|
-
f = message.
|
|
751
|
+
f = message.getSiteId();
|
|
752
752
|
if (f.length > 0) {
|
|
753
753
|
writer.writeString(
|
|
754
754
|
2,
|
|
@@ -766,10 +766,10 @@ proto.checkpermission.GetUserPermissionsRequest.serializeBinaryToWriter = functi
|
|
|
766
766
|
|
|
767
767
|
|
|
768
768
|
/**
|
|
769
|
-
* optional string
|
|
769
|
+
* optional string user_id = 1;
|
|
770
770
|
* @return {string}
|
|
771
771
|
*/
|
|
772
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
772
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.getUserId = function() {
|
|
773
773
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
774
774
|
};
|
|
775
775
|
|
|
@@ -778,16 +778,16 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.getUserid = function()
|
|
|
778
778
|
* @param {string} value
|
|
779
779
|
* @return {!proto.checkpermission.GetUserPermissionsRequest} returns this
|
|
780
780
|
*/
|
|
781
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
781
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.setUserId = function(value) {
|
|
782
782
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
783
783
|
};
|
|
784
784
|
|
|
785
785
|
|
|
786
786
|
/**
|
|
787
|
-
* optional string
|
|
787
|
+
* optional string site_id = 2;
|
|
788
788
|
* @return {string}
|
|
789
789
|
*/
|
|
790
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
790
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.getSiteId = function() {
|
|
791
791
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
792
792
|
};
|
|
793
793
|
|
|
@@ -796,16 +796,16 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.getSiteid = function()
|
|
|
796
796
|
* @param {string} value
|
|
797
797
|
* @return {!proto.checkpermission.GetUserPermissionsRequest} returns this
|
|
798
798
|
*/
|
|
799
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
799
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.setSiteId = function(value) {
|
|
800
800
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
801
801
|
};
|
|
802
802
|
|
|
803
803
|
|
|
804
804
|
/**
|
|
805
|
-
* optional string
|
|
805
|
+
* optional string trace_id = 3;
|
|
806
806
|
* @return {string}
|
|
807
807
|
*/
|
|
808
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
808
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.getTraceId = function() {
|
|
809
809
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
810
810
|
};
|
|
811
811
|
|
|
@@ -814,7 +814,7 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.getTraceid = function(
|
|
|
814
814
|
* @param {string} value
|
|
815
815
|
* @return {!proto.checkpermission.GetUserPermissionsRequest} returns this
|
|
816
816
|
*/
|
|
817
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
817
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.setTraceId = function(value) {
|
|
818
818
|
return jspb.Message.setField(this, 3, value);
|
|
819
819
|
};
|
|
820
820
|
|
|
@@ -823,7 +823,7 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.setTraceid = function(
|
|
|
823
823
|
* Clears the field making it undefined.
|
|
824
824
|
* @return {!proto.checkpermission.GetUserPermissionsRequest} returns this
|
|
825
825
|
*/
|
|
826
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
826
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.clearTraceId = function() {
|
|
827
827
|
return jspb.Message.setField(this, 3, undefined);
|
|
828
828
|
};
|
|
829
829
|
|
|
@@ -832,7 +832,7 @@ proto.checkpermission.GetUserPermissionsRequest.prototype.clearTraceid = functio
|
|
|
832
832
|
* Returns whether this field is set.
|
|
833
833
|
* @return {boolean}
|
|
834
834
|
*/
|
|
835
|
-
proto.checkpermission.GetUserPermissionsRequest.prototype.
|
|
835
|
+
proto.checkpermission.GetUserPermissionsRequest.prototype.hasTraceId = function() {
|
|
836
836
|
return jspb.Message.getField(this, 3) != null;
|
|
837
837
|
};
|
|
838
838
|
|
|
@@ -988,7 +988,7 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.toObject
|
|
|
988
988
|
proto.checkpermission.GetUserPermissionsResponse.Permissions.toObject = function(includeInstance, msg) {
|
|
989
989
|
var f, obj = {
|
|
990
990
|
installationsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f,
|
|
991
|
-
|
|
991
|
+
assetScopesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
|
|
992
992
|
};
|
|
993
993
|
|
|
994
994
|
if (includeInstance) {
|
|
@@ -1031,7 +1031,7 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.deserializeBinaryFr
|
|
|
1031
1031
|
break;
|
|
1032
1032
|
case 2:
|
|
1033
1033
|
var value = /** @type {string} */ (reader.readString());
|
|
1034
|
-
msg.
|
|
1034
|
+
msg.addAssetScopes(value);
|
|
1035
1035
|
break;
|
|
1036
1036
|
default:
|
|
1037
1037
|
reader.skipField();
|
|
@@ -1069,7 +1069,7 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.serializeBinaryToWr
|
|
|
1069
1069
|
f
|
|
1070
1070
|
);
|
|
1071
1071
|
}
|
|
1072
|
-
f = message.
|
|
1072
|
+
f = message.getAssetScopesList();
|
|
1073
1073
|
if (f.length > 0) {
|
|
1074
1074
|
writer.writeRepeatedString(
|
|
1075
1075
|
2,
|
|
@@ -1117,10 +1117,10 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.clearInst
|
|
|
1117
1117
|
|
|
1118
1118
|
|
|
1119
1119
|
/**
|
|
1120
|
-
* repeated string
|
|
1120
|
+
* repeated string asset_scopes = 2;
|
|
1121
1121
|
* @return {!Array<string>}
|
|
1122
1122
|
*/
|
|
1123
|
-
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.
|
|
1123
|
+
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.getAssetScopesList = function() {
|
|
1124
1124
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
|
|
1125
1125
|
};
|
|
1126
1126
|
|
|
@@ -1129,7 +1129,7 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.getAssets
|
|
|
1129
1129
|
* @param {!Array<string>} value
|
|
1130
1130
|
* @return {!proto.checkpermission.GetUserPermissionsResponse.Permissions} returns this
|
|
1131
1131
|
*/
|
|
1132
|
-
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.
|
|
1132
|
+
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.setAssetScopesList = function(value) {
|
|
1133
1133
|
return jspb.Message.setField(this, 2, value || []);
|
|
1134
1134
|
};
|
|
1135
1135
|
|
|
@@ -1139,7 +1139,7 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.setAssets
|
|
|
1139
1139
|
* @param {number=} opt_index
|
|
1140
1140
|
* @return {!proto.checkpermission.GetUserPermissionsResponse.Permissions} returns this
|
|
1141
1141
|
*/
|
|
1142
|
-
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.
|
|
1142
|
+
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.addAssetScopes = function(value, opt_index) {
|
|
1143
1143
|
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
|
|
1144
1144
|
};
|
|
1145
1145
|
|
|
@@ -1148,8 +1148,8 @@ proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.addAssets
|
|
|
1148
1148
|
* Clears the list making it empty but non-null.
|
|
1149
1149
|
* @return {!proto.checkpermission.GetUserPermissionsResponse.Permissions} returns this
|
|
1150
1150
|
*/
|
|
1151
|
-
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.
|
|
1152
|
-
return this.
|
|
1151
|
+
proto.checkpermission.GetUserPermissionsResponse.Permissions.prototype.clearAssetScopesList = function() {
|
|
1152
|
+
return this.setAssetScopesList([]);
|
|
1153
1153
|
};
|
|
1154
1154
|
|
|
1155
1155
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lansweeper/permissions-grpc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "gen-proto/index.js",
|
|
5
5
|
"types": "gen-proto/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"@grpc/grpc-js": "^1.3.2",
|
|
9
9
|
"google-protobuf": "^3.17.0"
|
|
10
10
|
},
|
|
11
|
-
"gitHead": "
|
|
11
|
+
"gitHead": "476cfbaeb0dec6c086824af58f603f27fafd4305"
|
|
12
12
|
}
|
package/proto/permissions.proto
CHANGED
|
@@ -3,29 +3,29 @@ syntax = "proto3";
|
|
|
3
3
|
package checkpermission;
|
|
4
4
|
|
|
5
5
|
message CheckPermissionRequest {
|
|
6
|
-
string
|
|
7
|
-
string
|
|
6
|
+
string site_id = 1;
|
|
7
|
+
string account_id = 2;
|
|
8
8
|
string action = 3;
|
|
9
|
-
string
|
|
9
|
+
string trace_id = 4;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
message CheckPermissionResponse {
|
|
13
13
|
bool granted = 1;
|
|
14
14
|
repeated string installations = 2;
|
|
15
|
-
repeated string
|
|
16
|
-
repeated string
|
|
15
|
+
repeated string asset_scopes = 3;
|
|
16
|
+
repeated string derived_permissions = 4;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
message GetUserPermissionsRequest {
|
|
20
|
-
string
|
|
21
|
-
string
|
|
22
|
-
optional string
|
|
20
|
+
string user_id = 1;
|
|
21
|
+
string site_id = 2;
|
|
22
|
+
optional string trace_id = 3;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
message GetUserPermissionsResponse {
|
|
26
26
|
message Permissions {
|
|
27
27
|
repeated string installations = 1;
|
|
28
|
-
repeated string
|
|
28
|
+
repeated string asset_scopes = 2;
|
|
29
29
|
}
|
|
30
30
|
map<string, Permissions> permissions = 1;
|
|
31
31
|
}
|