kfaraz commented on code in PR #15480:
URL: https://github.com/apache/druid/pull/15480#discussion_r1429016250
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:
##########
@@ -225,18 +222,29 @@ public Response taskPost(final Task task, @Context final
HttpServletRequest req)
taskQueue -> {
try {
taskQueue.add(task);
+
+ auditManager.doAudit(
Review Comment:
Yes, this is already happening inside the respective audit impls, such as
`SQLAuditManager` and `LoggingAuditManager`. We check if an audited event was
started by an internal service (by checking the author field) and then audit
that event only if system event auditing is enabled via config (false by
default).
This is better than checking at each call site if the request was initiated
by an internal service.
##########
server/src/main/java/org/apache/druid/guice/SQLMetadataStorageDruidModule.java:
##########
@@ -130,21 +131,33 @@ public void configure(Binder binder)
.to(SQLMetadataStorageUpdaterJobHandler.class)
.in(LazySingleton.class);
- JsonConfigProvider.bind(binder, "druid.audit.manager",
SQLAuditManagerConfig.class);
-
- PolyBind.optionBinder(binder, Key.get(AuditManager.class))
- .addBinding(type)
- .to(SQLAuditManager.class)
- .in(LazySingleton.class);
-
- PolyBind.optionBinder(binder, Key.get(AuditManagerProvider.class))
- .addBinding(type)
- .to(SQLAuditManagerProvider.class)
- .in(LazySingleton.class);
-
PolyBind.optionBinder(binder, Key.get(MetadataSupervisorManager.class))
.addBinding(type)
.to(SQLMetadataSupervisorManager.class)
.in(LazySingleton.class);
}
+
+ private void configureAuditManager(Binder binder)
+ {
+ JsonConfigProvider.bind(binder, "druid.audit.manager",
AuditManagerConfig.class);
+
+ PolyBind.createChoice(
+ binder,
+ "druid.audit.manager.type",
+ Key.get(AuditManager.class),
+ Key.get(SQLAuditManager.class)
+ );
+ final MapBinder<String, AuditManager> auditManagerBinder
+ = PolyBind.optionBinder(binder, Key.get(AuditManager.class));
+ auditManagerBinder
+ .addBinding("log")
+ .to(LoggingAuditManager.class)
+ .in(LazySingleton.class);
Review Comment:
Sure, let me put this in some other module.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]