• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3638

11 Mar 2025 12:59PM UTC coverage: 3.066% (-18.3%) from 21.409%
#3638

push

travis-ci

web-flow
Merge pull request #30118 from taosdata/wl30

udpate ci workflow

5914 of 287117 branches covered (2.06%)

Branch coverage included in aggregate %.

11588 of 283747 relevant lines covered (4.08%)

142.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

2.57
/source/libs/parser/src/parAuthenticator.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#include "catalog.h"
17
#include "cmdnodes.h"
18
#include "parInt.h"
19

20
typedef struct SAuthCxt {
21
  SParseContext*   pParseCxt;
22
  SParseMetaCache* pMetaCache;
23
  int32_t          errCode;
24
} SAuthCxt;
25

26
typedef struct SSelectAuthCxt {
27
  SAuthCxt*    pAuthCxt;
28
  SSelectStmt* pSelect;
29
} SSelectAuthCxt;
30

31
typedef struct SAuthRewriteCxt {
32
  STableNode* pTarget;
33
} SAuthRewriteCxt;
34

35
static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt);
36

37
static int32_t setUserAuthInfo(SParseContext* pCxt, const char* pDbName, const char* pTabName, AUTH_TYPE type,
×
38
                               bool isView, bool effective, SUserAuthInfo* pAuth) {
39
  if (effective) {
×
40
    snprintf(pAuth->user, sizeof(pAuth->user), "%s", pCxt->pEffectiveUser ? pCxt->pEffectiveUser : "");
×
41
  } else {
42
    snprintf(pAuth->user, sizeof(pAuth->user), "%s", pCxt->pUser);
×
43
  }
44

45
  if (NULL == pTabName) {
×
46
    int32_t code = tNameSetDbName(&pAuth->tbName, pCxt->acctId, pDbName, strlen(pDbName));
×
47
    if (TSDB_CODE_SUCCESS != code) return code;
×
48
  } else {
49
    toName(pCxt->acctId, pDbName, pTabName, &pAuth->tbName);
×
50
  }
51
  pAuth->type = type;
×
52
  pAuth->isView = isView;
×
53
  return TSDB_CODE_SUCCESS;
×
54
}
55

56
static int32_t checkAuthImpl(SAuthCxt* pCxt, const char* pDbName, const char* pTabName, AUTH_TYPE type, SNode** pCond,
×
57
                             bool isView, bool effective) {
58
  SParseContext* pParseCxt = pCxt->pParseCxt;
×
59
  if (pParseCxt->isSuperUser) {
×
60
    return TSDB_CODE_SUCCESS;
×
61
  }
62

63
  AUTH_RES_TYPE auth_res_type = isView ? AUTH_RES_VIEW : AUTH_RES_BASIC;
×
64
  SUserAuthInfo authInfo = {0};
×
65
  int32_t       code = setUserAuthInfo(pCxt->pParseCxt, pDbName, pTabName, type, isView, effective, &authInfo);
×
66
  if (TSDB_CODE_SUCCESS != code) return code;
×
67
  SUserAuthRes authRes = {0};
×
68
  if (NULL != pCxt->pMetaCache) {
×
69
    code = getUserAuthFromCache(pCxt->pMetaCache, &authInfo, &authRes);
×
70
#ifdef TD_ENTERPRISE
71
    if (isView && TSDB_CODE_PAR_INTERNAL_ERROR == code) {
×
72
      authInfo.isView = false;
×
73
      code = getUserAuthFromCache(pCxt->pMetaCache, &authInfo, &authRes);
×
74
    }
75
#endif
76
  } else {
77
    SRequestConnInfo conn = {.pTrans = pParseCxt->pTransporter,
×
78
                             .requestId = pParseCxt->requestId,
×
79
                             .requestObjRefId = pParseCxt->requestRid,
×
80
                             .mgmtEps = pParseCxt->mgmtEpSet};
81
    code = catalogChkAuth(pParseCxt->pCatalog, &conn, &authInfo, &authRes);
×
82
  }
83
  if (TSDB_CODE_SUCCESS == code && NULL != pCond) {
×
84
    *pCond = authRes.pCond[auth_res_type];
×
85
  }
86
  return TSDB_CODE_SUCCESS == code ? (authRes.pass[auth_res_type] ? TSDB_CODE_SUCCESS : TSDB_CODE_PAR_PERMISSION_DENIED)
×
87
                                   : code;
×
88
}
89

