@prosopo/user-access-policy 3.12.7 → 3.12.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/.turbo/turbo-build$colon$cjs.log +45 -41
- package/.turbo/turbo-build$colon$tsc.log +14 -14
- package/.turbo/turbo-build.log +46 -42
- package/CHANGELOG.md +40 -0
- package/dist/.export.js +7 -21
- package/dist/_virtual/_rolldown/runtime.js +3 -0
- package/dist/api/.export.js +2 -9
- package/dist/api/accessRulesApiClient.js +1 -1
- package/dist/api/delete/.export.js +2 -1
- package/dist/api/delete/deleteAllRules.js +22 -24
- package/dist/api/delete/deleteRuleGroups.js +39 -51
- package/dist/api/delete/deleteRules.js +37 -41
- package/dist/api/read/.export.js +2 -1
- package/dist/api/read/fetchRules.js +34 -42
- package/dist/api/read/findRuleIds.js +35 -48
- package/dist/api/read/getMissingIds.js +36 -40
- package/dist/api/ruleApiRoutes.js +62 -120
- package/dist/api/rulesApiClient.js +51 -87
- package/dist/api/write/.export.js +2 -1
- package/dist/api/write/insertRules.js +84 -102
- package/dist/api/write/rehashRules.js +48 -56
- package/dist/cjs/.export.cjs +21 -23
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/api/.export.cjs +6 -10
- package/dist/cjs/api/accessRulesApiClient.cjs +0 -0
- package/dist/cjs/api/delete/.export.cjs +0 -1
- package/dist/cjs/api/delete/deleteAllRules.cjs +22 -24
- package/dist/cjs/api/delete/deleteRuleGroups.cjs +39 -51
- package/dist/cjs/api/delete/deleteRules.cjs +41 -42
- package/dist/cjs/api/read/.export.cjs +0 -1
- package/dist/cjs/api/read/fetchRules.cjs +34 -41
- package/dist/cjs/api/read/findRuleIds.cjs +37 -48
- package/dist/cjs/api/read/getMissingIds.cjs +36 -39
- package/dist/cjs/api/ruleApiRoutes.cjs +69 -125
- package/dist/cjs/api/rulesApiClient.cjs +54 -90
- package/dist/cjs/api/write/.export.cjs +0 -1
- package/dist/cjs/api/write/insertRules.cjs +85 -103
- package/dist/cjs/api/write/rehashRules.cjs +48 -56
- package/dist/cjs/classifyOs.cjs +46 -26
- package/dist/cjs/mongoose/.export.cjs +2 -3
- package/dist/cjs/mongoose/mongooseRuleSchema.cjs +97 -36
- package/dist/cjs/redis/.export.cjs +4 -5
- package/dist/cjs/redis/reader/redisAggregate.cjs +59 -84
- package/dist/cjs/redis/reader/redisRulesQuery.cjs +74 -116
- package/dist/cjs/redis/reader/redisRulesReader.cjs +322 -503
- package/dist/cjs/redis/reader/redisRulesSplitQuery.cjs +94 -72
- package/dist/cjs/redis/redisClient.cjs +53 -58
- package/dist/cjs/redis/redisRuleIndex.cjs +93 -49
- package/dist/cjs/redis/redisRulesStorage.cjs +21 -30
- package/dist/cjs/redis/redisRulesWriter.cjs +86 -112
- package/dist/cjs/rule.cjs +8 -7
- package/dist/cjs/ruleInput/.export.cjs +7 -8
- package/dist/cjs/ruleInput/policyInput.cjs +36 -39
- package/dist/cjs/ruleInput/ruleInput.cjs +37 -42
- package/dist/cjs/ruleInput/userScopeInput.cjs +47 -55
- package/dist/cjs/ruleRecord.cjs +15 -22
- package/dist/cjs/rulesStorage.cjs +7 -6
- package/dist/cjs/transformRule.cjs +36 -70
- package/dist/classifyOs.js +48 -29
- package/dist/mongoose/.export.js +2 -3
- package/dist/mongoose/mongooseRuleSchema.js +99 -38
- package/dist/redis/.export.js +3 -5
- package/dist/redis/reader/redisAggregate.js +60 -86
- package/dist/redis/reader/redisRulesQuery.js +75 -118
- package/dist/redis/reader/redisRulesReader.js +312 -487
- package/dist/redis/reader/redisRulesSplitQuery.js +96 -75
- package/dist/redis/redisClient.js +54 -62
- package/dist/redis/redisRuleIndex.js +93 -58
- package/dist/redis/redisRulesStorage.js +21 -30
- package/dist/redis/redisRulesWriter.js +82 -113
- package/dist/rule.js +10 -10
- package/dist/ruleInput/.export.js +3 -7
- package/dist/ruleInput/policyInput.d.ts +52 -1
- package/dist/ruleInput/policyInput.d.ts.map +1 -1
- package/dist/ruleInput/policyInput.js +35 -41
- package/dist/ruleInput/policyInput.js.map +1 -1
- package/dist/ruleInput/ruleInput.d.ts.map +1 -1
- package/dist/ruleInput/ruleInput.js +36 -44
- package/dist/ruleInput/ruleInput.js.map +1 -1
- package/dist/ruleInput/userScopeInput.js +44 -55
- package/dist/ruleRecord.js +17 -27
- package/dist/rulesStorage.js +9 -8
- package/dist/tests/policyInput.unit.test.js +50 -1
- package/dist/tests/policyInput.unit.test.js.map +1 -1
- package/dist/tests/redis/redisRulesStorage.integration.test.js +22 -3
- package/dist/tests/redis/redisRulesStorage.integration.test.js.map +1 -1
- package/dist/transformRule.js +34 -73
- package/dist/transformRule.js.map +1 -1
- package/entries.ts +25 -6
- package/package.json +13 -12
- package/src/ruleInput/policyInput.ts +45 -2
- package/src/ruleInput/ruleInput.ts +10 -3
- package/src/tests/policyInput.unit.test.ts +69 -1
- package/src/tests/redis/redisRulesStorage.integration.test.ts +191 -148
- package/src/transformRule.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,90 +1,65 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return reply.documents;
|
|
2
|
+
require("./redisRulesQuery.cjs");
|
|
3
|
+
const require_redis_redisClient = require("../redisClient.cjs");
|
|
4
|
+
const require_redis_redisRuleIndex = require("../redisRuleIndex.cjs");
|
|
5
|
+
let zod = require("zod");
|
|
6
|
+
//#region src/redis/reader/redisAggregate.ts
|
|
7
|
+
var searchRedisKeysBounded = async (client, query, maxKeys) => {
|
|
8
|
+
return (await client.ft.searchNoContent(require_redis_redisRuleIndex.ACCESS_RULES_REDIS_INDEX_NAME, query, {
|
|
9
|
+
DIALECT: 2,
|
|
10
|
+
LIMIT: {
|
|
11
|
+
from: 0,
|
|
12
|
+
size: maxKeys
|
|
13
|
+
}
|
|
14
|
+
})).documents;
|
|
17
15
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
await executeAggregation(
|
|
58
|
-
client,
|
|
59
|
-
query,
|
|
60
|
-
{
|
|
61
|
-
// #2 is a required option when the 'ismissing()' function is in the query body
|
|
62
|
-
DIALECT: redisRulesQuery.REDIS_QUERY_DIALECT,
|
|
63
|
-
COUNT: redisClient.REDIS_BATCH_SIZE,
|
|
64
|
-
LOAD: `@${keyField}`
|
|
65
|
-
},
|
|
66
|
-
addRecordKeys,
|
|
67
|
-
() => stopRequested
|
|
68
|
-
);
|
|
69
|
-
return foundKeys;
|
|
16
|
+
var aggregateRedisKeys = async (client, query, logger, batchHandler, maxKeys) => {
|
|
17
|
+
const keyField = "__key";
|
|
18
|
+
const recordSchema = zod.z.object({ [keyField]: zod.z.string() });
|
|
19
|
+
const foundKeys = [];
|
|
20
|
+
let stopRequested = false;
|
|
21
|
+
const addRecordKeys = async (records) => {
|
|
22
|
+
if (stopRequested) return;
|
|
23
|
+
const recordKeys = require_redis_redisClient.parseRedisRecords(records, recordSchema, logger).map((record) => record[keyField]);
|
|
24
|
+
if (batchHandler) await batchHandler(recordKeys);
|
|
25
|
+
else {
|
|
26
|
+
if (maxKeys !== void 0 && foundKeys.length + recordKeys.length > maxKeys) {
|
|
27
|
+
const remaining = Math.max(0, maxKeys - foundKeys.length);
|
|
28
|
+
foundKeys.push(...recordKeys.slice(0, remaining));
|
|
29
|
+
stopRequested = true;
|
|
30
|
+
logger.warn(() => ({
|
|
31
|
+
msg: "Redis aggregation candidate cap hit; truncating result set. This can suppress less-frequent rules and should be investigated.",
|
|
32
|
+
data: {
|
|
33
|
+
maxKeys,
|
|
34
|
+
query
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
foundKeys.push(...recordKeys);
|
|
40
|
+
logger.debug(() => ({
|
|
41
|
+
msg: "Processed aggregation batch",
|
|
42
|
+
data: { size: recordKeys.length }
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
await executeAggregation(client, query, {
|
|
47
|
+
DIALECT: 2,
|
|
48
|
+
COUNT: require_redis_redisClient.REDIS_BATCH_SIZE,
|
|
49
|
+
LOAD: `@${keyField}`
|
|
50
|
+
}, addRecordKeys, () => stopRequested);
|
|
51
|
+
return foundKeys;
|
|
70
52
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const batchReply = await client.ft.cursorRead(
|
|
81
|
-
redisRuleIndex.ACCESS_RULES_REDIS_INDEX_NAME,
|
|
82
|
-
cursor,
|
|
83
|
-
{ COUNT: aggregateOptions.COUNT }
|
|
84
|
-
);
|
|
85
|
-
await handleBatch(batchReply.results);
|
|
86
|
-
cursor = batchReply.cursor;
|
|
87
|
-
}
|
|
53
|
+
var executeAggregation = async (client, query, aggregateOptions, handleBatch, shouldStop) => {
|
|
54
|
+
const initialReply = await client.ft.aggregateWithCursor(require_redis_redisRuleIndex.ACCESS_RULES_REDIS_INDEX_NAME, query, aggregateOptions);
|
|
55
|
+
await handleBatch(initialReply.results);
|
|
56
|
+
let cursor = initialReply.cursor;
|
|
57
|
+
while (0 !== cursor && !shouldStop?.()) {
|
|
58
|
+
const batchReply = await client.ft.cursorRead(require_redis_redisRuleIndex.ACCESS_RULES_REDIS_INDEX_NAME, cursor, { COUNT: aggregateOptions.COUNT });
|
|
59
|
+
await handleBatch(batchReply.results);
|
|
60
|
+
cursor = batchReply.cursor;
|
|
61
|
+
}
|
|
88
62
|
};
|
|
63
|
+
//#endregion
|
|
89
64
|
exports.aggregateRedisKeys = aggregateRedisKeys;
|
|
90
65
|
exports.searchRedisKeysBounded = searchRedisKeysBounded;
|
|
@@ -1,125 +1,83 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
const require_rulesStorage = require("../../rulesStorage.cjs");
|
|
3
|
+
const require_rule = require("../../rule.cjs");
|
|
4
|
+
const require_ruleInput_userScopeInput = require("../../ruleInput/userScopeInput.cjs");
|
|
5
|
+
//#region src/redis/reader/redisRulesQuery.ts
|
|
6
|
+
/**
|
|
7
|
+
* Escapes special characters for Redis TAG field queries.
|
|
8
|
+
* Redis TAG fields treat these characters as special and they must be escaped with a backslash.
|
|
9
|
+
*/
|
|
10
|
+
var escapeTagValue = (value) => {
|
|
11
|
+
return value.replace(/([,.<>{}\[\]"':;!@#$%^&*()\-+=~|/\\])/g, "\\$1");
|
|
8
12
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return value !== void 0 ? `@numericIpMaskMin:[-inf ${value}]` : "ismissing(@numericIpMaskMin)";
|
|
28
|
-
},
|
|
29
|
-
numericIpMaskMax: (value, scope) => {
|
|
30
|
-
if (scope.numericIp !== void 0) {
|
|
31
|
-
return "";
|
|
32
|
-
}
|
|
33
|
-
if (value === void 0 && scope.numericIpMaskMin === void 0) {
|
|
34
|
-
return "";
|
|
35
|
-
}
|
|
36
|
-
return value !== void 0 ? `@numericIpMaskMax:[${value} +inf]` : "ismissing(@numericIpMaskMax)";
|
|
37
|
-
}
|
|
13
|
+
var REDIS_QUERY_DIALECT = 2;
|
|
14
|
+
var userIpQueries = {
|
|
15
|
+
numericIp: (value, scope) => {
|
|
16
|
+
if (void 0 !== value) return `( @numericIp:[${value} ${value}] | ( @numericIpMaskMin:[-inf ${value}] @numericIpMaskMax:[${value} +inf] ) )`;
|
|
17
|
+
if (scope.numericIpMaskMin === void 0 && scope.numericIpMaskMax === void 0) return "ismissing(@numericIp) ismissing(@numericIpMaskMin) ismissing(@numericIpMaskMax)";
|
|
18
|
+
return "";
|
|
19
|
+
},
|
|
20
|
+
numericIpMaskMin: (value, scope) => {
|
|
21
|
+
if (scope.numericIp !== void 0) return "";
|
|
22
|
+
if (value === void 0 && scope.numericIpMaskMax === void 0) return "";
|
|
23
|
+
return value !== void 0 ? `@numericIpMaskMin:[-inf ${value}]` : "ismissing(@numericIpMaskMin)";
|
|
24
|
+
},
|
|
25
|
+
numericIpMaskMax: (value, scope) => {
|
|
26
|
+
if (scope.numericIp !== void 0) return "";
|
|
27
|
+
if (value === void 0 && scope.numericIpMaskMin === void 0) return "";
|
|
28
|
+
return value !== void 0 ? `@numericIpMaskMax:[${value} +inf]` : "ismissing(@numericIpMaskMax)";
|
|
29
|
+
}
|
|
38
30
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
scopeEntries = [...scopeMap.entries()];
|
|
60
|
-
}
|
|
61
|
-
const scopeObj = Object.fromEntries(scopeEntries);
|
|
62
|
-
return scopeEntries.map(
|
|
63
|
-
([scopeFieldName, scopeFieldValue]) => getUserScopeFieldQuery(
|
|
64
|
-
scopeFieldName,
|
|
65
|
-
scopeFieldValue,
|
|
66
|
-
FilterScopeMatchType,
|
|
67
|
-
scopeObj
|
|
68
|
-
)
|
|
69
|
-
).filter(Boolean).join(scopeJoinType);
|
|
31
|
+
var getUserScopeQuery = (userScope, FilterScopeMatchType, matchingFieldsOnly) => {
|
|
32
|
+
let scopeEntries = Object.entries(userScope);
|
|
33
|
+
let scopeJoinType = " ";
|
|
34
|
+
if (FilterScopeMatchType === require_rulesStorage.FilterScopeMatch.Greedy) {
|
|
35
|
+
scopeEntries = scopeEntries.filter(([_, value]) => value !== void 0);
|
|
36
|
+
scopeJoinType = " | ";
|
|
37
|
+
}
|
|
38
|
+
if (matchingFieldsOnly) {
|
|
39
|
+
const scopeMap = new Map(scopeEntries);
|
|
40
|
+
if (scopeMap.has("numericIp") && scopeMap.get("numericIp") === void 0) {
|
|
41
|
+
scopeMap.set("numericIpMaskMin", void 0);
|
|
42
|
+
scopeMap.set("numericIpMaskMax", void 0);
|
|
43
|
+
}
|
|
44
|
+
for (const name of Object.keys(require_ruleInput_userScopeInput.userScopeSchema.shape)) if (!scopeMap.has(name)) scopeMap.set(name, void 0);
|
|
45
|
+
scopeEntries = [...scopeMap.entries()];
|
|
46
|
+
}
|
|
47
|
+
const scopeObj = Object.fromEntries(scopeEntries);
|
|
48
|
+
return scopeEntries.map(([scopeFieldName, scopeFieldValue]) => getUserScopeFieldQuery(scopeFieldName, scopeFieldValue, FilterScopeMatchType, scopeObj)).filter(Boolean).join(scopeJoinType);
|
|
70
49
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
const stringValue = String(fieldValue);
|
|
84
|
-
if (NUMERIC_FIELDS.has(fieldName)) {
|
|
85
|
-
return `@${fieldName}:[${stringValue} ${stringValue}]`;
|
|
86
|
-
}
|
|
87
|
-
const queryValue = FIELDS_REQUIRING_ESCAPE.has(fieldName) ? escapeTagValue(stringValue) : stringValue;
|
|
88
|
-
return `@${fieldName}:{${queryValue}}`;
|
|
50
|
+
var FIELDS_REQUIRING_ESCAPE = /* @__PURE__ */ new Set(["coords"]);
|
|
51
|
+
var NUMERIC_FIELDS = /* @__PURE__ */ new Set(["asn"]);
|
|
52
|
+
var getUserScopeFieldQuery = (fieldName, fieldValue, scopeMatch, fullScope) => {
|
|
53
|
+
if (fieldName in userIpQueries) {
|
|
54
|
+
const queryBuilder = userIpQueries[fieldName];
|
|
55
|
+
return queryBuilder(fieldValue, fullScope);
|
|
56
|
+
}
|
|
57
|
+
if (void 0 === fieldValue) return `ismissing(@${fieldName})`;
|
|
58
|
+
const stringValue = String(fieldValue);
|
|
59
|
+
if (NUMERIC_FIELDS.has(fieldName)) return `@${fieldName}:[${stringValue} ${stringValue}]`;
|
|
60
|
+
return `@${fieldName}:{${FIELDS_REQUIRING_ESCAPE.has(fieldName) ? escapeTagValue(stringValue) : stringValue}}`;
|
|
89
61
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
return rulesStorage.FilterScopeMatch.Exact === scopeMatch ? `( ${GLOBAL_MATCH_CLAUSE_INNER} )` : "";
|
|
62
|
+
var GLOBAL_MATCH_CLAUSE_INNER = `@clientId:{${require_rule.GLOBAL_CLIENT_SCOPE_SENTINEL}} | ismissing(@clientId)`;
|
|
63
|
+
var getPolicyScopeQuery = (policyScope, scopeMatch) => {
|
|
64
|
+
const clientId = policyScope?.clientId;
|
|
65
|
+
if ("string" === typeof clientId) return require_rulesStorage.FilterScopeMatch.Exact === scopeMatch ? `@clientId:{${clientId}}` : `( @clientId:{${clientId}} | ${GLOBAL_MATCH_CLAUSE_INNER} )`;
|
|
66
|
+
return require_rulesStorage.FilterScopeMatch.Exact === scopeMatch ? `( ${GLOBAL_MATCH_CLAUSE_INNER} )` : "";
|
|
97
67
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
);
|
|
111
|
-
if (policyScopeQuery) {
|
|
112
|
-
queryParts.push(policyScopeQuery);
|
|
113
|
-
}
|
|
114
|
-
if (userScope && Object.keys(userScope).length > 0) {
|
|
115
|
-
const userScopeFilter = getUserScopeQuery(
|
|
116
|
-
userScope,
|
|
117
|
-
filter.userScopeMatch,
|
|
118
|
-
matchingFieldsOnly
|
|
119
|
-
);
|
|
120
|
-
queryParts.push(`( ${userScopeFilter} )`);
|
|
121
|
-
}
|
|
122
|
-
return queryParts.length > 0 ? queryParts.join(" ") : "*";
|
|
68
|
+
var getRulesRedisQuery = (filter, matchingFieldsOnly) => {
|
|
69
|
+
const { policyScope, userScope } = filter;
|
|
70
|
+
const queryParts = [];
|
|
71
|
+
if (filter.groupId) queryParts.push(`@groupId:{${filter.groupId}}`);
|
|
72
|
+
if (filter.blockOnly) queryParts.push(`@type:{${require_rule.AccessPolicyType.Block}}`);
|
|
73
|
+
const policyScopeQuery = getPolicyScopeQuery(policyScope, filter.policyScopeMatch);
|
|
74
|
+
if (policyScopeQuery) queryParts.push(policyScopeQuery);
|
|
75
|
+
if (userScope && Object.keys(userScope).length > 0) {
|
|
76
|
+
const userScopeFilter = getUserScopeQuery(userScope, filter.userScopeMatch, matchingFieldsOnly);
|
|
77
|
+
queryParts.push(`( ${userScopeFilter} )`);
|
|
78
|
+
}
|
|
79
|
+
return queryParts.length > 0 ? queryParts.join(" ") : "*";
|
|
123
80
|
};
|
|
81
|
+
//#endregion
|
|
124
82
|
exports.REDIS_QUERY_DIALECT = REDIS_QUERY_DIALECT;
|
|
125
83
|
exports.getRulesRedisQuery = getRulesRedisQuery;
|