This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new f40e3f59e3 NIFI-14930 Added logging for Tenant User and Group
operations
f40e3f59e3 is described below
commit f40e3f59e315593a96dcbb49ff2d74b658c00ddb
Author: exceptionfactory <[email protected]>
AuthorDate: Sat Sep 6 22:25:38 2025 -0500
NIFI-14930 Added logging for Tenant User and Group operations
Signed-off-by: Pierre Villard <[email protected]>
This closes #10281.
---
.../java/org/apache/nifi/web/StandardNiFiServiceFacade.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index e9531fd30f..1d11e7902f 100644
---
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -978,6 +978,7 @@ public class StandardNiFiServiceFacade implements
NiFiServiceFacade {
final Set<AccessPolicySummaryEntity> policyEntities =
policies.stream().map(this::createAccessPolicySummaryEntity).collect(Collectors.toSet());
return dtoFactory.createUserDto(user, tenantEntities,
policyEntities);
});
+ logger.info("Tenant User [{}] updated by [{}]", userDTO.getIdentity(),
NiFiUserUtils.getNiFiUserIdentity());
final PermissionsDTO permissions =
dtoFactory.createPermissionsDto(usersAuthorizable);
return entityFactory.createUserEntity(snapshot.getComponent(),
dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions);
@@ -997,6 +998,8 @@ public class StandardNiFiServiceFacade implements
NiFiServiceFacade {
}
);
+ logger.info("Tenant Group [{}] updated by [{}]",
userGroupDTO.getIdentity(), NiFiUserUtils.getNiFiUserIdentity());
+
final PermissionsDTO permissions =
dtoFactory.createPermissionsDto(userGroupsAuthorizable);
return entityFactory.createUserGroupEntity(snapshot.getComponent(),
dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions);
}
@@ -2151,6 +2154,8 @@ public class StandardNiFiServiceFacade implements
NiFiServiceFacade {
false, // no user specific policies to remove
dtoFactory.createUserDto(user, userGroups, policyEntities));
+ logger.info("Tenant User [{}] deleted by [{}]",
snapshot.getIdentity(), NiFiUserUtils.getNiFiUserIdentity());
+
return entityFactory.createUserEntity(snapshot, null, permissions);
}
@@ -2186,6 +2191,8 @@ public class StandardNiFiServiceFacade implements
NiFiServiceFacade {
false, // no user group specific policies to remove
dtoFactory.createUserGroupDto(userGroup, users,
policyEntities));
+ logger.info("Tenant Group [{}] deleted by [{}]",
snapshot.getIdentity(), NiFiUserUtils.getNiFiUserIdentity());
+
return entityFactory.createUserGroupEntity(snapshot, null,
permissions);
}
@@ -2586,6 +2593,9 @@ public class StandardNiFiServiceFacade implements
NiFiServiceFacade {
public UserEntity createUser(final Revision revision, final UserDTO
userDTO) {
final String creator = NiFiUserUtils.getNiFiUserIdentity();
final User newUser = userDAO.createUser(userDTO);
+
+ logger.info("Tenant User [{}] created by [{}]", userDTO.getIdentity(),
creator);
+
final Set<TenantEntity> tenantEntities =
userGroupDAO.getUserGroupsForUser(newUser.getIdentifier()).stream()
.map(g ->
g.getIdentifier()).map(mapUserGroupIdToTenantEntity(false)).collect(Collectors.toSet());
final Set<AccessPolicySummaryEntity> policyEntities =
userGroupDAO.getAccessPoliciesForUser(newUser.getIdentifier()).stream()
@@ -2638,6 +2648,8 @@ public class StandardNiFiServiceFacade implements
NiFiServiceFacade {
.map(ap ->
createAccessPolicySummaryEntity(ap)).collect(Collectors.toSet());
final UserGroupDTO newUserGroupDto =
dtoFactory.createUserGroupDto(newUserGroup, tenantEntities, policyEntities);
+ logger.info("Tenant Group [{}] created by [{}]",
userGroupDTO.getIdentity(), creator);
+
final PermissionsDTO permissions =
dtoFactory.createPermissionsDto(authorizableLookup.getTenant());
return entityFactory.createUserGroupEntity(newUserGroupDto,
dtoFactory.createRevisionDTO(new FlowModification(revision, creator)),
permissions);
}