90
static int32_t checkAuth(SAuthCxt* pCxt, const char* pDbName, const char* pTabName, AUTH_TYPE type, SNode** pCond) {
×
91
  return checkAuthImpl(pCxt, pDbName, pTabName, type, pCond, false, false);
×
92
}
93

94
static int32_t checkEffectiveAuth(SAuthCxt* pCxt, const char* pDbName, const char* pTabName, AUTH_TYPE type,
×
95
                                  SNode** pCond) {
96
  return checkAuthImpl(pCxt, pDbName, pTabName, type, NULL, false, true);
×
97
}
98

99
static int32_t checkViewAuth(SAuthCxt* pCxt, const char* pDbName, const char* pTabName, AUTH_TYPE type, SNode** pCond) {
×
100
  return checkAuthImpl(pCxt, pDbName, pTabName, type, NULL, true, false);
×
101
}
102

103
static int32_t checkViewEffectiveAuth(SAuthCxt* pCxt, const char* pDbName, const char* pTabName, AUTH_TYPE type,
×
104
                                      SNode** pCond) {
105
  return checkAuthImpl(pCxt, pDbName, pTabName, type, NULL, true, true);
×
106
}
107

108
static EDealRes authSubquery(SAuthCxt* pCxt, SNode* pStmt) {
×
109
  return TSDB_CODE_SUCCESS == authQuery(pCxt, pStmt) ? DEAL_RES_CONTINUE : DEAL_RES_ERROR;
×
110
}
111

112
static int32_t mergeStableTagCond(SNode** pWhere, SNode* pTagCond) {
×
113
  SLogicConditionNode* pLogicCond = NULL;
×
114
  int32_t              code = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION, (SNode**)&pLogicCond);
×
115
  if (NULL == pLogicCond) {
×
116
    return code;
×
117
  }
118
  pLogicCond->node.resType.type = TSDB_DATA_TYPE_BOOL;
×
119
  pLogicCond->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes;
×
120
  pLogicCond->condType = LOGIC_COND_TYPE_AND;
×
121
  code = nodesListMakeStrictAppend(&pLogicCond->pParameterList, pTagCond);
×
122
  if (TSDB_CODE_SUCCESS == code) {
×
123
    code = nodesListMakeAppend(&pLogicCond->pParameterList, *pWhere);
×
124
  }
125
  if (TSDB_CODE_SUCCESS == code) {
×
126
    *pWhere = (SNode*)pLogicCond;
×
127
  } else {
128
    nodesDestroyNode((SNode*)pLogicCond);
×
129
  }
130
  return code;
×
131
}
132

133
EDealRes rewriteAuthTable(SNode* pNode, void* pContext) {
×
134
  if (QUERY_NODE_COLUMN == nodeType(pNode)) {
×
135
    SColumnNode*     pCol = (SColumnNode*)pNode;
×
136
    SAuthRewriteCxt* pCxt = (SAuthRewriteCxt*)pContext;
×
137
    tstrncpy(pCol->tableName, pCxt->pTarget->tableName, TSDB_TABLE_NAME_LEN);
×
138
    tstrncpy(pCol->tableAlias, pCxt->pTarget->tableAlias, TSDB_TABLE_NAME_LEN);
×
139
  }
140

141
  return DEAL_RES_CONTINUE;
×
142
}
143

