private Map createContext()

in src/main/java/com/epam/digital/data/platform/user/audit/UserImportAuditFacade.java [101:123]


  private Map<String, Object> createContext(Result result, User user, FileObject fileObject) {
    Map<String, Object> context = new HashMap<>();
    putIfNotNull(context, "userId", result.getId());
    putIfNotNull(context, "username", result.getResourceName());
    
    var customAttributes = new HashMap<> (user.getAttributes());
    putIfNotNull(context, "katottg", customAttributes.remove(KATOTTG)); // well known custom attribute
    customAttributes.remove(DRFO); // mandatory custom attribute has sensitive info
    customAttributes.remove(EDRPOU); // mandatory custom attribute has sensitive info
    customAttributes.remove(FULL_NAME); // mandatory custom attribute has sensitive info
    putIfNotNull(context, "customAttributes", trimToNull(customAttributes)); // other custom attributes
    
    putIfNotNull(context, "enabled", true);
    putIfNotNull(context, "realmId", realmInfoProvider.getRealmId());
    putIfNotNull(context, "realmName", realmInfoProvider.getRealmName());
    putIfNotNull(context, "clientId", clientInfoProvider.getClientId());
    putIfNotNull(context, "keycloakClientId", clientInfoProvider.getKeycloakClientId());
    putIfNotNull(context, "roles", user.getRealmRoles());
    putIfNotNull(context, "sourceFileId", fileObject.getId());
    putIfNotNull(context, "sourceFileName", fileObject.getFileName());
    putIfNotNull(context, "sourceFileSHA256Checksum", fileObject.getChecksum());
    return context;
  }