@@ -220,7 +220,8 @@ public static Optional<ConfigPhysicalPlan> visitUserPlan(
220220 ConfigNode .getInstance ()
221221 .getConfigManager ()
222222 .getAuditLogger ()
223- .recordAuditLog (userEntity .setPrivilegeType (null ).setResult (true ), () -> auditObject );
223+ .recordObjectAuthenticationAuditLog (
224+ userEntity .setPrivilegeType (null ).setResult (true ), () -> auditObject );
224225 return Optional .of (plan );
225226 }
226227 return hasGlobalPrivilege (
@@ -242,7 +243,8 @@ public static Optional<ConfigPhysicalPlan> visitRolePlan(
242243 == TSStatusCode .SUCCESS_STATUS .getStatusCode ()) {
243244 configManager
244245 .getAuditLogger ()
245- .recordAuditLog (userEntity .setPrivilegeType (null ).setResult (true ), () -> auditObject );
246+ .recordObjectAuthenticationAuditLog (
247+ userEntity .setPrivilegeType (null ).setResult (true ), () -> auditObject );
246248 return Optional .of (plan );
247249 }
248250 } catch (final Exception ignore ) {
@@ -265,23 +267,23 @@ public Optional<ConfigPhysicalPlan> visitPipeDeleteTimeSeries(
265267 final PathPatternTree intersectedTree =
266268 originalTree .intersectWithFullPathPrefixTree (getAuthorizedPTree (userEntity ));
267269 if (!skip && !originalTree .equals (intersectedTree )) {
268- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
270+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
269271 throw new AccessDeniedException (
270272 "Not has privilege to transfer plan: " + pipeDeleteTimeSeriesPlan );
271273 }
272274 final boolean result = !intersectedTree .isEmpty ();
273- logger .recordAuditLog (userEntity .setResult (result ), () -> auditObject );
275+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (result ), () -> auditObject );
274276 return result
275277 ? Optional .of (new PipeDeleteTimeSeriesPlan (intersectedTree .serialize ()))
276278 : Optional .empty ();
277279 } catch (final IOException e ) {
278280 LOGGER .warn (
279281 "Serialization failed for the delete time series plan in pipe transmission, skip transfer" ,
280282 e );
281- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
283+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
282284 return Optional .empty ();
283285 } catch (final AuthException e ) {
284- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
286+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
285287 if (skip ) {
286288 return Optional .empty ();
287289 } else {
@@ -303,23 +305,23 @@ public Optional<ConfigPhysicalPlan> visitPipeDeleteLogicalView(
303305 final PathPatternTree intersectedTree =
304306 originalTree .intersectWithFullPathPrefixTree (getAuthorizedPTree (userEntity ));
305307 if (!skip && !originalTree .equals (intersectedTree )) {
306- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
308+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
307309 throw new AccessDeniedException (
308310 "Not has privilege to transfer plan: " + pipeDeleteLogicalViewPlan );
309311 }
310312 final boolean result = !intersectedTree .isEmpty ();
311- logger .recordAuditLog (userEntity .setResult (result ), () -> auditObject );
313+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (result ), () -> auditObject );
312314 return result
313315 ? Optional .of (new PipeDeleteLogicalViewPlan (intersectedTree .serialize ()))
314316 : Optional .empty ();
315317 } catch (final IOException e ) {
316318 LOGGER .warn (
317319 "Serialization failed for the delete time series plan in pipe transmission, skip transfer" ,
318320 e );
319- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
321+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
320322 return Optional .empty ();
321323 } catch (final AuthException e ) {
322- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
324+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
323325 if (skip ) {
324326 return Optional .empty ();
325327 } else {
@@ -350,12 +352,12 @@ public Optional<ConfigPhysicalPlan> visitPipeDeactivateTemplate(
350352 }
351353 }
352354 final boolean result = !newTemplateSetInfo .isEmpty ();
353- logger .recordAuditLog (userEntity .setResult (result ), () -> auditObject );
355+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (result ), () -> auditObject );
354356 return !newTemplateSetInfo .isEmpty ()
355357 ? Optional .of (new PipeDeactivateTemplatePlan (newTemplateSetInfo ))
356358 : Optional .empty ();
357359 } catch (final AuthException e ) {
358- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
360+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
359361 if (skip ) {
360362 return Optional .empty ();
361363 } else {
@@ -379,12 +381,12 @@ public Optional<ConfigPhysicalPlan> visitTTL(
379381 // pattern and TTL path are each either a prefix path or a full path
380382 final boolean result =
381383 !paths .isEmpty () && paths .get (0 ).getNodeLength () == setTTLPlan .getPathPattern ().length ;
382- logger .recordAuditLog (userEntity .setResult (result ), () -> auditObject );
384+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (result ), () -> auditObject );
383385 return result
384386 ? Optional .of (new SetTTLPlan (paths .get (0 ).getNodes (), setTTLPlan .getTTL ()))
385387 : Optional .empty ();
386388 } catch (final AuthException e ) {
387- logger .recordAuditLog (userEntity .setResult (false ), () -> auditObject );
389+ logger .recordObjectAuthenticationAuditLog (userEntity .setResult (false ), () -> auditObject );
388390 if (skip ) {
389391 return Optional .empty ();
390392 } else {
@@ -448,7 +450,7 @@ public static TSStatus checkGlobalOrAnyStatus(
448450 userEntity .getUsername (), new PrivilegeUnion (privilegeType , grantOption , isAny ))
449451 .getStatus ();
450452 if (result .getCode () == TSStatusCode .SUCCESS_STATUS .getStatusCode () || isLastCheck ) {
451- logger .recordAuditLog (
453+ logger .recordObjectAuthenticationAuditLog (
452454 userEntity
453455 .setPrivilegeType (privilegeType )
454456 .setResult (result .getCode () == TSStatusCode .SUCCESS_STATUS .getStatusCode ()),
@@ -491,7 +493,7 @@ public static TSStatus checkPathsStatus(
491493 new PrivilegeUnion (paths , privilegeType , Objects .nonNull (grantName )))
492494 .getStatus ();
493495 if (result .getCode () == TSStatusCode .SUCCESS_STATUS .getStatusCode () || isLastCheck ) {
494- logger .recordAuditLog (
496+ logger .recordObjectAuthenticationAuditLog (
495497 userEntity
496498 .setPrivilegeType (PrivilegeType .READ_SCHEMA )
497499 .setResult (result .getCode () == TSStatusCode .SUCCESS_STATUS .getStatusCode ()),
0 commit comments