144
static int32_t rewriteAppendStableTagCond(SNode** pWhere, SNode* pTagCond, STableNode* pTable) {
×
145
  SNode*  pTagCondCopy = NULL;
×
146
  int32_t code = nodesCloneNode(pTagCond, &pTagCondCopy);
×
147
  if (NULL == pTagCondCopy) {
×
148
    return code;
×
149
  }
150

151
  SAuthRewriteCxt cxt = {.pTarget = pTable};
×
152
  nodesWalkExpr(pTagCondCopy, rewriteAuthTable, &cxt);
×
153

154
  if (NULL == *pWhere) {
×
155
    *pWhere = pTagCondCopy;
×
156
    return TSDB_CODE_SUCCESS;
×
157
  }
158

159
  if (QUERY_NODE_LOGIC_CONDITION == nodeType(*pWhere) &&
×
160
      LOGIC_COND_TYPE_AND == ((SLogicConditionNode*)*pWhere)->condType) {
×
161
    return nodesListStrictAppend(((SLogicConditionNode*)*pWhere)->pParameterList, pTagCondCopy);
×
162
  }
163

164
  return mergeStableTagCond(pWhere, pTagCondCopy);
×
165
}
166

167
static EDealRes authSelectImpl(SNode* pNode, void* pContext) {
×
168
  SSelectAuthCxt* pCxt = pContext;
×
169
  SAuthCxt*       pAuthCxt = pCxt->pAuthCxt;
×
170
  bool            isView = false;
×
171
  if (QUERY_NODE_REAL_TABLE == nodeType(pNode)) {
×
172
    SNode*      pTagCond = NULL;
×
173
    STableNode* pTable = (STableNode*)pNode;
×
174
#ifdef TD_ENTERPRISE
175
    SName name = {0};
×
176
    toName(pAuthCxt->pParseCxt->acctId, pTable->dbName, pTable->tableName, &name);
×
177
    STableMeta* pTableMeta = NULL;
×
178
    toName(pAuthCxt->pParseCxt->acctId, pTable->dbName, pTable->tableName, &name);
×
179
    int32_t code = getTargetMetaImpl(
×
180
        pAuthCxt->pParseCxt, pAuthCxt->pMetaCache, &name, &pTableMeta, true);
181
    if (TSDB_CODE_SUCCESS == code && TSDB_VIEW_TABLE == pTableMeta->tableType) {
×
182
      isView = true;
×
183
    }
184
    taosMemoryFree(pTableMeta);
×
185
#endif
186
    if (!isView) {
×
187
      pAuthCxt->errCode = checkAuth(pAuthCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_READ, &pTagCond);
×
188
      if (TSDB_CODE_SUCCESS != pAuthCxt->errCode && NULL != pAuthCxt->pParseCxt->pEffectiveUser) {
×
189
        pAuthCxt->errCode = checkEffectiveAuth(pAuthCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_READ, NULL);
×
190
      }
191
      if (TSDB_CODE_SUCCESS == pAuthCxt->errCode && NULL != pTagCond) {
×
192
        pAuthCxt->errCode = rewriteAppendStableTagCond(&pCxt->pSelect->pWhere, pTagCond, pTable);
×
193
      }
194
    } else {
195
      pAuthCxt->errCode = checkViewAuth(pAuthCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_READ, NULL);
×
196
      if (TSDB_CODE_SUCCESS != pAuthCxt->errCode && NULL != pAuthCxt->pParseCxt->pEffectiveUser) {
×
197
        pAuthCxt->errCode = checkViewEffectiveAuth(pAuthCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_READ, NULL);
×
198
      }
199
    }
200
    return TSDB_CODE_SUCCESS == pAuthCxt->errCode ? DEAL_RES_CONTINUE : DEAL_RES_ERROR;
×
201
  } else if (QUERY_NODE_TEMP_TABLE == nodeType(pNode)) {
×
202
    return authSubquery(pAuthCxt, ((STempTableNode*)pNode)->pSubquery);
×
203
  }
204
  return DEAL_RES_CONTINUE;
×
205
}
206

207
static int32_t authSelect(SAuthCxt* pCxt, SSelectStmt* pSelect) {
×
208
  SSelectAuthCxt cxt = {.pAuthCxt = pCxt, .pSelect = pSelect};
×
209
  nodesWalkSelectStmt(pSelect, SQL_CLAUSE_FROM, authSelectImpl, &cxt);
×
210
  return pCxt->errCode;
×
211
}
212

