markap14 commented on code in PR #11240:
URL: https://github.com/apache/nifi/pull/11240#discussion_r3500633049
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ConnectorAuditor.java:
##########
@@ -372,6 +372,29 @@ public void applyConnectorUpdateAdvice(final
ProceedingJoinPoint proceedingJoinP
}
}
+ @Around("within(org.apache.nifi.web.dao.ConnectorDAO+) && "
+ + "execution(void migrateFromVersionedFlow(java.lang.String,
java.lang.String, org.apache.nifi.flow.VersionedExternalFlow,
java.util.function.BooleanSupplier)) && "
+ + "args(connectorId, processGroupId, sourceFlow,
cancellationCheck) && "
+ + "target(connectorDAO)")
+ public void migrateConnectorAdvice(final ProceedingJoinPoint
proceedingJoinPoint, final String connectorId, final String processGroupId,
+ final Object sourceFlow, final Object
cancellationCheck, final ConnectorDAO connectorDAO) throws Throwable {
+ final ConnectorNode connector = connectorDAO.getConnector(connectorId);
+
+ proceedingJoinPoint.proceed();
+
+ if (isAuditable()) {
+ final FlowChangeConfigureDetails actionDetails = new
FlowChangeConfigureDetails();
+ actionDetails.setName("Connector migrated from Versioned Process
Group");
+ actionDetails.setPreviousValue(null);
+ actionDetails.setValue(processGroupId == null ? "Uploaded payload"
: processGroupId);
+
+ final Action action = generateAuditRecord(connector,
Operation.Configure, actionDetails);
Review Comment:
Agreed that a migration is semantically distinct from an ordinary
`Operation.Configure` and would be better as a first-class audit event.
`Operation` lives in `nifi-api`, so adding a value is a public-API change that
also touches audit persistence, the audit UI filters, and the developer docs.
To keep this PR focused, this is best done as a separate follow-up effort
rather than folded in here.
--
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]