@adguard/hostlist-compiler 2.1.1 → 3.0.0-beta.0
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/.markdownlint.json +29 -0
- package/.markdownlintignore +1 -0
- package/AGENTS.md +310 -98
- package/CHANGELOG.md +59 -8
- package/DEPLOYMENT.md +171 -0
- package/DEVELOPMENT.md +171 -72
- package/README.md +238 -143
- package/examples/china/README.md +2 -2
- package/examples/energized/README.md +4 -2
- package/examples/sdn/README.md +2 -2
- package/examples/whitelist/README.md +2 -2
- package/package.json +24 -18
- package/src/cli.js +53 -31
- package/src/compile-source.js +4 -3
- package/src/configuration.js +132 -2
- package/src/download.js +27 -0
- package/src/filter.js +2 -2
- package/src/index.d.ts +2 -0
- package/src/index.js +16 -50
- package/src/{transformations/ip-normalize.js → ip-normalize.js} +2 -2
- package/src/schemas/configuration.schema.js +137 -0
- package/src/source-types.js +17 -0
- package/src/transformations/enum.js +49 -0
- package/src/transformations/include.js +1 -1
- package/src/transformations/transform.js +40 -74
- package/src/transformations/validate-allow-ip-and-public-suffix.js +1 -1
- package/src/transformations/validate-allow-ip.js +1 -1
- package/src/utils.js +1284 -0
- package/src/validation-conflicts.js +106 -0
- package/test/cli-error-output.test.js +305 -0
- package/test/cli.test.js +47 -0
- package/test/compile-source.test.js +167 -7
- package/test/configuration.test.js +438 -0
- package/test/download.test.js +260 -0
- package/test/helpers/http-mock.js +94 -0
- package/test/index.test.js +497 -4
- package/test/{transformations/ip-normalize.test.js → ip-normalize.test.js} +1 -1
- package/test/resolve-include.test.js +8 -8
- package/test/transformations/covert-to-ascii.test.js +1 -1
- package/test/transformations/exclude.test.js +2 -2
- package/test/transformations/include.test.js +9 -3
- package/test/transformations/ip-alignment.test.js +1 -1
- package/test/transformations/transform.test.js +66 -1
- package/test/utils.test.js +1559 -0
- package/test/validation-conflicts.test.js +230 -0
- package/src/schemas/configuration.schema.json +0 -369
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
const Ajv = require('ajv');
|
|
2
|
+
const { TRANSFORMATIONS, VALIDATION_TRANSFORMATIONS } = require('../src/transformations/enum');
|
|
3
|
+
const {
|
|
4
|
+
checkIncompatibleValidationTransformations,
|
|
5
|
+
checkCrossLevelValidationConflicts,
|
|
6
|
+
buildSchemaConflictRules,
|
|
7
|
+
} = require('../src/validation-conflicts');
|
|
8
|
+
|
|
9
|
+
describe('Validation conflicts', () => {
|
|
10
|
+
describe('checkIncompatibleValidationTransformations', () => {
|
|
11
|
+
it.each([
|
|
12
|
+
['Validate', 'ValidateAllowIp'],
|
|
13
|
+
['Validate', 'ValidateAllowPublicSuffix'],
|
|
14
|
+
['Validate', 'ValidateAllowIpAndPublicSuffix'],
|
|
15
|
+
['ValidateAllowIp', 'ValidateAllowPublicSuffix'],
|
|
16
|
+
['ValidateAllowIp', 'ValidateAllowIpAndPublicSuffix'],
|
|
17
|
+
['ValidateAllowPublicSuffix', 'ValidateAllowIpAndPublicSuffix'],
|
|
18
|
+
])('throws when incompatible validation transformations are combined: %s + %s', (first, second) => {
|
|
19
|
+
const transformations = [first, second];
|
|
20
|
+
|
|
21
|
+
expect(() => checkIncompatibleValidationTransformations(transformations))
|
|
22
|
+
.toThrow(`Validation transformations cannot be combined: ${transformations.join(', ')}.`);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('throws when three validation transformations are combined', () => {
|
|
26
|
+
const transformations = ['Validate', 'ValidateAllowIp', 'ValidateAllowPublicSuffix'];
|
|
27
|
+
|
|
28
|
+
expect(() => checkIncompatibleValidationTransformations(transformations))
|
|
29
|
+
.toThrow(`Validation transformations cannot be combined: ${transformations.join(', ')}.`);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('does not throw for a single validation transformation', () => {
|
|
33
|
+
expect(() => checkIncompatibleValidationTransformations(['Validate'])).not.toThrow();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('does not throw without validation transformations', () => {
|
|
37
|
+
expect(() => checkIncompatibleValidationTransformations(['RemoveComments', 'Compress'])).not.toThrow();
|
|
38
|
+
expect(() => checkIncompatibleValidationTransformations([])).not.toThrow();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('checkCrossLevelValidationConflicts', () => {
|
|
43
|
+
it('throws when validation transformations are used at both source and top level', () => {
|
|
44
|
+
const configuration = {
|
|
45
|
+
transformations: ['Validate'],
|
|
46
|
+
sources: [
|
|
47
|
+
{
|
|
48
|
+
source: 'test.txt',
|
|
49
|
+
transformations: ['ValidateAllowPublicSuffix'],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
expect(() => checkCrossLevelValidationConflicts(configuration)).toThrow(
|
|
55
|
+
/Validation transformations cannot be used at both source and top level/,
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('does not include source credentials in the conflict error', () => {
|
|
60
|
+
const configuration = {
|
|
61
|
+
transformations: ['Validate'],
|
|
62
|
+
sources: [
|
|
63
|
+
{
|
|
64
|
+
source: 'https://user:secret@example.org/test.txt',
|
|
65
|
+
transformations: ['ValidateAllowPublicSuffix'],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
let message = '';
|
|
71
|
+
try {
|
|
72
|
+
checkCrossLevelValidationConflicts(configuration);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
message = error.message;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
expect(message).toContain('Source "https://example.org/test.txt"');
|
|
78
|
+
expect(message).not.toContain('secret');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('does not include a quote or space in the username in the conflict error', () => {
|
|
82
|
+
const configuration = {
|
|
83
|
+
transformations: ['Validate'],
|
|
84
|
+
sources: [
|
|
85
|
+
{
|
|
86
|
+
source: "https://o'brien:secret@example.org/test.txt",
|
|
87
|
+
transformations: ['ValidateAllowPublicSuffix'],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
let message = '';
|
|
93
|
+
try {
|
|
94
|
+
checkCrossLevelValidationConflicts(configuration);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
message = error.message;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
expect(message).toContain('Source "https://example.org/test.txt"');
|
|
100
|
+
expect(message).not.toContain('secret');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('does not include credentials from a prefixed source in the conflict error', () => {
|
|
104
|
+
const configuration = {
|
|
105
|
+
transformations: ['Validate'],
|
|
106
|
+
sources: [
|
|
107
|
+
{
|
|
108
|
+
source: ' https://user:secret@example.org/test.txt',
|
|
109
|
+
transformations: ['ValidateAllowPublicSuffix'],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
let message = '';
|
|
115
|
+
try {
|
|
116
|
+
checkCrossLevelValidationConflicts(configuration);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
message = error.message;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
expect(message).toContain('Source " https://example.org/test.txt"');
|
|
122
|
+
expect(message).not.toContain('secret');
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('does not include a literal @ password from a path-less source in the conflict error', () => {
|
|
126
|
+
const configuration = {
|
|
127
|
+
transformations: ['Validate'],
|
|
128
|
+
sources: [
|
|
129
|
+
{
|
|
130
|
+
source: 'https://user:p@s s@example.org',
|
|
131
|
+
transformations: ['ValidateAllowPublicSuffix'],
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
let message = '';
|
|
137
|
+
try {
|
|
138
|
+
checkCrossLevelValidationConflicts(configuration);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
message = error.message;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
expect(message).toContain('Source "https://example.org"');
|
|
144
|
+
expect(message).not.toContain('p@s s');
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('does not throw when a validation transformation is used at source level only', () => {
|
|
148
|
+
const configuration = {
|
|
149
|
+
sources: [
|
|
150
|
+
{
|
|
151
|
+
source: 'test.txt',
|
|
152
|
+
transformations: ['ValidateAllowPublicSuffix'],
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
expect(() => checkCrossLevelValidationConflicts(configuration)).not.toThrow();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('does not throw when a validation transformation is used at top level only', () => {
|
|
161
|
+
const configuration = {
|
|
162
|
+
transformations: ['Validate'],
|
|
163
|
+
sources: [
|
|
164
|
+
{
|
|
165
|
+
source: 'test.txt',
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
expect(() => checkCrossLevelValidationConflicts(configuration)).not.toThrow();
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it('does not throw without validation transformations', () => {
|
|
174
|
+
const configuration = {
|
|
175
|
+
sources: [
|
|
176
|
+
{
|
|
177
|
+
source: 'test.txt',
|
|
178
|
+
transformations: ['RemoveComments'],
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
expect(() => checkCrossLevelValidationConflicts(configuration)).not.toThrow();
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe('buildSchemaConflictRules', () => {
|
|
188
|
+
it('generates a rule for each unordered pair of validation transformations', () => {
|
|
189
|
+
// A literal list, independent of the implementation's pairing logic.
|
|
190
|
+
const expectedPairs = [
|
|
191
|
+
['Validate', 'ValidateAllowIp'],
|
|
192
|
+
['Validate', 'ValidateAllowPublicSuffix'],
|
|
193
|
+
['Validate', 'ValidateAllowIpAndPublicSuffix'],
|
|
194
|
+
['ValidateAllowIp', 'ValidateAllowPublicSuffix'],
|
|
195
|
+
['ValidateAllowIp', 'ValidateAllowIpAndPublicSuffix'],
|
|
196
|
+
['ValidateAllowPublicSuffix', 'ValidateAllowIpAndPublicSuffix'],
|
|
197
|
+
];
|
|
198
|
+
|
|
199
|
+
const generatedPairs = buildSchemaConflictRules().map((rule) => rule.not.allOf
|
|
200
|
+
.map((part) => part.contains.const));
|
|
201
|
+
|
|
202
|
+
expect(generatedPairs).toEqual(expectedPairs);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('rejects a transformations list with multiple validation transformations', () => {
|
|
206
|
+
const ajv = new Ajv();
|
|
207
|
+
const validate = ajv.compile({ type: 'array', allOf: buildSchemaConflictRules() });
|
|
208
|
+
|
|
209
|
+
expect(validate(['Validate', 'ValidateAllowIp'])).toBe(false);
|
|
210
|
+
expect(validate(['Validate', 'ValidateAllowIp', 'ValidateAllowPublicSuffix'])).toBe(false);
|
|
211
|
+
expect(validate(['Validate'])).toBe(true);
|
|
212
|
+
expect(validate(['RemoveComments', 'Compress'])).toBe(true);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it('keeps every validation transformation frozen', () => {
|
|
217
|
+
expect(Object.isFrozen(VALIDATION_TRANSFORMATIONS)).toBe(true);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('keeps every validation transformation a member of the TRANSFORMATIONS enum', () => {
|
|
221
|
+
// Regression guard: VALIDATION_TRANSFORMATIONS is built from TRANSFORMATIONS.*
|
|
222
|
+
// references (see src/transformations/enum.js), so a hand-typed literal or a
|
|
223
|
+
// renamed enum key would produce an entry that is not a member of the enum.
|
|
224
|
+
const transformationNames = Object.values(TRANSFORMATIONS);
|
|
225
|
+
|
|
226
|
+
VALIDATION_TRANSFORMATIONS.forEach((name) => {
|
|
227
|
+
expect(transformationNames).toContain(name);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
});
|
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "https://adguarad.com/hostlist-compiler.configuration.schema.json",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"title": "Hostlist compiler configuration",
|
|
5
|
-
"description": "Configuration for the hostlist compiler",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"name": {
|
|
9
|
-
"description": "Filter list name",
|
|
10
|
-
"type": "string",
|
|
11
|
-
"minLength": 1
|
|
12
|
-
},
|
|
13
|
-
"description": {
|
|
14
|
-
"description": "Filter list description",
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
"homepage": {
|
|
18
|
-
"description": "Filter list homepage",
|
|
19
|
-
"type": "string"
|
|
20
|
-
},
|
|
21
|
-
"license": {
|
|
22
|
-
"description": "Filter list license",
|
|
23
|
-
"type": "string"
|
|
24
|
-
},
|
|
25
|
-
"version": {
|
|
26
|
-
"description": "Filter version",
|
|
27
|
-
"type": "string"
|
|
28
|
-
},
|
|
29
|
-
"sources": {
|
|
30
|
-
"description": "An array of the filter list sources",
|
|
31
|
-
"type": "array",
|
|
32
|
-
"minItems": 1,
|
|
33
|
-
"items": {
|
|
34
|
-
"$ref": "#/definitions/source"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"transformations": {
|
|
38
|
-
"description": "A list of the transformations that will be applied",
|
|
39
|
-
"type": "array",
|
|
40
|
-
"allOf": [
|
|
41
|
-
{
|
|
42
|
-
"not": {
|
|
43
|
-
"allOf": [
|
|
44
|
-
{
|
|
45
|
-
"contains": {
|
|
46
|
-
"const": "Validate"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"contains": {
|
|
51
|
-
"const": "ValidateAllowIp"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"not": {
|
|
59
|
-
"allOf": [
|
|
60
|
-
{
|
|
61
|
-
"contains": {
|
|
62
|
-
"const": "Validate"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"contains": {
|
|
67
|
-
"const": "ValidateAllowPublicSuffix"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"not": {
|
|
75
|
-
"allOf": [
|
|
76
|
-
{
|
|
77
|
-
"contains": {
|
|
78
|
-
"const": "ValidateAllowIp"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"contains": {
|
|
83
|
-
"const": "ValidateAllowPublicSuffix"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"not": {
|
|
91
|
-
"allOf": [
|
|
92
|
-
{
|
|
93
|
-
"contains": {
|
|
94
|
-
"const": "Validate"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"contains": {
|
|
99
|
-
"const": "ValidateAllowIpAndPublicSuffix"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"not": {
|
|
107
|
-
"allOf": [
|
|
108
|
-
{
|
|
109
|
-
"contains": {
|
|
110
|
-
"const": "ValidateAllowIp"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"contains": {
|
|
115
|
-
"const": "ValidateAllowIpAndPublicSuffix"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"not": {
|
|
123
|
-
"allOf": [
|
|
124
|
-
{
|
|
125
|
-
"contains": {
|
|
126
|
-
"const": "ValidateAllowPublicSuffix"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"contains": {
|
|
131
|
-
"const": "ValidateAllowIpAndPublicSuffix"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
"items": {
|
|
139
|
-
"type": "string",
|
|
140
|
-
"enum": [
|
|
141
|
-
"RemoveComments",
|
|
142
|
-
"RemoveModifiers",
|
|
143
|
-
"Compress",
|
|
144
|
-
"Validate",
|
|
145
|
-
"ValidateAllowIp",
|
|
146
|
-
"ValidateAllowPublicSuffix",
|
|
147
|
-
"ValidateAllowIpAndPublicSuffix",
|
|
148
|
-
"Deduplicate",
|
|
149
|
-
"InvertAllow",
|
|
150
|
-
"RemoveEmptyLines",
|
|
151
|
-
"TrimLines",
|
|
152
|
-
"InsertFinalNewLine",
|
|
153
|
-
"ConvertToAscii"
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"exclusions": {
|
|
158
|
-
"description": "A list of rules (or wildcards) to exclude from the source.",
|
|
159
|
-
"type": "array",
|
|
160
|
-
"items": {
|
|
161
|
-
"type": "string"
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"exclusions_sources": {
|
|
165
|
-
"description": "An array of exclusions sources.",
|
|
166
|
-
"type": "array",
|
|
167
|
-
"items": {
|
|
168
|
-
"type": "string"
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
"inclusions": {
|
|
172
|
-
"description": "A list of wildcards to include from the source. All rules that don't match these wildcards won't be included.",
|
|
173
|
-
"type": "array",
|
|
174
|
-
"items": {
|
|
175
|
-
"type": "string"
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
"inclusions_sources": {
|
|
179
|
-
"description": "A list of files with inclusions.",
|
|
180
|
-
"type": "array",
|
|
181
|
-
"items": {
|
|
182
|
-
"type": "string"
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
"required": [
|
|
187
|
-
"name",
|
|
188
|
-
"sources"
|
|
189
|
-
],
|
|
190
|
-
"additionalProperties": false,
|
|
191
|
-
"definitions": {
|
|
192
|
-
"source": {
|
|
193
|
-
"description": "A source for the filter list",
|
|
194
|
-
"type": "object",
|
|
195
|
-
"properties": {
|
|
196
|
-
"name": {
|
|
197
|
-
"description": "Name of the source",
|
|
198
|
-
"type": "string",
|
|
199
|
-
"minLength": 1
|
|
200
|
-
},
|
|
201
|
-
"source": {
|
|
202
|
-
"description": "Path to a file or a URL",
|
|
203
|
-
"type": "string",
|
|
204
|
-
"minLength": 1
|
|
205
|
-
},
|
|
206
|
-
"type": {
|
|
207
|
-
"description": "Type of the source",
|
|
208
|
-
"type": "string",
|
|
209
|
-
"enum": [
|
|
210
|
-
"adblock",
|
|
211
|
-
"hosts"
|
|
212
|
-
]
|
|
213
|
-
},
|
|
214
|
-
"transformations": {
|
|
215
|
-
"description": "A list of the transformations that will be applied",
|
|
216
|
-
"type": "array",
|
|
217
|
-
"allOf": [
|
|
218
|
-
{
|
|
219
|
-
"not": {
|
|
220
|
-
"allOf": [
|
|
221
|
-
{
|
|
222
|
-
"contains": {
|
|
223
|
-
"const": "Validate"
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"contains": {
|
|
228
|
-
"const": "ValidateAllowIp"
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"not": {
|
|
236
|
-
"allOf": [
|
|
237
|
-
{
|
|
238
|
-
"contains": {
|
|
239
|
-
"const": "Validate"
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
"contains": {
|
|
244
|
-
"const": "ValidateAllowPublicSuffix"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
]
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"not": {
|
|
252
|
-
"allOf": [
|
|
253
|
-
{
|
|
254
|
-
"contains": {
|
|
255
|
-
"const": "ValidateAllowIp"
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"contains": {
|
|
260
|
-
"const": "ValidateAllowPublicSuffix"
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
]
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"not": {
|
|
268
|
-
"allOf": [
|
|
269
|
-
{
|
|
270
|
-
"contains": {
|
|
271
|
-
"const": "Validate"
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"contains": {
|
|
276
|
-
"const": "ValidateAllowIpAndPublicSuffix"
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
]
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
"not": {
|
|
284
|
-
"allOf": [
|
|
285
|
-
{
|
|
286
|
-
"contains": {
|
|
287
|
-
"const": "ValidateAllowIp"
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
"contains": {
|
|
292
|
-
"const": "ValidateAllowIpAndPublicSuffix"
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
]
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"not": {
|
|
300
|
-
"allOf": [
|
|
301
|
-
{
|
|
302
|
-
"contains": {
|
|
303
|
-
"const": "ValidateAllowPublicSuffix"
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"contains": {
|
|
308
|
-
"const": "ValidateAllowIpAndPublicSuffix"
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
]
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
],
|
|
315
|
-
"items": {
|
|
316
|
-
"type": "string",
|
|
317
|
-
"enum": [
|
|
318
|
-
"RemoveComments",
|
|
319
|
-
"RemoveModifiers",
|
|
320
|
-
"Compress",
|
|
321
|
-
"Validate",
|
|
322
|
-
"ValidateAllowIp",
|
|
323
|
-
"ValidateAllowPublicSuffix",
|
|
324
|
-
"ValidateAllowIpAndPublicSuffix",
|
|
325
|
-
"Deduplicate",
|
|
326
|
-
"InvertAllow",
|
|
327
|
-
"RemoveEmptyLines",
|
|
328
|
-
"TrimLines",
|
|
329
|
-
"InsertFinalNewLine",
|
|
330
|
-
"ConvertToAscii"
|
|
331
|
-
]
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
"exclusions": {
|
|
335
|
-
"description": "A list of rules (or wildcards) to exclude from the source.",
|
|
336
|
-
"type": "array",
|
|
337
|
-
"items": {
|
|
338
|
-
"type": "string"
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
"exclusions_sources": {
|
|
342
|
-
"description": "An array of exclusions sources.",
|
|
343
|
-
"type": "array",
|
|
344
|
-
"items": {
|
|
345
|
-
"type": "string"
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
"inclusions": {
|
|
349
|
-
"description": "A list of wildcards to include from the source. All rules that don't match these wildcards won't be included.",
|
|
350
|
-
"type": "array",
|
|
351
|
-
"items": {
|
|
352
|
-
"type": "string"
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
"inclusions_sources": {
|
|
356
|
-
"description": "A list of files with inclusions.",
|
|
357
|
-
"type": "array",
|
|
358
|
-
"items": {
|
|
359
|
-
"type": "string"
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
"required": [
|
|
364
|
-
"source"
|
|
365
|
-
],
|
|
366
|
-
"additionalProperties": false
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|