213
static int32_t authSetOperator(SAuthCxt* pCxt, SSetOperator* pSetOper) {
×
214
  int32_t code = authQuery(pCxt, pSetOper->pLeft);
×
215
  if (TSDB_CODE_SUCCESS == code) {
×
216
    code = authQuery(pCxt, pSetOper->pRight);
×
217
  }
218
  return code;
×
219
}
220

221
static int32_t authDropUser(SAuthCxt* pCxt, SDropUserStmt* pStmt) {
×
222
  if (!pCxt->pParseCxt->isSuperUser || 0 == strcmp(pStmt->userName, TSDB_DEFAULT_USER)) {
×
223
    return TSDB_CODE_PAR_PERMISSION_DENIED;
×
224
  }
225
  return TSDB_CODE_SUCCESS;
×
226
}
227

228
static int32_t authDelete(SAuthCxt* pCxt, SDeleteStmt* pDelete) {
×
229
  SNode*      pTagCond = NULL;
×
230
  STableNode* pTable = (STableNode*)pDelete->pFromTable;
×
231
  int32_t     code = checkAuth(pCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_WRITE, &pTagCond);
×
232
  if (TSDB_CODE_SUCCESS == code && NULL != pTagCond) {
×
233
    code = rewriteAppendStableTagCond(&pDelete->pWhere, pTagCond, pTable);
×
234
  }
235
  return code;
×
236
}
237

238
static int32_t authInsert(SAuthCxt* pCxt, SInsertStmt* pInsert) {
×
239
  SNode*      pTagCond = NULL;
×
240
  STableNode* pTable = (STableNode*)pInsert->pTable;
×
241
  // todo check tag condition for subtable
242
  int32_t code = checkAuth(pCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_WRITE, &pTagCond);
×
243
  if (TSDB_CODE_SUCCESS == code) {
×
244
    code = authQuery(pCxt, pInsert->pQuery);
×
245
  }
246
  return code;
×
247
}
248

249
static int32_t authShowTables(SAuthCxt* pCxt, SShowStmt* pStmt) {
×
250
  return checkAuth(pCxt, ((SValueNode*)pStmt->pDbName)->literal, NULL, AUTH_TYPE_READ_OR_WRITE, NULL);
×
251
}
252

253
static int32_t authShowUsage(SAuthCxt* pCxt, SShowStmt* pStmt) {
×
254
  return checkAuth(pCxt, ((SValueNode*)pStmt->pDbName)->literal, NULL, AUTH_TYPE_READ_OR_WRITE, NULL);
×
255
}
256

257
static int32_t authShowCreateTable(SAuthCxt* pCxt, SShowCreateTableStmt* pStmt) {
×
258
  SNode* pTagCond = NULL;
×
259
  // todo check tag condition for subtable
260
  return checkAuth(pCxt, pStmt->dbName, pStmt->tableName, AUTH_TYPE_READ, &pTagCond);
×
261
}
262

263
static int32_t authShowCreateView(SAuthCxt* pCxt, SShowCreateViewStmt* pStmt) {
×
264
#ifndef TD_ENTERPRISE
265
  return TSDB_CODE_OPS_NOT_SUPPORT;
266
#endif
267

268
  return TSDB_CODE_SUCCESS;
×
269
}
270

271
static int32_t authCreateTable(SAuthCxt* pCxt, SCreateTableStmt* pStmt) {
×
272
  SNode* pTagCond = NULL;
×
273
  // todo check tag condition for subtable
274
  return checkAuth(pCxt, pStmt->dbName, NULL, AUTH_TYPE_WRITE, &pTagCond);
×
275
}
276

277
static int32_t authCreateMultiTable(SAuthCxt* pCxt, SCreateMultiTablesStmt* pStmt) {
×
278
  int32_t code = TSDB_CODE_SUCCESS;
×
279
  SNode*  pNode = NULL;
×
280
  FOREACH(pNode, pStmt->pSubTables) {
×
281
    if (pNode->type == QUERY_NODE_CREATE_SUBTABLE_CLAUSE) {
×
282
      SCreateSubTableClause* pClause = (SCreateSubTableClause*)pNode;
×
283
      code = checkAuth(pCxt, pClause->dbName, NULL, AUTH_TYPE_WRITE, NULL);
×
284
      if (TSDB_CODE_SUCCESS != code) {
×
285
        break;
×
286
      }
287
    } else {
288
      SCreateSubTableFromFileClause* pClause = (SCreateSubTableFromFileClause*)pNode;
×
289
      code = checkAuth(pCxt, pClause->useDbName, NULL, AUTH_TYPE_WRITE, NULL);
×
290
      if (TSDB_CODE_SUCCESS != code) {
×
291
        break;
×
292
      }
293
    }
294
  }
295
  return code;
×
296
}
297

