@memberjunction/generic-database-provider 6.2.0-edge.3 → 6.2.0-edge.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"UserCache.js","sourceRoot":"","sources":["../src/UserCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAA6B,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAgB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAa7D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,SAAU,SAAQ,aAAwB;IAQnD;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;QAXV;;;;WAIG;QACK,WAAM,GAAe,EAAE,CAAC;IAOhC,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACI,aAAa;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,CAAa,CAAC;IACpH,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,QAA8B,EAAE,qBAA8B;QACjF,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC7C,IAAI,KAAK,EAAE,CAAC;gBACV,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;gBAEpB,4EAA4E;gBAC5E,IAAI,qBAAqB,IAAI,qBAAqB,GAAG,CAAC;oBACpD,UAAU,CAAC,GAAG,EAAE;wBACd,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;oBAChD,CA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EAAE,CAAC;YACvB,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC"}
@@ -0,0 +1,259 @@
1
+ import { type EntityInfo, type PlatformSQL, type UserInfo } from '@memberjunction/core';
2
+ import { SQLParser } from '@memberjunction/sql-parser';
3
+ import { type SQLParserDialect } from '@memberjunction/sql-dialect';
4
+ /** A client-supplied SQL fragment: plain text, or a set of per-platform variants. */
5
+ export type ClientClauseText = string | PlatformSQL | null | undefined;
6
+ /** The SQL fragments a RunView request can carry from a client. */
7
+ export interface ClientViewClauseSet {
8
+ ExtraFilter?: ClientClauseText;
9
+ OrderBy?: ClientClauseText;
10
+ OverrideExcludeFilter?: ClientClauseText;
11
+ }
12
+ /**
13
+ * The entity base views a client fragment may read. `Qualified` is keyed by `schema.view`, `Bare`
14
+ * by view name alone; a bare name that exists in more than one schema maps to `null`.
15
+ */
16
+ export interface EntityBaseViewAllowList {
17
+ Qualified: Map<string, EntityInfo>;
18
+ Bare: Map<string, EntityInfo | null>;
19
+ }
20
+ /**
21
+ * A provider that screens client SQL clauses with {@link ClientClauseScreen} against its own
22
+ * entities and dialect. `GenericDatabaseProvider` is one; server code that hands client SQL text
23
+ * to RunView outside the API entry points asks its provider through this.
24
+ */
25
+ export interface ClientClauseScreeningProvider {
26
+ ScreenClientClause(clause: string | null | undefined, label: string, contextUser?: UserInfo, entityInfo?: EntityInfo): void;
27
+ }
28
+ /** Options for {@link ClientClauseScreen.AssertClauseUsesEntityBaseViews}. */
29
+ export interface ClientClauseScreenOptions {
30
+ /**
31
+ * Leaves text the parser cannot read to the caller instead of refusing it. For a clause the
32
+ * provider checks again per item (an aggregate expression), that per-item check refuses it.
33
+ */
34
+ LeaveUnparseableToProvider?: boolean;
35
+ }
36
+ /** True when `provider` can screen client SQL clauses. */
37
+ export declare function IsClientClauseScreeningProvider(provider: object | null | undefined): provider is ClientClauseScreeningProvider;
38
+ /** One FROM item a parsed statement reads: a table or view, or a table function. */
39
+ export interface StatementRelation {
40
+ /**
41
+ * The schema of the table or function as written, without quotes; empty when unqualified. A
42
+ * three-part name keeps its database (`database.schema`), so it never matches a view in this
43
+ * database.
44
+ */
45
+ SchemaName: string;
46
+ /** The table or view name without quotes; empty when the item is not a table or view. */
47
+ TableName: string;
48
+ /** The table function's name; empty when the item is not a function call. */
49
+ FunctionName: string;
50
+ /**
51
+ * True when the item names a CTE that is in scope where it is read: an unqualified name that
52
+ * matches, by the dialect's identifier rules, a CTE declared by its own SELECT or an enclosing
53
+ * one. A schema, `dbo` included, always makes the item a real table or view.
54
+ */
55
+ IsCTEReference: boolean;
56
+ }
57
+ /** What {@link ClientClauseScreen.CollectStatementReads} found in a parse tree. */
58
+ export interface StatementReads {
59
+ /** Every FROM item, repeats included. Derived tables and VALUES lists add none of their own. */
60
+ Relations: StatementRelation[];
61
+ /** The SELECT nodes in the tree, each counted once. */
62
+ SelectCount: number;
63
+ }
64
+ /**
65
+ * SECURITY — screens for SQL text that a client (or a client-saved record) supplies to RunView.
66
+ *
67
+ * {@link ClientClauseScreen.AssertClauseUsesEntityBaseViews} is the full screen: one statement,
68
+ * parsed as a read-only fragment, that calls no function the dialect forbids in caller SQL and
69
+ * whose table references are only entity base views the acting user can read unscoped (no row
70
+ * filter and no denied fields). Base tables and system catalogs are refused. Apply it at every
71
+ * point where client text enters RunView: the GraphQL and REST entry points, ad-hoc list sources,
72
+ * and the clauses a saved view stores (at save and when the view runs).
73
+ *
74
+ * {@link ClientClauseScreen.AssertSingleStatementFragment} is the light check the provider runs on
75
+ * every RunView, server-internal ones included: no statement separator and no comment outside a
76
+ * literal or quoted identifier. It cannot refuse a legitimate fragment, so it is safe for callers
77
+ * whose filters the full screen would refuse (base tables, entities the acting user cannot read).
78
+ *
79
+ * Both use dialect-aware lexing, so a quote inside a bracket identifier (`[a']`) or a PostgreSQL
80
+ * `E'\''` string cannot hide a statement the way it hides one from the keyword denylist.
81
+ */
82
+ export declare class ClientClauseScreen {
83
+ /**
84
+ * Built-in table functions that read only their arguments. A subquery may use one in its FROM
85
+ * when the name is unqualified; a subquery inside its arguments is screened like any other.
86
+ */
87
+ private static readonly ARGUMENT_ONLY_TABLE_FUNCTIONS;
88
+ private static readonly WRITE_NODE_TYPES;
89
+ /**
90
+ * The parser dialect for a provider: from its `PlatformKey` when it has one, otherwise from its
91
+ * class name. Defaults to SQL Server.
92
+ */
93
+ static DialectFor(provider?: object | null): SQLParserDialect;
94
+ /**
95
+ * The full screen for one client clause fragment; throws when it refuses. The label `OrderBy`
96
+ * screens the text as an ORDER BY list; any other label screens it as a WHERE predicate. When
97
+ * `user` is given, every entity the fragment reads must be readable by that user, unscoped
98
+ * ({@link AssertUnscopedRead}). That includes the entity the clause filters: a subquery over
99
+ * its base view is outside the row filter RunView applies to the outer query.
100
+ *
101
+ * The reads come from a walk of the whole parse tree ({@link CollectStatementReads}), and the
102
+ * clause is refused when that walk does not account for every SELECT in the text
103
+ * ({@link AssertEverySelectAccountedFor}). Only the parse wrapper's own FROM item is skipped,
104
+ * and no CTE reference is exempt. A name reserved for the parser
105
+ * ({@link AssertNoIdentifierAliasNames}) and a call to a function the dialect forbids
106
+ * ({@link AssertNoForbiddenFunctionCalls}) are refused first.
107
+ *
108
+ * With `LeaveUnparseableToProvider`, text the parser cannot read returns without a refusal;
109
+ * the caller's own per-item check must refuse it instead.
110
+ */
111
+ static AssertClauseUsesEntityBaseViews(clause: string | null | undefined, label: string, entities: readonly EntityInfo[], dialect: SQLParserDialect, user?: UserInfo, options?: ClientClauseScreenOptions): void;
112
+ /**
113
+ * Applies {@link AssertClauseUsesEntityBaseViews} to every clause of a RunView request. A
114
+ * platform-specific clause has every variant screened, each under its own platform's dialect.
115
+ */
116
+ static ScreenViewClauses(clauses: ClientViewClauseSet, entities: readonly EntityInfo[], dialect: SQLParserDialect, user?: UserInfo): void;
117
+ /**
118
+ * Refuses a statement separator or a comment outside literals and quoted identifiers. A filter
119
+ * or sort fragment never needs either, so this cannot refuse a legitimate clause.
120
+ */
121
+ static AssertSingleStatementFragment(clause: string | null | undefined, label: string, dialect: SQLParserDialect): void;
122
+ /**
123
+ * Refuses an identifier, quoted or bare, in the form of a name the SQL parser gives a bracket
124
+ * identifier it renames ({@link SQLParser.IsIdentifierAliasName}), in any case. Those names are
125
+ * reserved for the parser, so client SQL may not use them.
126
+ */
127
+ static AssertNoIdentifierAliasNames(sql: string, dialect: SQLParserDialect, label: string): void;
128
+ /**
129
+ * Refuses a call to a function the dialect forbids in caller-supplied SQL
130
+ * ({@link SQLParserDialect.CallerSQLForbiddenFunctions}). Such a function runs SQL given as a
131
+ * string, reads files or other databases, acts on the server, or pauses the query, so the
132
+ * table check cannot see what it reads.
133
+ */
134
+ static AssertNoForbiddenFunctionCalls(sql: string, dialect: SQLParserDialect, label: string): void;
135
+ /** True when a parsed AST contains a write or DDL node at any depth. */
136
+ static AstContainsWriteNode(node: unknown): boolean;
137
+ /** Removes the bracket, double-quote or backtick quoting around one identifier. */
138
+ static StripIdentifierQuotes(name: string | null | undefined): string;
139
+ /** True for a reference written with no schema. A schema, `dbo` included, is matched as written. */
140
+ static IsUnqualifiedSchema(schema: string): boolean;
141
+ /** Builds the base-view allow-list for a set of entities. */
142
+ static BuildEntityBaseViewAllowList(entities: readonly EntityInfo[]): EntityBaseViewAllowList;
143
+ /**
144
+ * Resolves a table reference against the allow-list and returns its entity; throws when it is
145
+ * not an entity base view, or when `user` is given and lacks CanRead on that entity.
146
+ *
147
+ * A schema-qualified reference, `dbo` included, must match an entity in that exact schema. An
148
+ * unqualified one resolves only when the view name is unique across schemas, because the
149
+ * database's default-schema resolution, not this screen, would pick which view runs.
150
+ */
151
+ static AssertTableRefReadable(allowed: EntityBaseViewAllowList, schema: string, table: string, label: string, user?: UserInfo): EntityInfo;
152
+ /**
153
+ * Refuses an entity whose read `user` holds under a row filter (role row-level security or an
154
+ * API-key row filter) or with denied fields. SQL that reads the entity's base view directly, such
155
+ * as a subquery in a client clause or an ad-hoc query, applies neither; RunView on that entity
156
+ * does. For any other entity, a granted read covers every row and field of its base view.
157
+ */
158
+ static AssertUnscopedRead(entity: EntityInfo, user: UserInfo, label: string): void;
159
+ /**
160
+ * Every FROM item in a parsed statement, and the number of SELECT nodes. The walk visits every
161
+ * property of every node, so it finds a FROM list wherever the grammar puts one: a subquery in a
162
+ * CASE branch, HAVING, a window's ORDER BY or PARTITION BY, a function argument, IN, EXISTS, a
163
+ * set operation or a CTE body. Every FROM item is kept, even when its alias repeats. Names the
164
+ * fallback parse renamed are read back through {@link SQLParser.IdentifierAliases}, which holds
165
+ * only names the parser put in the tree. `skip` is a FROM item node to leave out (the screen's
166
+ * parse wrapper).
167
+ *
168
+ * Each FROM item records whether it reads a CTE in scope there
169
+ * ({@link StatementRelation.IsCTEReference}). A WITH covers its own SELECT, everything below it,
170
+ * and the following set-operation branches unless its SELECT is a parenthesized branch. A CTE
171
+ * body sees the CTEs before it, itself on SQL Server, and every CTE of a PostgreSQL WITH
172
+ * RECURSIVE list. Names match by the dialect's identifier rules ({@link cteNameRules}). The walk
173
+ * keeps a count of the CTEs of each name in scope as it goes, so its time is linear in the tree.
174
+ */
175
+ static CollectStatementReads(parser: SQLParser, skip?: object): StatementReads;
176
+ /**
177
+ * Refuses SQL whose SELECT keywords, outside literals, quoted identifiers and comments, differ
178
+ * in number from the SELECT nodes a walk of its parse tree found. A subquery the walk cannot
179
+ * see would otherwise go unchecked, so a mismatch fails closed.
180
+ */
181
+ static AssertEverySelectAccountedFor(sql: string, dialect: SQLParserDialect, reads: StatementReads, label: string): void;
182
+ /**
183
+ * The entity one FROM item reads, or null for an unqualified built-in table function that
184
+ * reads only its arguments. Throws for any other function or row source, and when
185
+ * {@link AssertTableRefReadable} refuses a table name.
186
+ */
187
+ static AssertRelationReadable(allowed: EntityBaseViewAllowList, relation: StatementRelation, label: string, user?: UserInfo): EntityInfo | null;
188
+ /** Visits one node of the parse tree. */
189
+ private static visitNode;
190
+ /**
191
+ * Visits a SELECT node: counts it, adds its FROM items, and visits its CTE bodies and every
192
+ * other property with the CTE names each one can see. The CTEs of its WITH are in scope from
193
+ * their place in the list until the walk leaves the SELECT.
194
+ */
195
+ private static visitSelect;
196
+ /**
197
+ * Visits the bodies of one WITH list, whose CTE names are `declared`. Body `i` sees the CTEs
198
+ * before it, itself too on SQL Server, and every CTE of a RECURSIVE list. Each CTE comes into
199
+ * scope once, at its place in the list, and all of them are in scope afterwards.
200
+ */
201
+ private static visitCTEBodies;
202
+ /** Adds the relation each FROM item names, marking an unqualified reference to a CTE in scope. */
203
+ private static addFromItems;
204
+ /** Brings each readable name among `names` into scope once more. */
205
+ private static enterScope;
206
+ /** Takes each readable name among `names` out of scope once. */
207
+ private static leaveScope;
208
+ /**
209
+ * Adds `delta` to the in-scope count of `name` when it is readable. A count that drops to zero
210
+ * stays in the map: in V8, each delete of a key leaves an entry that later lookups of that key
211
+ * step over until the map is rebuilt.
212
+ */
213
+ private static countName;
214
+ /** The name node of one item of a `with` list. */
215
+ private static cteNameNode;
216
+ /** True for the item of a `with` list that carries RECURSIVE (the parser marks the first). */
217
+ private static isRecursiveCTE;
218
+ /**
219
+ * How the parser's dialect matches a FROM item to a CTE. SQL Server ignores case, and a CTE
220
+ * body reads its own CTE. PostgreSQL folds an unquoted name to lower case and matches a quoted
221
+ * one exactly ({@link postgresNameRules}). A dialect that quotes identifiers any other way
222
+ * matches no CTE.
223
+ */
224
+ private static cteNameRules;
225
+ /**
226
+ * PostgreSQL's CTE name rules. A CTE name node says whether it was quoted. A FROM item's name
227
+ * does not, so its quoting comes from the SQL's tokens: a name with upper-case letters that the
228
+ * SQL writes only quoted is exact, one it writes only unquoted folds to lower case, and one it
229
+ * writes both ways, or not as a token at all, matches no CTE.
230
+ */
231
+ private static postgresNameRules;
232
+ /** `text` with ASCII upper-case letters in lower case: PostgreSQL's folding of an unquoted name. */
233
+ private static asciiLower;
234
+ /**
235
+ * The relation one FROM item names. A derived table and a VALUES list name none; the walk
236
+ * reaches any subquery inside them.
237
+ */
238
+ private static relationOf;
239
+ /** The relation a table function names. Leading name parts join the schema, so a qualified name never matches a built-in. */
240
+ private static functionRelation;
241
+ /**
242
+ * The text of an identifier node (a string, or the PostgreSQL grammar's `{ value }` node), with
243
+ * a name the fallback parse renamed read back from `aliases`; empty when unreadable.
244
+ */
245
+ private static identifierText;
246
+ /** The FROM item of the screen's parse wrapper: the root statement's only FROM item, when it is `__mj_clause_screen`. */
247
+ private static wrapperFromItem;
248
+ /** The text variants of one clause; a platform-specific clause yields each of its variants. */
249
+ private static clauseVariants;
250
+ /**
251
+ * The clause with T-SQL bracket identifiers in the dialect's own quoting, for a dialect that
252
+ * does not quote with brackets. The PostgreSQL provider accepts `[Name]` in a client clause and
253
+ * converts it the same way before running it (`PostgreSQLDataProvider.quoteIdentifiersInSQL`).
254
+ * Only a bracket around a plain name changes; any other bracket stays as written, and the
255
+ * grammar refuses it.
256
+ */
257
+ private static toDialectQuoting;
258
+ }
259
+ //# sourceMappingURL=clientClauseScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientClauseScreen.d.ts","sourceRoot":"","sources":["../src/clientClauseScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAoE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACzH,OAAO,EAAuC,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEzG,qFAAqF;AACrF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvE,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IA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