@prosopo/user-access-policy 3.3.0 → 3.3.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 +36 -0
- package/dist/accessPolicy.js +71 -57
- package/dist/accessPolicyResolver.js +62 -36
- package/dist/accessRules.js +9 -6
- package/dist/api/accessRuleApiRoutes.js +73 -50
- package/dist/api/deleteAllRulesEndpoint.js +22 -19
- package/dist/api/deleteRulesEndpoint.js +30 -27
- package/dist/api/insertRulesEndpoint.js +57 -57
- package/dist/index.js +27 -14
- package/dist/redis/redisAccessRules.js +128 -112
- package/dist/redis/redisAccessRulesIndex.js +94 -70
- package/dist/redis/redisIndex.js +15 -16
- package/dist/util.js +4 -2
- package/package.json +15 -10
- package/vite.cjs.config.ts +7 -6
- package/vite.esm.config.ts +20 -0
- package/vite.test.config.ts +16 -21
- package/dist/accessPolicy.d.ts +0 -169
- package/dist/accessPolicy.d.ts.map +0 -1
- package/dist/accessPolicy.js.map +0 -1
- package/dist/accessPolicyResolver.d.ts +0 -115
- package/dist/accessPolicyResolver.d.ts.map +0 -1
- package/dist/accessPolicyResolver.js.map +0 -1
- package/dist/accessRules.d.ts +0 -16
- package/dist/accessRules.d.ts.map +0 -1
- package/dist/accessRules.js.map +0 -1
- package/dist/api/accessRuleApiRoutes.d.ts +0 -27
- package/dist/api/accessRuleApiRoutes.d.ts.map +0 -1
- package/dist/api/accessRuleApiRoutes.js.map +0 -1
- package/dist/api/deleteAllRulesEndpoint.d.ts +0 -12
- package/dist/api/deleteAllRulesEndpoint.d.ts.map +0 -1
- package/dist/api/deleteAllRulesEndpoint.js.map +0 -1
- package/dist/api/deleteRulesEndpoint.d.ts +0 -116
- package/dist/api/deleteRulesEndpoint.d.ts.map +0 -1
- package/dist/api/deleteRulesEndpoint.js.map +0 -1
- package/dist/api/insertRulesEndpoint.d.ts +0 -22
- package/dist/api/insertRulesEndpoint.d.ts.map +0 -1
- package/dist/api/insertRulesEndpoint.js.map +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/redis/redisAccessRules.d.ts +0 -7
- package/dist/redis/redisAccessRules.d.ts.map +0 -1
- package/dist/redis/redisAccessRules.js.map +0 -1
- package/dist/redis/redisAccessRulesIndex.d.ts +0 -13
- package/dist/redis/redisAccessRulesIndex.d.ts.map +0 -1
- package/dist/redis/redisAccessRulesIndex.js.map +0 -1
- package/dist/redis/redisIndex.d.ts +0 -9
- package/dist/redis/redisIndex.d.ts.map +0 -1
- package/dist/redis/redisIndex.js.map +0 -1
- package/dist/tests/accessPolicy.test.d.ts +0 -2
- package/dist/tests/accessPolicy.test.d.ts.map +0 -1
- package/dist/tests/accessPolicy.test.js +0 -27
- package/dist/tests/accessPolicy.test.js.map +0 -1
- package/dist/tests/redis/redisAccessRules.test.d.ts +0 -2
- package/dist/tests/redis/redisAccessRules.test.d.ts.map +0 -1
- package/dist/tests/redis/redisAccessRules.test.js +0 -413
- package/dist/tests/redis/redisAccessRules.test.js.map +0 -1
- package/dist/tests/redis/redisIndex.test.d.ts +0 -2
- package/dist/tests/redis/redisIndex.test.d.ts.map +0 -1
- package/dist/tests/redis/redisIndex.test.js +0 -84
- package/dist/tests/redis/redisIndex.test.js.map +0 -1
- package/dist/tests/redis/testRedisClient.d.ts +0 -3
- package/dist/tests/redis/testRedisClient.d.ts.map +0 -1
- package/dist/tests/redis/testRedisClient.js +0 -8
- package/dist/tests/redis/testRedisClient.js.map +0 -1
- package/dist/tests/testLogger.d.ts +0 -4
- package/dist/tests/testLogger.d.ts.map +0 -1
- package/dist/tests/testLogger.js +0 -22
- package/dist/tests/testLogger.js.map +0 -1
- package/dist/util.d.ts +0 -2
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js.map +0 -1
- package/vite.config.ts +0 -39
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/user-access-policy",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"engines": {
|
|
7
8
|
"node": "20",
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
},
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
12
14
|
"import": "./dist/index.js",
|
|
13
15
|
"require": "./dist/cjs/index.cjs"
|
|
14
16
|
}
|
|
@@ -17,22 +19,25 @@
|
|
|
17
19
|
"#policy/*": "./dist/*"
|
|
18
20
|
},
|
|
19
21
|
"scripts": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"build:
|
|
22
|
+
"clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
|
|
23
|
+
"build": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
|
|
24
|
+
"build:tsc": "tsc --build --verbose",
|
|
25
|
+
"build:cjs": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
|
|
26
|
+
"typecheck": "tsc --build --declaration --emitDeclarationOnly --force",
|
|
23
27
|
"test": "NODE_ENV=${NODE_ENV:-test}; npx vitest run --config ./vite.test.config.ts"
|
|
24
28
|
},
|
|
25
29
|
"dependencies": {
|
|
26
|
-
"@prosopo/api-route": "2.6.
|
|
27
|
-
"@prosopo/common": "3.
|
|
28
|
-
"@prosopo/types": "3.0.
|
|
29
|
-
"@prosopo/util": "3.0.
|
|
30
|
+
"@prosopo/api-route": "2.6.9",
|
|
31
|
+
"@prosopo/common": "3.1.1",
|
|
32
|
+
"@prosopo/types": "3.0.5",
|
|
33
|
+
"@prosopo/util": "3.0.4",
|
|
30
34
|
"axios": "1.10.0",
|
|
31
35
|
"esbuild": "0.25.6",
|
|
32
36
|
"ip-address": "10.0.1",
|
|
33
37
|
"redis": "5.0.0",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
38
|
+
"zod": "3.23.8",
|
|
39
|
+
"@prosopo/config": "3.1.2",
|
|
40
|
+
"webpack-dev-server": "5.2.2"
|
|
36
41
|
},
|
|
37
42
|
"devDependencies": {
|
|
38
43
|
"vite": "6.3.5",
|
package/vite.cjs.config.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from "node:path";
|
|
1
2
|
// Copyright 2021-2025 Prosopo (UK) Ltd.
|
|
2
3
|
//
|
|
3
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -11,11 +12,11 @@
|
|
|
11
12
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
13
|
// See the License for the specific language governing permissions and
|
|
13
14
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
import path from "node:path";
|
|
16
15
|
import { ViteCommonJSConfig } from "@prosopo/config";
|
|
17
16
|
|
|
18
|
-
export default
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)
|
|
17
|
+
export default function () {
|
|
18
|
+
return ViteCommonJSConfig(
|
|
19
|
+
path.basename("."),
|
|
20
|
+
path.resolve("./tsconfig.json"),
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2021-2025 Prosopo (UK) Ltd.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import { ViteEsmConfig } from "@prosopo/config";
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
return ViteEsmConfig(path.basename("."), path.resolve("./tsconfig.json"));
|
|
20
|
+
}
|
package/vite.test.config.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
1
3
|
// Copyright 2021-2025 Prosopo (UK) Ltd.
|
|
2
4
|
//
|
|
3
5
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -11,27 +13,20 @@
|
|
|
11
13
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
14
|
// See the License for the specific language governing permissions and
|
|
13
15
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
import path from "node:path";
|
|
16
16
|
import { ViteTestConfig } from "@prosopo/config";
|
|
17
|
+
import dotenv from "dotenv";
|
|
18
|
+
process.env.NODE_ENV = "test";
|
|
19
|
+
// if .env.test exists at this level, use it, otherwise use the one at the root
|
|
20
|
+
const envFile = `.env.${process.env.NODE_ENV || "development"}`;
|
|
21
|
+
let envPath = envFile;
|
|
22
|
+
if (fs.existsSync(envFile)) {
|
|
23
|
+
envPath = path.resolve(envFile);
|
|
24
|
+
} else if (fs.existsSync(`../../${envFile}`)) {
|
|
25
|
+
envPath = path.resolve(`../../${envFile}`);
|
|
26
|
+
} else {
|
|
27
|
+
throw new Error(`No ${envFile} file found`);
|
|
28
|
+
}
|
|
17
29
|
|
|
18
|
-
|
|
19
|
-
const testConfig = ViteTestConfig(path.resolve("./tsconfig.json"));
|
|
30
|
+
dotenv.config({ path: envPath });
|
|
20
31
|
|
|
21
|
-
|
|
22
|
-
...testConfig,
|
|
23
|
-
test: {
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
...testConfig.test,
|
|
26
|
-
poolOptions: {
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
...testConfig.test.poolOptions,
|
|
29
|
-
forks: {
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
...testConfig.test.poolOptions.forks,
|
|
32
|
-
singleFork: true,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
};
|
|
32
|
+
export default ViteTestConfig();
|
package/dist/accessPolicy.d.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { type ZodRawShape, z } from "zod";
|
|
2
|
-
export declare enum AccessPolicyType {
|
|
3
|
-
Block = "block",
|
|
4
|
-
Restrict = "restrict"
|
|
5
|
-
}
|
|
6
|
-
export declare const accessPolicySchema: z.ZodObject<{
|
|
7
|
-
type: ZodRawShape["type"];
|
|
8
|
-
captchaType: ZodRawShape["captchaType"];
|
|
9
|
-
description: ZodRawShape["description"];
|
|
10
|
-
solvedImagesCount: ZodRawShape["solvedImagesCount"];
|
|
11
|
-
imageThreshold: ZodRawShape["imageThreshold"];
|
|
12
|
-
powDifficulty: ZodRawShape["powDifficulty"];
|
|
13
|
-
unsolvedImagesCount: ZodRawShape["unsolvedImagesCount"];
|
|
14
|
-
frictionlessScore: ZodRawShape["frictionlessScore"];
|
|
15
|
-
}>;
|
|
16
|
-
export declare const policyScopeSchema: z.ZodObject<{
|
|
17
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
18
|
-
ruleGroupId: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
clientId?: string | undefined;
|
|
21
|
-
ruleGroupId?: string | undefined;
|
|
22
|
-
}, {
|
|
23
|
-
clientId?: string | undefined;
|
|
24
|
-
ruleGroupId?: string | undefined;
|
|
25
|
-
}>;
|
|
26
|
-
export declare const userScopeSchema: z.ZodObject<{
|
|
27
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
28
|
-
numericIp: z.ZodOptional<z.ZodBigInt>;
|
|
29
|
-
numericIpMaskMin: z.ZodOptional<z.ZodBigInt>;
|
|
30
|
-
numericIpMaskMax: z.ZodOptional<z.ZodBigInt>;
|
|
31
|
-
ja4Hash: z.ZodOptional<z.ZodString>;
|
|
32
|
-
headersHash: z.ZodOptional<z.ZodString>;
|
|
33
|
-
userAgentHash: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
userId?: string | undefined;
|
|
36
|
-
numericIp?: bigint | undefined;
|
|
37
|
-
numericIpMaskMin?: bigint | undefined;
|
|
38
|
-
numericIpMaskMax?: bigint | undefined;
|
|
39
|
-
ja4Hash?: string | undefined;
|
|
40
|
-
headersHash?: string | undefined;
|
|
41
|
-
userAgentHash?: string | undefined;
|
|
42
|
-
}, {
|
|
43
|
-
userId?: string | undefined;
|
|
44
|
-
numericIp?: bigint | undefined;
|
|
45
|
-
numericIpMaskMin?: bigint | undefined;
|
|
46
|
-
numericIpMaskMax?: bigint | undefined;
|
|
47
|
-
ja4Hash?: string | undefined;
|
|
48
|
-
headersHash?: string | undefined;
|
|
49
|
-
userAgentHash?: string | undefined;
|
|
50
|
-
}>;
|
|
51
|
-
export declare const userScopeInputSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
|
|
52
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
53
|
-
numericIp: z.ZodOptional<z.ZodBigInt>;
|
|
54
|
-
numericIpMaskMin: z.ZodOptional<z.ZodBigInt>;
|
|
55
|
-
numericIpMaskMax: z.ZodOptional<z.ZodBigInt>;
|
|
56
|
-
ja4Hash: z.ZodOptional<z.ZodString>;
|
|
57
|
-
headersHash: z.ZodOptional<z.ZodString>;
|
|
58
|
-
userAgentHash: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, {
|
|
60
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
61
|
-
ipMask: z.ZodOptional<z.ZodString>;
|
|
62
|
-
userAgent: z.ZodOptional<z.ZodString>;
|
|
63
|
-
}>, "strip", z.ZodTypeAny, {
|
|
64
|
-
userId?: string | undefined;
|
|
65
|
-
numericIp?: bigint | undefined;
|
|
66
|
-
numericIpMaskMin?: bigint | undefined;
|
|
67
|
-
numericIpMaskMax?: bigint | undefined;
|
|
68
|
-
ja4Hash?: string | undefined;
|
|
69
|
-
headersHash?: string | undefined;
|
|
70
|
-
userAgentHash?: string | undefined;
|
|
71
|
-
ip?: string | undefined;
|
|
72
|
-
ipMask?: string | undefined;
|
|
73
|
-
userAgent?: string | undefined;
|
|
74
|
-
}, {
|
|
75
|
-
userId?: string | undefined;
|
|
76
|
-
numericIp?: bigint | undefined;
|
|
77
|
-
numericIpMaskMin?: bigint | undefined;
|
|
78
|
-
numericIpMaskMax?: bigint | undefined;
|
|
79
|
-
ja4Hash?: string | undefined;
|
|
80
|
-
headersHash?: string | undefined;
|
|
81
|
-
userAgentHash?: string | undefined;
|
|
82
|
-
ip?: string | undefined;
|
|
83
|
-
ipMask?: string | undefined;
|
|
84
|
-
userAgent?: string | undefined;
|
|
85
|
-
}>, {
|
|
86
|
-
userId?: string | undefined;
|
|
87
|
-
numericIp?: bigint | undefined;
|
|
88
|
-
numericIpMaskMin?: bigint | undefined;
|
|
89
|
-
numericIpMaskMax?: bigint | undefined;
|
|
90
|
-
ja4Hash?: string | undefined;
|
|
91
|
-
headersHash?: string | undefined;
|
|
92
|
-
userAgentHash?: string | undefined;
|
|
93
|
-
}, {
|
|
94
|
-
userId?: string | undefined;
|
|
95
|
-
numericIp?: bigint | undefined;
|
|
96
|
-
numericIpMaskMin?: bigint | undefined;
|
|
97
|
-
numericIpMaskMax?: bigint | undefined;
|
|
98
|
-
ja4Hash?: string | undefined;
|
|
99
|
-
headersHash?: string | undefined;
|
|
100
|
-
userAgentHash?: string | undefined;
|
|
101
|
-
ip?: string | undefined;
|
|
102
|
-
ipMask?: string | undefined;
|
|
103
|
-
userAgent?: string | undefined;
|
|
104
|
-
}>;
|
|
105
|
-
export type AccessPolicy = z.output<typeof accessPolicySchema>;
|
|
106
|
-
export type PolicyScope = z.output<typeof policyScopeSchema>;
|
|
107
|
-
export type UserScope = z.output<typeof userScopeSchema>;
|
|
108
|
-
export type UserScopeApiInput = z.input<typeof userScopeInputSchema>;
|
|
109
|
-
export type UserScopeApiOutput = z.output<typeof userScopeInputSchema>;
|
|
110
|
-
export declare const accessRuleSchemaExtended: z.ZodObject<Omit<{
|
|
111
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
112
|
-
numericIp: z.ZodOptional<z.ZodBigInt>;
|
|
113
|
-
numericIpMaskMin: z.ZodOptional<z.ZodBigInt>;
|
|
114
|
-
numericIpMaskMax: z.ZodOptional<z.ZodBigInt>;
|
|
115
|
-
ja4Hash: z.ZodOptional<z.ZodString>;
|
|
116
|
-
headersHash: z.ZodOptional<z.ZodString>;
|
|
117
|
-
userAgentHash: z.ZodOptional<z.ZodString>;
|
|
118
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
119
|
-
ipMask: z.ZodOptional<z.ZodString>;
|
|
120
|
-
userAgent: z.ZodOptional<z.ZodString>;
|
|
121
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
122
|
-
ruleGroupId: z.ZodOptional<z.ZodString>;
|
|
123
|
-
type: ZodRawShape["type"];
|
|
124
|
-
captchaType: ZodRawShape["captchaType"];
|
|
125
|
-
description: ZodRawShape["description"];
|
|
126
|
-
solvedImagesCount: ZodRawShape["solvedImagesCount"];
|
|
127
|
-
imageThreshold: ZodRawShape["imageThreshold"];
|
|
128
|
-
powDifficulty: ZodRawShape["powDifficulty"];
|
|
129
|
-
unsolvedImagesCount: ZodRawShape["unsolvedImagesCount"];
|
|
130
|
-
frictionlessScore: ZodRawShape["frictionlessScore"];
|
|
131
|
-
}, "numericIp" | "numericIpMaskMin" | "numericIpMaskMax">, "strip", z.ZodTypeAny, {
|
|
132
|
-
type?: any;
|
|
133
|
-
captchaType?: any;
|
|
134
|
-
description?: any;
|
|
135
|
-
solvedImagesCount?: any;
|
|
136
|
-
imageThreshold?: any;
|
|
137
|
-
powDifficulty?: any;
|
|
138
|
-
unsolvedImagesCount?: any;
|
|
139
|
-
frictionlessScore?: any;
|
|
140
|
-
clientId?: string | undefined;
|
|
141
|
-
ruleGroupId?: string | undefined;
|
|
142
|
-
userId?: string | undefined;
|
|
143
|
-
ja4Hash?: string | undefined;
|
|
144
|
-
headersHash?: string | undefined;
|
|
145
|
-
userAgentHash?: string | undefined;
|
|
146
|
-
ip?: string | undefined;
|
|
147
|
-
ipMask?: string | undefined;
|
|
148
|
-
userAgent?: string | undefined;
|
|
149
|
-
}, {
|
|
150
|
-
type?: any;
|
|
151
|
-
captchaType?: any;
|
|
152
|
-
description?: any;
|
|
153
|
-
solvedImagesCount?: any;
|
|
154
|
-
imageThreshold?: any;
|
|
155
|
-
powDifficulty?: any;
|
|
156
|
-
unsolvedImagesCount?: any;
|
|
157
|
-
frictionlessScore?: any;
|
|
158
|
-
clientId?: string | undefined;
|
|
159
|
-
ruleGroupId?: string | undefined;
|
|
160
|
-
userId?: string | undefined;
|
|
161
|
-
ja4Hash?: string | undefined;
|
|
162
|
-
headersHash?: string | undefined;
|
|
163
|
-
userAgentHash?: string | undefined;
|
|
164
|
-
ip?: string | undefined;
|
|
165
|
-
ipMask?: string | undefined;
|
|
166
|
-
userAgent?: string | undefined;
|
|
167
|
-
}>;
|
|
168
|
-
export type AccessRuleExtended = z.input<typeof accessRuleSchemaExtended>;
|
|
169
|
-
//# sourceMappingURL=accessPolicy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessPolicy.d.ts","sourceRoot":"","sources":["../src/accessPolicy.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,WAAW,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG1C,oBAAY,gBAAgB;IAC3B,KAAK,UAAU;IACf,QAAQ,aAAa;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,SAAS,CAAC;IAC5C,IAAI,EAAE,WAAW,CAAC,MAAM,C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AAE;CAChC,CAAC;KACD,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;IAE7B,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,cAAc,CAAC;IAE/D,IAAI,QAAQ,KAAK,OAAO,EAAE,EAAE,CAAC;QAC5B,SAAS,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACjD,CAAC;IAGD,IAAI,QAAQ,KAAK,OAAO,MAAM,EAAE,CAAC;QAGhC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QAGtC,SAAS,CAAC,gBAAgB,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC;QAG9D,SAAS,CAAC,gBAAgB,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,CAAC;IAC7D,CAAC;IAED,IAAI,QAAQ,KAAK,OAAO,SAAS,EAAE,CAAC;QACnC,SAAS,CAAC,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC,CAAC;AAQJ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACvC,MAAM,CAAC;IAEP,GAAG,kBAAkB,CAAC,KAAK;IAC3B,GAAG,iBAAiB,CAAC,KAAK;IAC1B,GAAG,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;CACzC,CAAC;KACD,IAAI,CAAC;IACL,SAAS,EAAE,IAAI;IACf,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;CACtB,CAAC,CAAC"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "@prosopo/common";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { type AccessPolicy } from "#policy/accessPolicy.js";
|
|
4
|
-
import type { AccessRulesReader } from "#policy/accessRules.js";
|
|
5
|
-
export declare enum ScopeMatch {
|
|
6
|
-
Exact = "exact",
|
|
7
|
-
Greedy = "greedy"
|
|
8
|
-
}
|
|
9
|
-
export declare const policyFilterSchema: z.ZodObject<{
|
|
10
|
-
policyScope: z.ZodOptional<z.ZodObject<{
|
|
11
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
12
|
-
ruleGroupId: z.ZodOptional<z.ZodString>;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
clientId?: string | undefined;
|
|
15
|
-
ruleGroupId?: string | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
clientId?: string | undefined;
|
|
18
|
-
ruleGroupId?: string | undefined;
|
|
19
|
-
}>>;
|
|
20
|
-
policyScopeMatch: z.ZodDefault<z.ZodNativeEnum<typeof ScopeMatch>>;
|
|
21
|
-
userScope: z.ZodOptional<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
|
|
22
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
23
|
-
numericIp: z.ZodOptional<z.ZodBigInt>;
|
|
24
|
-
numericIpMaskMin: z.ZodOptional<z.ZodBigInt>;
|
|
25
|
-
numericIpMaskMax: z.ZodOptional<z.ZodBigInt>;
|
|
26
|
-
ja4Hash: z.ZodOptional<z.ZodString>;
|
|
27
|
-
headersHash: z.ZodOptional<z.ZodString>;
|
|
28
|
-
userAgentHash: z.ZodOptional<z.ZodString>;
|
|
29
|
-
}, {
|
|
30
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
31
|
-
ipMask: z.ZodOptional<z.ZodString>;
|
|
32
|
-
userAgent: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}>, "strip", z.ZodTypeAny, {
|
|
34
|
-
userId?: string | undefined;
|
|
35
|
-
numericIp?: bigint | undefined;
|
|
36
|
-
numericIpMaskMin?: bigint | undefined;
|
|
37
|
-
numericIpMaskMax?: bigint | undefined;
|
|
38
|
-
ja4Hash?: string | undefined;
|
|
39
|
-
headersHash?: string | undefined;
|
|
40
|
-
userAgentHash?: string | undefined;
|
|
41
|
-
ip?: string | undefined;
|
|
42
|
-
ipMask?: string | undefined;
|
|
43
|
-
userAgent?: string | undefined;
|
|
44
|
-
}, {
|
|
45
|
-
userId?: string | undefined;
|
|
46
|
-
numericIp?: bigint | undefined;
|
|
47
|
-
numericIpMaskMin?: bigint | undefined;
|
|
48
|
-
numericIpMaskMax?: bigint | undefined;
|
|
49
|
-
ja4Hash?: string | undefined;
|
|
50
|
-
headersHash?: string | undefined;
|
|
51
|
-
userAgentHash?: string | undefined;
|
|
52
|
-
ip?: string | undefined;
|
|
53
|
-
ipMask?: string | undefined;
|
|
54
|
-
userAgent?: string | undefined;
|
|
55
|
-
}>, {
|
|
56
|
-
userId?: string | undefined;
|
|
57
|
-
numericIp?: bigint | undefined;
|
|
58
|
-
numericIpMaskMin?: bigint | undefined;
|
|
59
|
-
numericIpMaskMax?: bigint | undefined;
|
|
60
|
-
ja4Hash?: string | undefined;
|
|
61
|
-
headersHash?: string | undefined;
|
|
62
|
-
userAgentHash?: string | undefined;
|
|
63
|
-
}, {
|
|
64
|
-
userId?: string | undefined;
|
|
65
|
-
numericIp?: bigint | undefined;
|
|
66
|
-
numericIpMaskMin?: bigint | undefined;
|
|
67
|
-
numericIpMaskMax?: bigint | undefined;
|
|
68
|
-
ja4Hash?: string | undefined;
|
|
69
|
-
headersHash?: string | undefined;
|
|
70
|
-
userAgentHash?: string | undefined;
|
|
71
|
-
ip?: string | undefined;
|
|
72
|
-
ipMask?: string | undefined;
|
|
73
|
-
userAgent?: string | undefined;
|
|
74
|
-
}>>;
|
|
75
|
-
userScopeMatch: z.ZodDefault<z.ZodNativeEnum<typeof ScopeMatch>>;
|
|
76
|
-
}, "strip", z.ZodTypeAny, {
|
|
77
|
-
policyScopeMatch: ScopeMatch;
|
|
78
|
-
userScopeMatch: ScopeMatch;
|
|
79
|
-
userScope?: {
|
|
80
|
-
userId?: string | undefined;
|
|
81
|
-
numericIp?: bigint | undefined;
|
|
82
|
-
numericIpMaskMin?: bigint | undefined;
|
|
83
|
-
numericIpMaskMax?: bigint | undefined;
|
|
84
|
-
ja4Hash?: string | undefined;
|
|
85
|
-
headersHash?: string | undefined;
|
|
86
|
-
userAgentHash?: string | undefined;
|
|
87
|
-
} | undefined;
|
|
88
|
-
policyScope?: {
|
|
89
|
-
clientId?: string | undefined;
|
|
90
|
-
ruleGroupId?: string | undefined;
|
|
91
|
-
} | undefined;
|
|
92
|
-
}, {
|
|
93
|
-
userScope?: {
|
|
94
|
-
userId?: string | undefined;
|
|
95
|
-
numericIp?: bigint | undefined;
|
|
96
|
-
numericIpMaskMin?: bigint | undefined;
|
|
97
|
-
numericIpMaskMax?: bigint | undefined;
|
|
98
|
-
ja4Hash?: string | undefined;
|
|
99
|
-
headersHash?: string | undefined;
|
|
100
|
-
userAgentHash?: string | undefined;
|
|
101
|
-
ip?: string | undefined;
|
|
102
|
-
ipMask?: string | undefined;
|
|
103
|
-
userAgent?: string | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
policyScope?: {
|
|
106
|
-
clientId?: string | undefined;
|
|
107
|
-
ruleGroupId?: string | undefined;
|
|
108
|
-
} | undefined;
|
|
109
|
-
policyScopeMatch?: ScopeMatch | undefined;
|
|
110
|
-
userScopeMatch?: ScopeMatch | undefined;
|
|
111
|
-
}>;
|
|
112
|
-
export type PolicyFilter = z.input<typeof policyFilterSchema>;
|
|
113
|
-
export type ResolveAccessPolicy = (filter: PolicyFilter) => Promise<AccessPolicy | undefined>;
|
|
114
|
-
export declare const createAccessPolicyResolver: (accessRulesReader: AccessRulesReader, logger: Logger) => ResolveAccessPolicy;
|
|
115
|
-
//# sourceMappingURL=accessPolicyResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessPolicyResolver.d.ts","sourceRoot":"","sources":["../src/accessPolicyResolver.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;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AE;IAE5E,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAC/B,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,KAAK,OAAO,UAAU,CAAC,QAAQ,CACvD,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC,CAAC"}
|
package/dist/accessRules.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { accessPolicySchema, policyScopeSchema, userScopeSchema } from "#policy/accessPolicy.js";
|
|
3
|
-
import type { PolicyFilter } from "#policy/accessPolicyResolver.js";
|
|
4
|
-
export declare const accessRuleSchema: z.ZodObject<typeof accessPolicySchema.shape & typeof policyScopeSchema.shape & typeof userScopeSchema.shape>;
|
|
5
|
-
export type AccessRule = z.infer<typeof accessRuleSchema>;
|
|
6
|
-
export type AccessRulesReader = {
|
|
7
|
-
findRules(filter: PolicyFilter, skipEmptyUserScopes?: boolean): Promise<AccessRule[]>;
|
|
8
|
-
findRuleIds(filter: PolicyFilter): Promise<string[]>;
|
|
9
|
-
};
|
|
10
|
-
export type AccessRulesWriter = {
|
|
11
|
-
insertRule(rule: AccessRule, expirationTimestampSeconds?: number): Promise<string>;
|
|
12
|
-
deleteRules(ruleIds: string[]): Promise<void>;
|
|
13
|
-
deleteAllRules(): Promise<number>;
|
|
14
|
-
};
|
|
15
|
-
export type AccessRulesStorage = AccessRulesReader & AccessRulesWriter;
|
|
16
|
-
//# sourceMappingURL=accessRules.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessRules.d.ts","sourceRoot":"","sources":["../src/accessRules.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACN,kBAAkB,EAClB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CAAC;IAEZ,GAAG,kBAAkB,CAAC,KAAK;IAC3B,GAAG,iBAAiB,CAAC,KAAK;IAC1B,GAAG,eAAe,CAAC,KAAK;CACxB,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ApiRoute, ApiRoutesProvider } from "@prosopo/api-route";
|
|
2
|
-
import type { AccessRulesStorage } from "#policy/accessRules.js";
|
|
3
|
-
export declare enum accessRuleApiPaths {
|
|
4
|
-
INSERT_MANY = "/v1/prosopo/user-access-policy/rules/insert-many",
|
|
5
|
-
DELETE_MANY = "/v1/prosopo/user-access-policy/rules/delete-many",
|
|
6
|
-
DELETE_ALL = "/v1/prosopo/user-access-policy/rules/delete-all"
|
|
7
|
-
}
|
|
8
|
-
export declare class AccessRuleApiRoutes implements ApiRoutesProvider {
|
|
9
|
-
private readonly accessRulesStorage;
|
|
10
|
-
constructor(accessRulesStorage: AccessRulesStorage);
|
|
11
|
-
getRoutes(): ApiRoute[];
|
|
12
|
-
}
|
|
13
|
-
export declare const getExpressApiRuleRateLimits: () => {
|
|
14
|
-
"/v1/prosopo/user-access-policy/rules/insert-many": {
|
|
15
|
-
windowMs: number;
|
|
16
|
-
limit: number;
|
|
17
|
-
};
|
|
18
|
-
"/v1/prosopo/user-access-policy/rules/delete-many": {
|
|
19
|
-
windowMs: number;
|
|
20
|
-
limit: number;
|
|
21
|
-
};
|
|
22
|
-
"/v1/prosopo/user-access-policy/rules/delete-all": {
|
|
23
|
-
windowMs: number;
|
|
24
|
-
limit: number;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=accessRuleApiRoutes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessRuleApiRoutes.d.ts","sourceRoot":"","sources":["../../src/api/accessRuleApiRoutes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,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import type { AccessRulesStorage } from "#policy/accessRules.js";
|
|
4
|
-
export declare const deleteAllRulesEndpointSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
5
|
-
export type DeleteAllRulesEndpointSchema = typeof deleteAllRulesEndpointSchema;
|
|
6
|
-
export declare class DeleteAllRulesEndpoint implements ApiEndpoint<DeleteAllRulesEndpointSchema> {
|
|
7
|
-
private readonly accessRulesStorage;
|
|
8
|
-
constructor(accessRulesStorage: AccessRulesStorage);
|
|
9
|
-
processRequest(args: z.infer<DeleteAllRulesEndpointSchema>): Promise<ApiEndpointResponse>;
|
|
10
|
-
getRequestArgsSchema(): DeleteAllRulesEndpointSchema;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=deleteAllRulesEndpoint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteAllRulesEndpoint.d.ts","sourceRoot":"","sources":["../../src/api/deleteAllRulesEndpoint.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,mBAAmB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,eAAO,MAAM,4BAA4B,gDAAe,CAAC;AAEzD,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAC;AAE/E,qBAAa,sBACZ,YAAW,WAAW,CAAC,4BAA4B,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB;IAEpE,cAAc,CACnB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC;IAW/B,oBAAoB,IAAI,4BAA4B;CAGpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteAllRulesEndpoint.js","sourceRoot":"","sources":["../../src/api/deleteAllRulesEndpoint.ts"],"names":[],"mappings":"AAcA,OAAO,EAGN,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAIzD,MAAM,OAAO,sBAAsB;IAGlC,YAAoC,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAE9E,KAAK,CAAC,cAAc,CACnB,IAA2C;QAE3C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC;QAEpE,OAAO;YACN,MAAM,EAAE,yBAAyB,CAAC,OAAO;YACzC,IAAI,EAAE;gBACL,aAAa,EAAE,YAAY;aAC3B;SACD,CAAC;IACH,CAAC;IAED,oBAAoB;QACnB,OAAO,4BAA4B,CAAC;IACrC,CAAC;CACD"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { type ApiEndpoint, type ApiEndpointResponse } from "@prosopo/api-route";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { AccessRulesStorage } from "#policy/accessRules.js";
|
|
4
|
-
export declare const deleteRulesEndpointSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
-
policyScope: z.ZodOptional<z.ZodObject<{
|
|
6
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
7
|
-
ruleGroupId: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
clientId?: string | undefined;
|
|
10
|
-
ruleGroupId?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
clientId?: string | undefined;
|
|
13
|
-
ruleGroupId?: string | undefined;
|
|
14
|
-
}>>;
|
|
15
|
-
policyScopeMatch: z.ZodDefault<z.ZodNativeEnum<typeof import("#policy/accessPolicyResolver.js").ScopeMatch>>;
|
|
16
|
-
userScope: z.ZodOptional<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
|
|
17
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
18
|
-
numericIp: z.ZodOptional<z.ZodBigInt>;
|
|
19
|
-
numericIpMaskMin: z.ZodOptional<z.ZodBigInt>;
|
|
20
|
-
numericIpMaskMax: z.ZodOptional<z.ZodBigInt>;
|
|
21
|
-
ja4Hash: z.ZodOptional<z.ZodString>;
|
|
22
|
-
headersHash: z.ZodOptional<z.ZodString>;
|
|
23
|
-
userAgentHash: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, {
|
|
25
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
26
|
-
ipMask: z.ZodOptional<z.ZodString>;
|
|
27
|
-
userAgent: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}>, "strip", z.ZodTypeAny, {
|
|
29
|
-
userId?: string | undefined;
|
|
30
|
-
numericIp?: bigint | undefined;
|
|
31
|
-
numericIpMaskMin?: bigint | undefined;
|
|
32
|
-
numericIpMaskMax?: bigint | undefined;
|
|
33
|
-
ja4Hash?: string | undefined;
|
|
34
|
-
headersHash?: string | undefined;
|
|
35
|
-
userAgentHash?: string | undefined;
|
|
36
|
-
ip?: string | undefined;
|
|
37
|
-
ipMask?: string | undefined;
|
|
38
|
-
userAgent?: string | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
userId?: string | undefined;
|
|
41
|
-
numericIp?: bigint | undefined;
|
|
42
|
-
numericIpMaskMin?: bigint | undefined;
|
|
43
|
-
numericIpMaskMax?: bigint | undefined;
|
|
44
|
-
ja4Hash?: string | undefined;
|
|
45
|
-
headersHash?: string | undefined;
|
|
46
|
-
userAgentHash?: string | undefined;
|
|
47
|
-
ip?: string | undefined;
|
|
48
|
-
ipMask?: string | undefined;
|
|
49
|
-
userAgent?: string | undefined;
|
|
50
|
-
}>, {
|
|
51
|
-
userId?: string | undefined;
|
|
52
|
-
numericIp?: bigint | undefined;
|
|
53
|
-
numericIpMaskMin?: bigint | undefined;
|
|
54
|
-
numericIpMaskMax?: bigint | undefined;
|
|
55
|
-
ja4Hash?: string | undefined;
|
|
56
|
-
headersHash?: string | undefined;
|
|
57
|
-
userAgentHash?: string | undefined;
|
|
58
|
-
}, {
|
|
59
|
-
userId?: string | undefined;
|
|
60
|
-
numericIp?: bigint | undefined;
|
|
61
|
-
numericIpMaskMin?: bigint | undefined;
|
|
62
|
-
numericIpMaskMax?: bigint | undefined;
|
|
63
|
-
ja4Hash?: string | undefined;
|
|
64
|
-
headersHash?: string | undefined;
|
|
65
|
-
userAgentHash?: string | undefined;
|
|
66
|
-
ip?: string | undefined;
|
|
67
|
-
ipMask?: string | undefined;
|
|
68
|
-
userAgent?: string | undefined;
|
|
69
|
-
}>>;
|
|
70
|
-
userScopeMatch: z.ZodDefault<z.ZodNativeEnum<typeof import("#policy/accessPolicyResolver.js").ScopeMatch>>;
|
|
71
|
-
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
policyScopeMatch: import("#policy/accessPolicyResolver.js").ScopeMatch;
|
|
73
|
-
userScopeMatch: import("#policy/accessPolicyResolver.js").ScopeMatch;
|
|
74
|
-
userScope?: {
|
|
75
|
-
userId?: string | undefined;
|
|
76
|
-
numericIp?: bigint | undefined;
|
|
77
|
-
numericIpMaskMin?: bigint | undefined;
|
|
78
|
-
numericIpMaskMax?: bigint | undefined;
|
|
79
|
-
ja4Hash?: string | undefined;
|
|
80
|
-
headersHash?: string | undefined;
|
|
81
|
-
userAgentHash?: string | undefined;
|
|
82
|
-
} | undefined;
|
|
83
|
-
policyScope?: {
|
|
84
|
-
clientId?: string | undefined;
|
|
85
|
-
ruleGroupId?: string | undefined;
|
|
86
|
-
} | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
userScope?: {
|
|
89
|
-
userId?: string | undefined;
|
|
90
|
-
numericIp?: bigint | undefined;
|
|
91
|
-
numericIpMaskMin?: bigint | undefined;
|
|
92
|
-
numericIpMaskMax?: bigint | undefined;
|
|
93
|
-
ja4Hash?: string | undefined;
|
|
94
|
-
headersHash?: string | undefined;
|
|
95
|
-
userAgentHash?: string | undefined;
|
|
96
|
-
ip?: string | undefined;
|
|
97
|
-
ipMask?: string | undefined;
|
|
98
|
-
userAgent?: string | undefined;
|
|
99
|
-
} | undefined;
|
|
100
|
-
policyScope?: {
|
|
101
|
-
clientId?: string | undefined;
|
|
102
|
-
ruleGroupId?: string | undefined;
|
|
103
|
-
} | undefined;
|
|
104
|
-
policyScopeMatch?: import("#policy/accessPolicyResolver.js").ScopeMatch | undefined;
|
|
105
|
-
userScopeMatch?: import("#policy/accessPolicyResolver.js").ScopeMatch | undefined;
|
|
106
|
-
}>, "many">;
|
|
107
|
-
export type DeleteRulesEndpointSchemaOutput = z.output<typeof deleteRulesEndpointSchema>;
|
|
108
|
-
export type DeleteRulesEndpointSchemaInput = z.input<typeof deleteRulesEndpointSchema>;
|
|
109
|
-
export type DeleteRulesEndpointSchema = typeof deleteRulesEndpointSchema;
|
|
110
|
-
export declare class DeleteRulesEndpoint implements ApiEndpoint<DeleteRulesEndpointSchema> {
|
|
111
|
-
private readonly accessRulesStorage;
|
|
112
|
-
constructor(accessRulesStorage: AccessRulesStorage);
|
|
113
|
-
processRequest(args: DeleteRulesEndpointSchemaInput): Promise<ApiEndpointResponse>;
|
|
114
|
-
getRequestArgsSchema(): DeleteRulesEndpointSchema;
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=deleteRulesEndpoint.d.ts.map
|