298
static int32_t authDropTable(SAuthCxt* pCxt, SDropTableStmt* pStmt) {
×
299
  int32_t code = TSDB_CODE_SUCCESS;
×
300
  if (pStmt->withOpt && !pCxt->pParseCxt->isSuperUser) {
×
301
    return TSDB_CODE_PAR_PERMISSION_DENIED;
×
302
  }
303
  SNode* pNode = NULL;
×
304
  FOREACH(pNode, pStmt->pTables) {
×
305
    SDropTableClause* pClause = (SDropTableClause*)pNode;
×
306
    code = checkAuth(pCxt, pClause->dbName, pClause->tableName, AUTH_TYPE_WRITE, NULL);
×
307
    if (TSDB_CODE_SUCCESS != code) {
×
308
      break;
×
309
    }
310
  }
311
  return code;
×
312
}
313

314
static int32_t authDropStable(SAuthCxt* pCxt, SDropSuperTableStmt* pStmt) {
×
315
  if (pStmt->withOpt && !pCxt->pParseCxt->isSuperUser) {
×
316
    return TSDB_CODE_PAR_PERMISSION_DENIED;
×
317
  }
318
  return checkAuth(pCxt, pStmt->dbName, pStmt->tableName, AUTH_TYPE_WRITE, NULL);
×
319
}
320

321
static int32_t authAlterTable(SAuthCxt* pCxt, SAlterTableStmt* pStmt) {
×
322
  SNode* pTagCond = NULL;
×
323
  // todo check tag condition for subtable
324
  return checkAuth(pCxt, pStmt->dbName, pStmt->tableName, AUTH_TYPE_WRITE, NULL);
×
325
}
326

327
static int32_t authCreateView(SAuthCxt* pCxt, SCreateViewStmt* pStmt) {
×
328
#ifndef TD_ENTERPRISE
329
  return TSDB_CODE_OPS_NOT_SUPPORT;
330
#endif
331
  return checkAuth(pCxt, pStmt->dbName, NULL, AUTH_TYPE_WRITE, NULL);
×
332
}
333

334
static int32_t authDropView(SAuthCxt* pCxt, SDropViewStmt* pStmt) {
×
335
#ifndef TD_ENTERPRISE
336
  return TSDB_CODE_OPS_NOT_SUPPORT;
337
#endif
338
  return checkViewAuth(pCxt, pStmt->dbName, pStmt->viewName, AUTH_TYPE_ALTER, NULL);
×
339
}
340

