promptfoo 0.96.0 → 0.96.1
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/README.md +1 -0
- package/dist/package.json +10 -10
- package/dist/src/app/assets/{index-Dwt7E2K_.js → index-CL29fyye.js} +55 -55
- package/dist/src/app/assets/{index.es-CooNf3HB.js → index.es-CsYHA4xg.js} +1 -1
- package/dist/src/app/assets/{sync-Bj1WJrHQ.js → sync-B9AjROwZ.js} +1 -1
- package/dist/src/app/index.html +1 -1
- package/dist/src/assertions/answerRelevance.d.ts +3 -0
- package/dist/src/assertions/answerRelevance.d.ts.map +1 -0
- package/dist/src/assertions/answerRelevance.js +19 -0
- package/dist/src/assertions/answerRelevance.js.map +1 -0
- package/dist/src/assertions/bleu.d.ts +4 -14
- package/dist/src/assertions/bleu.d.ts.map +1 -1
- package/dist/src/assertions/bleu.js +19 -3
- package/dist/src/assertions/bleu.js.map +1 -1
- package/dist/src/assertions/classifier.d.ts +3 -0
- package/dist/src/assertions/classifier.d.ts.map +1 -0
- package/dist/src/assertions/classifier.js +22 -0
- package/dist/src/assertions/classifier.js.map +1 -0
- package/dist/src/assertions/contains.d.ts +8 -0
- package/dist/src/assertions/contains.d.ts.map +1 -0
- package/dist/src/assertions/contains.js +110 -0
- package/dist/src/assertions/contains.js.map +1 -0
- package/dist/src/assertions/contextFaithfulness.d.ts +3 -0
- package/dist/src/assertions/contextFaithfulness.d.ts.map +1 -0
- package/dist/src/assertions/contextFaithfulness.js +19 -0
- package/dist/src/assertions/contextFaithfulness.js.map +1 -0
- package/dist/src/assertions/contextRecall.d.ts +3 -0
- package/dist/src/assertions/contextRecall.d.ts.map +1 -0
- package/dist/src/assertions/contextRecall.js +18 -0
- package/dist/src/assertions/contextRecall.js.map +1 -0
- package/dist/src/assertions/contextRelevance.d.ts +3 -0
- package/dist/src/assertions/contextRelevance.d.ts.map +1 -0
- package/dist/src/assertions/contextRelevance.js +19 -0
- package/dist/src/assertions/contextRelevance.js.map +1 -0
- package/dist/src/assertions/cost.d.ts +3 -0
- package/dist/src/assertions/cost.d.ts.map +1 -0
- package/dist/src/assertions/cost.js +22 -0
- package/dist/src/assertions/cost.js.map +1 -0
- package/dist/src/assertions/equals.d.ts +4 -0
- package/dist/src/assertions/equals.d.ts.map +1 -0
- package/dist/src/assertions/equals.js +32 -0
- package/dist/src/assertions/equals.js.map +1 -0
- package/dist/src/assertions/factuality.d.ts +3 -0
- package/dist/src/assertions/factuality.d.ts.map +1 -0
- package/dist/src/assertions/factuality.js +25 -0
- package/dist/src/assertions/factuality.js.map +1 -0
- package/dist/src/assertions/index.d.ts.map +1 -1
- package/dist/src/assertions/index.js +89 -752
- package/dist/src/assertions/index.js.map +1 -1
- package/dist/src/assertions/javascript.d.ts +4 -0
- package/dist/src/assertions/javascript.d.ts.map +1 -0
- package/dist/src/assertions/javascript.js +94 -0
- package/dist/src/assertions/javascript.js.map +1 -0
- package/dist/src/assertions/json.d.ts +3 -4
- package/dist/src/assertions/json.d.ts.map +1 -1
- package/dist/src/assertions/json.js +2 -2
- package/dist/src/assertions/json.js.map +1 -1
- package/dist/src/assertions/latency.d.ts +3 -0
- package/dist/src/assertions/latency.d.ts.map +1 -0
- package/dist/src/assertions/latency.js +22 -0
- package/dist/src/assertions/latency.js.map +1 -0
- package/dist/src/assertions/levenshtein.d.ts +3 -0
- package/dist/src/assertions/levenshtein.d.ts.map +1 -0
- package/dist/src/assertions/levenshtein.js +22 -0
- package/dist/src/assertions/levenshtein.js.map +1 -0
- package/dist/src/assertions/llmRubric.d.ts +3 -0
- package/dist/src/assertions/llmRubric.d.ts.map +1 -0
- package/dist/src/assertions/llmRubric.js +22 -0
- package/dist/src/assertions/llmRubric.js.map +1 -0
- package/dist/src/assertions/modelGradedClosedQa.d.ts +3 -0
- package/dist/src/assertions/modelGradedClosedQa.d.ts.map +1 -0
- package/dist/src/assertions/modelGradedClosedQa.js +25 -0
- package/dist/src/assertions/modelGradedClosedQa.js.map +1 -0
- package/dist/src/assertions/moderation.d.ts +3 -0
- package/dist/src/assertions/moderation.d.ts.map +1 -0
- package/dist/src/assertions/moderation.js +41 -0
- package/dist/src/assertions/moderation.js.map +1 -0
- package/dist/src/assertions/openai.d.ts +5 -0
- package/dist/src/assertions/openai.d.ts.map +1 -0
- package/dist/src/assertions/openai.js +68 -0
- package/dist/src/assertions/openai.js.map +1 -0
- package/dist/src/assertions/perplexity.d.ts +3 -3
- package/dist/src/assertions/perplexity.d.ts.map +1 -1
- package/dist/src/assertions/perplexity.js +2 -2
- package/dist/src/assertions/perplexity.js.map +1 -1
- package/dist/src/assertions/python.d.ts +4 -0
- package/dist/src/assertions/python.d.ts.map +1 -0
- package/dist/src/assertions/python.js +107 -0
- package/dist/src/assertions/python.js.map +1 -0
- package/dist/src/assertions/redteam.d.ts +3 -0
- package/dist/src/assertions/redteam.d.ts.map +1 -0
- package/dist/src/assertions/redteam.js +29 -0
- package/dist/src/assertions/redteam.js.map +1 -0
- package/dist/src/assertions/regex.d.ts +3 -0
- package/dist/src/assertions/regex.d.ts.map +1 -0
- package/dist/src/assertions/regex.js +34 -0
- package/dist/src/assertions/regex.js.map +1 -0
- package/dist/src/assertions/rouge.d.ts +3 -0
- package/dist/src/assertions/rouge.d.ts.map +1 -0
- package/dist/src/assertions/rouge.js +47 -0
- package/dist/src/assertions/rouge.js.map +1 -0
- package/dist/src/assertions/similar.d.ts +3 -0
- package/dist/src/assertions/similar.d.ts.map +1 -0
- package/dist/src/assertions/similar.js +40 -0
- package/dist/src/assertions/similar.js.map +1 -0
- package/dist/src/assertions/sql.d.ts +3 -3
- package/dist/src/assertions/sql.d.ts.map +1 -1
- package/dist/src/assertions/sql.js +14 -3
- package/dist/src/assertions/sql.js.map +1 -1
- package/dist/src/assertions/startsWith.d.ts +3 -0
- package/dist/src/assertions/startsWith.d.ts.map +1 -0
- package/dist/src/assertions/startsWith.js +22 -0
- package/dist/src/assertions/startsWith.js.map +1 -0
- package/dist/src/assertions/utils.d.ts +1 -0
- package/dist/src/assertions/utils.d.ts.map +1 -1
- package/dist/src/assertions/utils.js +7 -0
- package/dist/src/assertions/utils.js.map +1 -1
- package/dist/src/assertions/webhook.d.ts +3 -0
- package/dist/src/assertions/webhook.d.ts.map +1 -0
- package/dist/src/assertions/webhook.js +55 -0
- package/dist/src/assertions/webhook.js.map +1 -0
- package/dist/src/assertions/xml.d.ts +2 -0
- package/dist/src/assertions/xml.d.ts.map +1 -1
- package/dist/src/assertions/xml.js +29 -0
- package/dist/src/assertions/xml.js.map +1 -1
- package/dist/src/fetch.d.ts.map +1 -1
- package/dist/src/fetch.js +8 -1
- package/dist/src/fetch.js.map +1 -1
- package/dist/src/providers/anthropic.d.ts.map +1 -1
- package/dist/src/providers/anthropic.js +12 -2
- package/dist/src/providers/anthropic.js.map +1 -1
- package/dist/src/providers/bedrock.js +1 -1
- package/dist/src/redteam/constants.d.ts +4 -3
- package/dist/src/redteam/constants.d.ts.map +1 -1
- package/dist/src/redteam/constants.js +43 -35
- package/dist/src/redteam/constants.js.map +1 -1
- package/dist/src/redteam/providers/goat.d.ts +2 -0
- package/dist/src/redteam/providers/goat.d.ts.map +1 -1
- package/dist/src/redteam/providers/goat.js +9 -2
- package/dist/src/redteam/providers/goat.js.map +1 -1
- package/dist/src/types/index.d.ts +108 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +21 -26
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/util/config/load.js +3 -2
- package/dist/src/util/config/load.js.map +1 -1
- package/dist/test/assertions/bleu.test.js +38 -13
- package/dist/test/assertions/bleu.test.js.map +1 -1
- package/dist/test/assertions/sql.test.js +268 -167
- package/dist/test/assertions/sql.test.js.map +1 -1
- package/dist/test/fetch.test.js +17 -0
- package/dist/test/fetch.test.js.map +1 -1
- package/dist/test/providers/anthropic.test.js +44 -5
- package/dist/test/providers/anthropic.test.js.map +1 -1
- package/dist/test/util/config/load.test.js +44 -1
- package/dist/test/util/config/load.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/dist/src/redteam/eval/excessive-agency/llm_rubric-20240617.json +0 -10
- package/dist/src/redteam/eval/excessive-agency/llm_rubric-20240618.json +0 -10
- package/dist/src/redteam/eval/harmful/llm_rubric-20240723.json +0 -10
- package/dist/src/redteam/eval/harmful/llm_rubric-20240724.json +0 -10
|
@@ -5,175 +5,276 @@ const sql_1 = require("../../src/assertions/sql");
|
|
|
5
5
|
const assertion = {
|
|
6
6
|
type: 'is-sql',
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
describe('is-sql assertion', () => {
|
|
9
|
+
// -------------------------------------------------- Basic Tests ------------------------------------------------------ //
|
|
10
|
+
describe('Basic tests', () => {
|
|
11
|
+
it('should pass when the output string is a valid SQL statement', async () => {
|
|
12
|
+
const renderedValue = undefined;
|
|
13
|
+
const outputString = 'SELECT id, name FROM users';
|
|
14
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
15
|
+
assertion,
|
|
16
|
+
renderedValue,
|
|
17
|
+
outputString,
|
|
18
|
+
inverse: false,
|
|
19
|
+
});
|
|
20
|
+
expect(result).toEqual({
|
|
21
|
+
assertion,
|
|
22
|
+
pass: true,
|
|
23
|
+
reason: 'Assertion passed',
|
|
24
|
+
score: 1,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
it('should fail when the SQL statement contains a syntax error in the ORDER BY clause', async () => {
|
|
28
|
+
const renderedValue = undefined;
|
|
29
|
+
const outputString = 'SELECT * FROM orders ORDERY BY order_date';
|
|
30
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
31
|
+
assertion,
|
|
32
|
+
renderedValue,
|
|
33
|
+
outputString,
|
|
34
|
+
inverse: false,
|
|
35
|
+
});
|
|
36
|
+
expect(result).toEqual({
|
|
37
|
+
pass: false,
|
|
38
|
+
score: 0,
|
|
39
|
+
reason: 'SQL statement does not conform to the provided MySQL database syntax.',
|
|
40
|
+
assertion,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
it('should fail when the SQL statement uses a reserved keyword as a table name', async () => {
|
|
44
|
+
const renderedValue = undefined;
|
|
45
|
+
const outputString = 'SELECT * FROM select WHERE id = 1';
|
|
46
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
47
|
+
assertion,
|
|
48
|
+
renderedValue,
|
|
49
|
+
outputString,
|
|
50
|
+
inverse: false,
|
|
51
|
+
});
|
|
52
|
+
expect(result).toEqual({
|
|
53
|
+
pass: false,
|
|
54
|
+
score: 0,
|
|
55
|
+
reason: 'SQL statement does not conform to the provided MySQL database syntax.',
|
|
56
|
+
assertion,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
it('should fail when the SQL statement has an incorrect DELETE syntax', async () => {
|
|
60
|
+
const renderedValue = undefined;
|
|
61
|
+
const outputString = 'DELETE employees WHERE id = 1';
|
|
62
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
63
|
+
assertion,
|
|
64
|
+
renderedValue,
|
|
65
|
+
outputString,
|
|
66
|
+
inverse: false,
|
|
67
|
+
});
|
|
68
|
+
expect(result).toEqual({
|
|
69
|
+
pass: false,
|
|
70
|
+
score: 0,
|
|
71
|
+
reason: 'SQL statement does not conform to the provided MySQL database syntax.',
|
|
72
|
+
assertion,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* Catches an incorrect output from node-sql-parser package
|
|
77
|
+
* The parser cannot identify the syntax error: missing comma between column names
|
|
78
|
+
*/
|
|
79
|
+
// it('should fail when the output string is an invalid SQL statement', () => {
|
|
80
|
+
// const renderedValue = undefined;
|
|
81
|
+
// const outputString = 'SELECT first_name last_name FROM employees';
|
|
82
|
+
// const result = testFunction(renderedValue, outputString, false);
|
|
83
|
+
// expect(result.pass).toBe(false);
|
|
84
|
+
// expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
85
|
+
// });
|
|
86
|
+
/**
|
|
87
|
+
* Catches an incorrect output from node-sql-parser package
|
|
88
|
+
* The parser cannot identify the syntax error: misuse of backticks (`)
|
|
89
|
+
*/
|
|
90
|
+
// it('should fail when the output string is an invalid SQL statement', () => {
|
|
91
|
+
// const renderedValue = undefined;
|
|
92
|
+
// const outputString = 'SELECT * FROM `employees`';
|
|
93
|
+
// const result = testFunction(renderedValue, outputString, false);
|
|
94
|
+
// expect(result.pass).toBe(false);
|
|
95
|
+
// expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
96
|
+
// });
|
|
16
97
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
98
|
+
// ------------------------------------------ Database Specific Syntax Tests ------------------------------------------- //
|
|
99
|
+
describe('Database Specific Syntax Tests', () => {
|
|
100
|
+
it('should fail if the output SQL statement conforms to MySQL but not PostgreSQL', async () => {
|
|
101
|
+
const renderedValue = {
|
|
102
|
+
databaseType: 'PostgreSQL',
|
|
103
|
+
};
|
|
104
|
+
const outputString = `SELECT * FROM employees WHERE id = 1 LOCK IN SHARE MODE`;
|
|
105
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
106
|
+
assertion,
|
|
107
|
+
renderedValue,
|
|
108
|
+
outputString,
|
|
109
|
+
inverse: false,
|
|
110
|
+
});
|
|
111
|
+
expect(result).toEqual({
|
|
112
|
+
pass: false,
|
|
113
|
+
score: 0,
|
|
114
|
+
reason: 'SQL statement does not conform to the provided PostgreSQL database syntax.',
|
|
115
|
+
assertion,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
it('should fail if the output SQL statement conforms to PostgreSQL but not MySQL', async () => {
|
|
119
|
+
const renderedValue = {
|
|
120
|
+
databaseType: 'MySQL',
|
|
121
|
+
};
|
|
122
|
+
const outputString = `SELECT first_name, last_name FROM employees WHERE first_name ILIKE 'john%'`;
|
|
123
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
124
|
+
assertion,
|
|
125
|
+
renderedValue,
|
|
126
|
+
outputString,
|
|
127
|
+
inverse: false,
|
|
128
|
+
});
|
|
129
|
+
expect(result).toEqual({
|
|
130
|
+
pass: false,
|
|
131
|
+
score: 0,
|
|
132
|
+
reason: 'SQL statement does not conform to the provided MySQL database syntax.',
|
|
133
|
+
assertion,
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
it('should pass if the output SQL statement conforms to PostgreSQL but not MySQL', async () => {
|
|
137
|
+
const renderedValue = {
|
|
138
|
+
databaseType: 'PostgreSQL',
|
|
139
|
+
};
|
|
140
|
+
const outputString = `SELECT first_name, last_name FROM employees WHERE first_name ILIKE 'john%'`;
|
|
141
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
142
|
+
assertion,
|
|
143
|
+
renderedValue,
|
|
144
|
+
outputString,
|
|
145
|
+
inverse: false,
|
|
146
|
+
});
|
|
147
|
+
expect(result).toEqual({
|
|
148
|
+
pass: true,
|
|
149
|
+
score: 1,
|
|
150
|
+
reason: 'Assertion passed',
|
|
151
|
+
assertion,
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* Catches an incorrect output from node-sql-parser package
|
|
156
|
+
* The parser cannot differentiate certain syntax between MySQL and PostgreSQL
|
|
157
|
+
*/
|
|
158
|
+
// it('should fail if the output SQL statement conforms to PostgreSQL but not MySQL', () => {
|
|
159
|
+
// const renderedValue = {
|
|
160
|
+
// databaseType: 'MySQL',
|
|
161
|
+
// };
|
|
162
|
+
// const outputString = `SELECT generate_series(1, 10);`;
|
|
163
|
+
// const result = testFunction(renderedValue, outputString, false);
|
|
164
|
+
// expect(result.pass).toBe(false);
|
|
165
|
+
// expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
166
|
+
// });
|
|
23
167
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
168
|
+
// ------------------------------------------- White Table/Column List Tests ------------------------------------------- //
|
|
169
|
+
describe('White Table/Column List Tests', () => {
|
|
170
|
+
it('should fail if the output SQL statement violate allowedTables', async () => {
|
|
171
|
+
const renderedValue = {
|
|
172
|
+
databaseType: 'MySQL',
|
|
173
|
+
allowedTables: ['(select|update|insert|delete)::null::departments'],
|
|
174
|
+
};
|
|
175
|
+
const outputString = `SELECT * FROM employees`;
|
|
176
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
177
|
+
assertion,
|
|
178
|
+
renderedValue,
|
|
179
|
+
outputString,
|
|
180
|
+
inverse: false,
|
|
181
|
+
});
|
|
182
|
+
expect(result).toEqual({
|
|
183
|
+
pass: false,
|
|
184
|
+
score: 0,
|
|
185
|
+
reason: `SQL validation failed: authority = 'select::null::employees' is required in table whiteList to execute SQL = 'SELECT * FROM employees'.`,
|
|
186
|
+
assertion,
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
it('should pass if the output SQL statement does not violate allowedTables', async () => {
|
|
190
|
+
const renderedValue = {
|
|
191
|
+
databaseType: 'MySQL',
|
|
192
|
+
allowedTables: ['(select|update|insert|delete)::null::departments'],
|
|
193
|
+
};
|
|
194
|
+
const outputString = `SELECT * FROM departments`;
|
|
195
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
196
|
+
assertion,
|
|
197
|
+
renderedValue,
|
|
198
|
+
outputString,
|
|
199
|
+
inverse: false,
|
|
200
|
+
});
|
|
201
|
+
expect(result).toEqual({
|
|
202
|
+
pass: true,
|
|
203
|
+
score: 1,
|
|
204
|
+
reason: 'Assertion passed',
|
|
205
|
+
assertion,
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
it('should fail if the output SQL statement violate allowedColumns', async () => {
|
|
209
|
+
const renderedValue = {
|
|
210
|
+
databaseType: 'MySQL',
|
|
211
|
+
allowedColumns: ['select::null::name', 'update::null::id'],
|
|
212
|
+
};
|
|
213
|
+
const outputString = `SELECT id FROM t`;
|
|
214
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
215
|
+
assertion,
|
|
216
|
+
renderedValue,
|
|
217
|
+
outputString,
|
|
218
|
+
inverse: false,
|
|
219
|
+
});
|
|
220
|
+
expect(result).toEqual({
|
|
221
|
+
pass: false,
|
|
222
|
+
score: 0,
|
|
223
|
+
reason: `SQL validation failed: authority = 'select::null::id' is required in column whiteList to execute SQL = 'SELECT id FROM t'.`,
|
|
224
|
+
assertion,
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
it('should pass if the output SQL statement does not violate allowedColumns', async () => {
|
|
228
|
+
const renderedValue = {
|
|
229
|
+
databaseType: 'MySQL',
|
|
230
|
+
allowedColumns: ['insert::department::dept_name', 'insert::department::location'],
|
|
231
|
+
};
|
|
232
|
+
const outputString = `INSERT INTO department (dept_name, location) VALUES ('Sales', 'New York')`;
|
|
233
|
+
const result = await (0, sql_1.handleIsSql)({
|
|
234
|
+
assertion,
|
|
235
|
+
renderedValue,
|
|
236
|
+
outputString,
|
|
237
|
+
inverse: false,
|
|
238
|
+
});
|
|
239
|
+
expect(result).toEqual({
|
|
240
|
+
pass: true,
|
|
241
|
+
score: 1,
|
|
242
|
+
reason: 'Assertion passed',
|
|
243
|
+
assertion,
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
/**
|
|
247
|
+
* Catches an incorrect output from node-sql-parser package
|
|
248
|
+
* Error message: message: "authority = 'update::null::id' is required in column whiteList to execute SQL = 'UPDATE a SET id = 1'"
|
|
249
|
+
* issue: In this test case, the 'whiteListCheck' function in node-sql-parser requires an explicit 'update::null::id'
|
|
250
|
+
* in the whitelist to allow SQL statement like `UPDATE a SET id = 1`, despite the presence
|
|
251
|
+
* of rule `update::a::id`
|
|
252
|
+
*/
|
|
253
|
+
// it('should pass if the output SQL statement does not violate allowedColumns', () => {
|
|
254
|
+
// const renderedValue = {
|
|
255
|
+
// databaseType: 'MySQL',
|
|
256
|
+
// allowedColumns: ['update::a::id'],
|
|
257
|
+
// };
|
|
258
|
+
// const outputString = `UPDATE a SET id = 1`;
|
|
259
|
+
// const result = testFunction(renderedValue, outputString, false);
|
|
260
|
+
// expect(result.pass).toBe(true);
|
|
261
|
+
// expect(result.reason).toBe('Assertion passed');
|
|
262
|
+
// });
|
|
263
|
+
/**
|
|
264
|
+
* Similar issue: the error message is Error: authority = 'select::null::id' is required
|
|
265
|
+
* in column whiteList to execute SQL = 'UPDATE employee SET salary = 50000 WHERE id = 1'
|
|
266
|
+
*/
|
|
267
|
+
// it('should pass if the output SQL statement does not violate allowedColumns', () => {
|
|
268
|
+
// const renderedValue = {
|
|
269
|
+
// databaseType: 'MySQL',
|
|
270
|
+
// allowedColumns: ['update::employee::salary','select::employee::id'],
|
|
271
|
+
// };
|
|
272
|
+
// const outputString = `UPDATE employee SET salary = 50000 WHERE id = 1`;
|
|
273
|
+
// const result = testFunction(renderedValue, outputString, false);
|
|
274
|
+
// expect(result.pass).toBe(true);
|
|
275
|
+
// expect(result.reason).toBe('Assertion passed');
|
|
276
|
+
// });
|
|
30
277
|
});
|
|
31
|
-
|
|
32
|
-
const renderedValue = undefined;
|
|
33
|
-
const outputString = 'DELETE employees WHERE id = 1';
|
|
34
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
35
|
-
expect(result.pass).toBe(false);
|
|
36
|
-
expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
37
|
-
});
|
|
38
|
-
/**
|
|
39
|
-
* Catches an incorrect output from node-sql-parser package
|
|
40
|
-
* The parser cannot identify the syntax error: missing comma between column names
|
|
41
|
-
*/
|
|
42
|
-
// it('should fail when the output string is an invalid SQL statement', () => {
|
|
43
|
-
// const renderedValue = undefined;
|
|
44
|
-
// const outputString = 'SELECT first_name last_name FROM employees';
|
|
45
|
-
// const result = testFunction(renderedValue, outputString, false);
|
|
46
|
-
// expect(result.pass).toBe(false);
|
|
47
|
-
// expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
48
|
-
// });
|
|
49
|
-
/**
|
|
50
|
-
* Catches an incorrect output from node-sql-parser package
|
|
51
|
-
* The parser cannot identify the syntax error: misuse of backticks (`)
|
|
52
|
-
*/
|
|
53
|
-
// it('should fail when the output string is an invalid SQL statement', () => {
|
|
54
|
-
// const renderedValue = undefined;
|
|
55
|
-
// const outputString = 'SELECT * FROM `employees`';
|
|
56
|
-
// const result = testFunction(renderedValue, outputString, false);
|
|
57
|
-
// expect(result.pass).toBe(false);
|
|
58
|
-
// expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
59
|
-
// });
|
|
60
|
-
});
|
|
61
|
-
// ------------------------------------------ Database Specific Syntax Tests ------------------------------------------- //
|
|
62
|
-
describe('Database Specific Syntax Tests', () => {
|
|
63
|
-
it('should fail if the output SQL statement conforms to MySQL but not PostgreSQL', async () => {
|
|
64
|
-
const renderedValue = {
|
|
65
|
-
databaseType: 'PostgreSQL',
|
|
66
|
-
};
|
|
67
|
-
const outputString = `SELECT * FROM employees WHERE id = 1 LOCK IN SHARE MODE`;
|
|
68
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
69
|
-
expect(result.pass).toBe(false);
|
|
70
|
-
expect(result.reason).toBe('SQL statement does not conform to the provided PostgreSQL database syntax.');
|
|
71
|
-
});
|
|
72
|
-
it('should fail if the output SQL statement conforms to PostgreSQL but not MySQL', async () => {
|
|
73
|
-
const renderedValue = {
|
|
74
|
-
databaseType: 'MySQL',
|
|
75
|
-
};
|
|
76
|
-
const outputString = `SELECT first_name, last_name FROM employees WHERE first_name ILIKE 'john%'`;
|
|
77
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
78
|
-
expect(result.pass).toBe(false);
|
|
79
|
-
expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
80
|
-
});
|
|
81
|
-
it('should pass if the output SQL statement conforms to PostgreSQL but not MySQL', async () => {
|
|
82
|
-
const renderedValue = {
|
|
83
|
-
databaseType: 'PostgreSQL',
|
|
84
|
-
};
|
|
85
|
-
const outputString = `SELECT first_name, last_name FROM employees WHERE first_name ILIKE 'john%'`;
|
|
86
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
87
|
-
expect(result.pass).toBe(true);
|
|
88
|
-
expect(result.reason).toBe('Assertion passed');
|
|
89
|
-
});
|
|
90
|
-
/**
|
|
91
|
-
* Catches an incorrect output from node-sql-parser package
|
|
92
|
-
* The paser cannot differentiate certain syntax between MySQL and PostgreSQL
|
|
93
|
-
*/
|
|
94
|
-
// it('should fail if the output SQL statement conforms to PostgreSQL but not MySQL', () => {
|
|
95
|
-
// const renderedValue = {
|
|
96
|
-
// databaseType: 'MySQL',
|
|
97
|
-
// };
|
|
98
|
-
// const outputString = `SELECT generate_series(1, 10);`;
|
|
99
|
-
// const result = testFunction(renderedValue, outputString, false);
|
|
100
|
-
// expect(result.pass).toBe(false);
|
|
101
|
-
// expect(result.reason).toBe('SQL statement does not conform to the provided MySQL database syntax.');
|
|
102
|
-
// });
|
|
103
|
-
});
|
|
104
|
-
// ------------------------------------------- White Table/Column List Tests ------------------------------------------- //
|
|
105
|
-
describe('White Table/Column List Tests', () => {
|
|
106
|
-
it('should fail if the output SQL statement violate allowedTables', async () => {
|
|
107
|
-
const renderedValue = {
|
|
108
|
-
databaseType: 'MySQL',
|
|
109
|
-
allowedTables: ['(select|update|insert|delete)::null::departments'],
|
|
110
|
-
};
|
|
111
|
-
const outputString = `SELECT * FROM employees`;
|
|
112
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
113
|
-
expect(result.pass).toBe(false);
|
|
114
|
-
expect(result.reason).toBe(`SQL validation failed: authority = 'select::null::employees' is required in table whiteList to execute SQL = 'SELECT * FROM employees'.`);
|
|
115
|
-
});
|
|
116
|
-
it('should pass if the output SQL statement does not violate allowedTables', async () => {
|
|
117
|
-
const renderedValue = {
|
|
118
|
-
databaseType: 'MySQL',
|
|
119
|
-
allowedTables: ['(select|update|insert|delete)::null::departments'],
|
|
120
|
-
};
|
|
121
|
-
const outputString = `SELECT * FROM departments`;
|
|
122
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
123
|
-
expect(result.pass).toBe(true);
|
|
124
|
-
expect(result.reason).toBe('Assertion passed');
|
|
125
|
-
});
|
|
126
|
-
it('should fail if the output SQL statement violate allowedColumns', async () => {
|
|
127
|
-
const renderedValue = {
|
|
128
|
-
databaseType: 'MySQL',
|
|
129
|
-
allowedColumns: ['select::null::name', 'update::null::id'],
|
|
130
|
-
};
|
|
131
|
-
const outputString = `SELECT id FROM t`;
|
|
132
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
133
|
-
expect(result.pass).toBe(false);
|
|
134
|
-
expect(result.reason).toBe(`SQL validation failed: authority = 'select::null::id' is required in column whiteList to execute SQL = 'SELECT id FROM t'.`);
|
|
135
|
-
});
|
|
136
|
-
it('should pass if the output SQL statement does not violate allowedColumns', async () => {
|
|
137
|
-
const renderedValue = {
|
|
138
|
-
databaseType: 'MySQL',
|
|
139
|
-
allowedColumns: ['insert::department::dept_name', 'insert::department::location'],
|
|
140
|
-
};
|
|
141
|
-
const outputString = `INSERT INTO department (dept_name, location) VALUES ('Sales', 'New York')`;
|
|
142
|
-
const result = await (0, sql_1.isSql)(outputString, renderedValue, false, assertion);
|
|
143
|
-
expect(result.pass).toBe(true);
|
|
144
|
-
expect(result.reason).toBe('Assertion passed');
|
|
145
|
-
});
|
|
146
|
-
/**
|
|
147
|
-
* Catches an incorrect output from node-sql-parser package
|
|
148
|
-
* Error message: message: "authority = 'update::null::id' is required in column whiteList to execute SQL = 'UPDATE a SET id = 1'"
|
|
149
|
-
* issue: In this test case, the 'whiteListCheck' function in node-sql-parser requires an explicit 'update::null::id'
|
|
150
|
-
* in the whitelist to allow SQL statement like `UPDATE a SET id = 1`, despite the presence
|
|
151
|
-
* of rule `update::a::id`
|
|
152
|
-
*/
|
|
153
|
-
// it('should pass if the output SQL statement does not violate allowedColumns', () => {
|
|
154
|
-
// const renderedValue = {
|
|
155
|
-
// databaseType: 'MySQL',
|
|
156
|
-
// allowedColumns: ['update::a::id'],
|
|
157
|
-
// };
|
|
158
|
-
// const outputString = `UPDATE a SET id = 1`;
|
|
159
|
-
// const result = testFunction(renderedValue, outputString, false);
|
|
160
|
-
// expect(result.pass).toBe(true);
|
|
161
|
-
// expect(result.reason).toBe('Assertion passed');
|
|
162
|
-
// });
|
|
163
|
-
/**
|
|
164
|
-
* Similar issue: the error message is Error: authority = 'select::null::id' is required
|
|
165
|
-
* in column whiteList to execute SQL = 'UPDATE employee SET salary = 50000 WHERE id = 1'
|
|
166
|
-
*/
|
|
167
|
-
// it('should pass if the output SQL statement does not violate allowedColumns', () => {
|
|
168
|
-
// const renderedValue = {
|
|
169
|
-
// databaseType: 'MySQL',
|
|
170
|
-
// allowedColumns: ['update::employee::salary','select::employee::id'],
|
|
171
|
-
// };
|
|
172
|
-
// const outputString = `UPDATE employee SET salary = 50000 WHERE id = 1`;
|
|
173
|
-
// const result = testFunction(renderedValue, outputString, false);
|
|
174
|
-
// expect(result.pass).toBe(true);
|
|
175
|
-
// expect(result.reason).toBe('Assertion passed');
|
|
176
|
-
// });
|
|
278
|
+
/* eslint-enable jest/no-commented-out-tests */
|
|
177
279
|
});
|
|
178
|
-
/* eslint-enable jest/no-commented-out-tests */
|
|
179
280
|
//# sourceMappingURL=sql.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql.test.js","sourceRoot":"","sources":["../../../test/assertions/sql.test.ts"],"names":[],"mappings":";;AAAA,gDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"sql.test.js","sourceRoot":"","sources":["../../../test/assertions/sql.test.ts"],"names":[],"mappings":";;AAAA,gDAAgD;AAChD,kDAAuD;AAGvD,MAAM,SAAS,GAAc;IAC3B,IAAI,EAAE,Q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ACjD,CAAC,CAAC,CAAC"}
|
package/dist/test/fetch.test.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const proxy_agent_1 = require("proxy-agent");
|
|
7
|
+
const constants_1 = require("../src/constants");
|
|
7
8
|
const envars_1 = require("../src/envars");
|
|
8
9
|
const fetch_1 = require("../src/fetch");
|
|
9
10
|
const logger_1 = __importDefault(require("../src/logger"));
|
|
@@ -52,6 +53,15 @@ describe('fetchWithProxy', () => {
|
|
|
52
53
|
afterEach(() => {
|
|
53
54
|
jest.clearAllMocks();
|
|
54
55
|
});
|
|
56
|
+
it('should add version header to all requests', async () => {
|
|
57
|
+
const url = 'https://example.com/api';
|
|
58
|
+
await (0, fetch_1.fetchWithProxy)(url);
|
|
59
|
+
expect(global.fetch).toHaveBeenCalledWith(url, expect.objectContaining({
|
|
60
|
+
headers: expect.objectContaining({
|
|
61
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
62
|
+
}),
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
55
65
|
it('should handle URLs with basic auth credentials', async () => {
|
|
56
66
|
const url = 'https://username:password@example.com/api';
|
|
57
67
|
const options = { headers: { 'Content-Type': 'application/json' } };
|
|
@@ -60,6 +70,7 @@ describe('fetchWithProxy', () => {
|
|
|
60
70
|
headers: {
|
|
61
71
|
'Content-Type': 'application/json',
|
|
62
72
|
Authorization: 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=',
|
|
73
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
63
74
|
},
|
|
64
75
|
}));
|
|
65
76
|
});
|
|
@@ -70,6 +81,7 @@ describe('fetchWithProxy', () => {
|
|
|
70
81
|
expect(global.fetch).toHaveBeenCalledWith(url, expect.objectContaining({
|
|
71
82
|
headers: {
|
|
72
83
|
'Content-Type': 'application/json',
|
|
84
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
73
85
|
},
|
|
74
86
|
}));
|
|
75
87
|
});
|
|
@@ -92,6 +104,7 @@ describe('fetchWithProxy', () => {
|
|
|
92
104
|
headers: {
|
|
93
105
|
Authorization: 'Bearer token123',
|
|
94
106
|
'Content-Type': 'application/json',
|
|
107
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
95
108
|
},
|
|
96
109
|
}));
|
|
97
110
|
});
|
|
@@ -107,6 +120,7 @@ describe('fetchWithProxy', () => {
|
|
|
107
120
|
expect(global.fetch).toHaveBeenCalledWith('https://example.com/api', expect.objectContaining({
|
|
108
121
|
headers: {
|
|
109
122
|
Authorization: 'Bearer token123',
|
|
123
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
110
124
|
},
|
|
111
125
|
}));
|
|
112
126
|
});
|
|
@@ -116,6 +130,7 @@ describe('fetchWithProxy', () => {
|
|
|
116
130
|
expect(global.fetch).toHaveBeenCalledWith('https://example.com/api', expect.objectContaining({
|
|
117
131
|
headers: {
|
|
118
132
|
Authorization: 'Basic OnBhc3N3b3Jk',
|
|
133
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
119
134
|
},
|
|
120
135
|
}));
|
|
121
136
|
});
|
|
@@ -125,6 +140,7 @@ describe('fetchWithProxy', () => {
|
|
|
125
140
|
expect(global.fetch).toHaveBeenCalledWith('https://example.com/api', expect.objectContaining({
|
|
126
141
|
headers: {
|
|
127
142
|
Authorization: 'Basic dXNlcm5hbWU6', // Base64 encoded 'username:'
|
|
143
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
128
144
|
},
|
|
129
145
|
}));
|
|
130
146
|
});
|
|
@@ -142,6 +158,7 @@ describe('fetchWithProxy', () => {
|
|
|
142
158
|
'Content-Type': 'application/json',
|
|
143
159
|
'X-Custom-Header': 'value',
|
|
144
160
|
Authorization: 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=',
|
|
161
|
+
'x-promptfoo-version': constants_1.VERSION,
|
|
145
162
|
},
|
|
146
163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