341
static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) {
4✔
342
  switch (nodeType(pStmt)) {
4!
343
    case QUERY_NODE_SET_OPERATOR:
×
344
      return authSetOperator(pCxt, (SSetOperator*)pStmt);
×
345
    case QUERY_NODE_SELECT_STMT:
×
346
      return authSelect(pCxt, (SSelectStmt*)pStmt);
×
347
    case QUERY_NODE_DROP_USER_STMT:
×
348
      return authDropUser(pCxt, (SDropUserStmt*)pStmt);
×
349
    case QUERY_NODE_DELETE_STMT:
×
350
      return authDelete(pCxt, (SDeleteStmt*)pStmt);
×
351
    case QUERY_NODE_INSERT_STMT:
×
352
      return authInsert(pCxt, (SInsertStmt*)pStmt);
×
353
    case QUERY_NODE_CREATE_TABLE_STMT:
×
354
      return authCreateTable(pCxt, (SCreateTableStmt*)pStmt);
×
355
    case QUERY_NODE_CREATE_MULTI_TABLES_STMT:
×
356
      return authCreateMultiTable(pCxt, (SCreateMultiTablesStmt*)pStmt);
×
357
    case QUERY_NODE_DROP_TABLE_STMT:
×
358
      return authDropTable(pCxt, (SDropTableStmt*)pStmt);
×
359
    case QUERY_NODE_DROP_SUPER_TABLE_STMT:
×
360
      return authDropStable(pCxt, (SDropSuperTableStmt*)pStmt);
×
361
    case QUERY_NODE_ALTER_TABLE_STMT:
×
362
    case QUERY_NODE_ALTER_SUPER_TABLE_STMT:
363
      return authAlterTable(pCxt, (SAlterTableStmt*)pStmt);
×
364
    case QUERY_NODE_SHOW_DNODES_STMT:
×
365
    case QUERY_NODE_SHOW_MNODES_STMT:
366
    case QUERY_NODE_SHOW_MODULES_STMT:
367
    case QUERY_NODE_SHOW_QNODES_STMT:
368
    case QUERY_NODE_SHOW_ANODES_STMT:
369
    case QUERY_NODE_SHOW_ANODES_FULL_STMT:
370
    case QUERY_NODE_SHOW_SNODES_STMT:
371
    case QUERY_NODE_SHOW_BNODES_STMT:
372
    case QUERY_NODE_SHOW_CLUSTER_STMT:
373
    case QUERY_NODE_SHOW_LICENCES_STMT:
374
    case QUERY_NODE_SHOW_VGROUPS_STMT:
375
    case QUERY_NODE_SHOW_DB_ALIVE_STMT:
376
    case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT:
377
    case QUERY_NODE_SHOW_CREATE_DATABASE_STMT:
378
    case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT:
379
    case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT:
380
    case QUERY_NODE_SHOW_VNODES_STMT:
381
    case QUERY_NODE_SHOW_SCORES_STMT:
382
    case QUERY_NODE_SHOW_USERS_STMT:
383
    case QUERY_NODE_SHOW_USERS_FULL_STMT:
384
    case QUERY_NODE_SHOW_USER_PRIVILEGES_STMT:
385
    case QUERY_NODE_SHOW_GRANTS_FULL_STMT:
386
    case QUERY_NODE_SHOW_GRANTS_LOGS_STMT:
387
    case QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT:
388
    case QUERY_NODE_SHOW_ARBGROUPS_STMT:
389
    case QUERY_NODE_SHOW_ENCRYPTIONS_STMT:
390
    case QUERY_NODE_SHOW_USAGE_STMT:
391
      return !pCxt->pParseCxt->enableSysInfo ? TSDB_CODE_PAR_PERMISSION_DENIED : TSDB_CODE_SUCCESS;
×
392
    case QUERY_NODE_SHOW_TABLES_STMT:
×
393
    case QUERY_NODE_SHOW_STABLES_STMT:
394
      return authShowTables(pCxt, (SShowStmt*)pStmt);
×
395
    case QUERY_NODE_SHOW_CREATE_TABLE_STMT:
×
396
    case QUERY_NODE_SHOW_CREATE_STABLE_STMT:
397
      return authShowCreateTable(pCxt, (SShowCreateTableStmt*)pStmt);
×
398
      //    case QUERY_NODE_SHOW_CREATE_VIEW_STMT:
399
      //      return authShowCreateView(pCxt, (SShowCreateViewStmt*)pStmt);
400
    case QUERY_NODE_CREATE_VIEW_STMT:
×
401
      return authCreateView(pCxt, (SCreateViewStmt*)pStmt);
×
402
    case QUERY_NODE_DROP_VIEW_STMT:
×
403
      return authDropView(pCxt, (SDropViewStmt*)pStmt);
×
404
    default:
4✔
405
      break;
4✔
406
  }
407

408
  return TSDB_CODE_SUCCESS;
4✔
409
}
410

411
int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) {
4✔
412
  SAuthCxt cxt = {.pParseCxt = pParseCxt, .pMetaCache = pMetaCache, .errCode = TSDB_CODE_SUCCESS};
4✔
413
  return authQuery(&cxt, pQuery->pRoot);
4✔
414
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc