rzo1 commented on code in PR #1728: URL: https://github.com/apache/stormcrawler/pull/1728#discussion_r2535416411
########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; Review Comment: Why package private? ########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; + + PiiRedacter piiRedacter; + + private boolean piiEnabled = false; + + public static final String REDACTED_HTML = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'><title>REDACTED</title></head><body>REDACTED</body></html>"; + + public static final byte[] REDACTED_BYTES = REDACTED_HTML.getBytes(StandardCharsets.UTF_8); + + /** + * Returns a Scheduler instance based on the configuration * + */ + public static PiiRedacter getInstance(Map<String, Object> stormConf) { + PiiRedacter redacter; + + String className = ConfUtils.getString(stormConf, PII_REDACTER_CLASS_PARAM); + if (className == null || className.isEmpty()) { + throw new RuntimeException("PiiRedacter class name must be defined in the configuration (pii.redacter.class)"); + } + + LOG.info("Loading PII Redacter class, name={}", className); + try { + redacter = InitialisationUtil.initializeFromQualifiedName(className, PiiRedacter.class); + } catch (Exception e) { + throw new RuntimeException("Can't instantiate " + className, e); + } + + LOG.info("Initializing PII Redacter instance"); + try { + redacter.init(stormConf); + } catch (Exception e) { + LOG.error("Error while initializing PII Redacter", e); + } + + return redacter; + } + + public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { + // Uncomment if extending StatusEmitterBolt + //super.prepare(topoConf, context, collector); + + this._collector = collector; + + this.piiRedacter = getInstance(topoConf); + LOG.info("Initialized PiiRedacter instance"); + + // Get language metadata field name + String confLanguageField = ConfUtils.getString(topoConf, "pii.language.field"); + if (confLanguageField != null && !confLanguageField.isEmpty()) { + languageFieldName = confLanguageField; + } + LOG.info("PII language field: {}", languageFieldName); + + piiEnabled = ConfUtils.getBoolean(topoConf, PII_ENABLE_FIELD, false); + LOG.info("PII disabled: {}", piiEnabled); + + } + + @Override + public void execute(Tuple input) { + String url = input.getStringByField(FIELD_URL); + Metadata metadata = (Metadata) input.getValueByField(FIELD_METADATA); + String text = input.getStringByField(FIELD_TEXT); + byte[] originalBytes = input.getBinaryByField(FIELD_CONTENT); + + LOG.info("Processing URL for PII redaction: {}", url); + + if (!piiEnabled) { + emitTuple(input, url, originalBytes, metadata, text); + this._collector.ack(input); + return; + } + + if (StringUtils.isBlank(text)) { + LOG.info("No text to process for URL: {}", url); + metadata.addValue("pii.processed", "false"); + // Force the binary content to a dummy content + emitTuple(input, url, REDACTED_BYTES, metadata, ""); Review Comment: Unsure if we should default to a redacted html here, if the original content was empty. Why not just return (similar to pii is disabled). Any reason for this? ########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; + + PiiRedacter piiRedacter; + + private boolean piiEnabled = false; + + public static final String REDACTED_HTML = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'><title>REDACTED</title></head><body>REDACTED</body></html>"; + + public static final byte[] REDACTED_BYTES = REDACTED_HTML.getBytes(StandardCharsets.UTF_8); + + /** + * Returns a Scheduler instance based on the configuration * + */ + public static PiiRedacter getInstance(Map<String, Object> stormConf) { + PiiRedacter redacter; + + String className = ConfUtils.getString(stormConf, PII_REDACTER_CLASS_PARAM); + if (className == null || className.isEmpty()) { + throw new RuntimeException("PiiRedacter class name must be defined in the configuration (pii.redacter.class)"); + } + + LOG.info("Loading PII Redacter class, name={}", className); + try { + redacter = InitialisationUtil.initializeFromQualifiedName(className, PiiRedacter.class); + } catch (Exception e) { + throw new RuntimeException("Can't instantiate " + className, e); + } + + LOG.info("Initializing PII Redacter instance"); + try { + redacter.init(stormConf); + } catch (Exception e) { + LOG.error("Error while initializing PII Redacter", e); + } + + return redacter; + } + + public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { + // Uncomment if extending StatusEmitterBolt + //super.prepare(topoConf, context, collector); + + this._collector = collector; + + this.piiRedacter = getInstance(topoConf); + LOG.info("Initialized PiiRedacter instance"); + + // Get language metadata field name + String confLanguageField = ConfUtils.getString(topoConf, "pii.language.field"); + if (confLanguageField != null && !confLanguageField.isEmpty()) { + languageFieldName = confLanguageField; + } + LOG.info("PII language field: {}", languageFieldName); + + piiEnabled = ConfUtils.getBoolean(topoConf, PII_ENABLE_FIELD, false); + LOG.info("PII disabled: {}", piiEnabled); + + } + + @Override + public void execute(Tuple input) { + String url = input.getStringByField(FIELD_URL); + Metadata metadata = (Metadata) input.getValueByField(FIELD_METADATA); + String text = input.getStringByField(FIELD_TEXT); + byte[] originalBytes = input.getBinaryByField(FIELD_CONTENT); + + LOG.info("Processing URL for PII redaction: {}", url); + + if (!piiEnabled) { + emitTuple(input, url, originalBytes, metadata, text); + this._collector.ack(input); + return; + } + + if (StringUtils.isBlank(text)) { + LOG.info("No text to process for URL: {}", url); + metadata.addValue("pii.processed", "false"); + // Force the binary content to a dummy content + emitTuple(input, url, REDACTED_BYTES, metadata, ""); + this._collector.ack(input); + return; + } + + try { + String language = metadata.getFirstValue(languageFieldName); + String redacted = (language != null) ? + piiRedacter.redact(text, language) : + piiRedacter.redact(text); + + if (redacted == null) { + throw new Exception("PII Redacter returned null"); + } + + metadata.addValue("pii.processed", "true"); + + // Force the binary content to a dummy content + emitTuple(input, url, REDACTED_BYTES, metadata, redacted); Review Comment: Why do we force the binary content to dummy content here, if we have `redacted`? Shouldn't we set it to `redacted.getBytes(...)` ? ########## external/presidio/pom.xml: ########## @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.stormcrawler</groupId> + <artifactId>stormcrawler-external</artifactId> + <version>3.5.1-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>presidio</artifactId> + <packaging>jar</packaging> + + <name>stormcrawler-presidio</name> + <url>https://github.com/apache/stormcrawler/tree/master/external/presidio</url> + <description>Interface with Microsoft Presisio for Data Protection and De-identification</description> + + <properties> + <aws.version>1.12.792</aws.version> Review Comment: why does this need aws? ########## core/src/main/java/org/apache/stormcrawler/pii/PiiRedacter.java: ########## @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import java.util.Map; + +/** + * An interface for bolts implementing PII redaction + */ +public interface PiiRedacter { + void init(Map<String, Object> topologyConf) throws Exception; + + /** + * Redacts PII from the input string using default language settings + * (e.g. no language or a default language configured at initialization) + * + * @param input the input string possibly containing PII + * @return the input string with PII redacted + */ + String redact(String input); + + /** + * Redacts PII from the input string using the specified language + * @param input the input string possibly containing PII + * @param language the language to use for PII redaction + * @return Review Comment: Missing ########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; + + PiiRedacter piiRedacter; Review Comment: Why package private? ########## core/src/test/java/org/apache/stormcrawler/pii/MockPiiRedacter.java: ########## @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import java.util.Map; + +/** + * Mock PII Redacter implementation for testing purposes. + * This class simulates redaction by replacing occurrences of the word"secret" + * with "*****". + */ + +public class MockPiiRedacter implements PiiRedacter { + + @Override public void init(Map<String, Object> conf) {} + + @Override public String redact(String content) { + return redact(content, null); + } + + @Override public String redact(String content, String language) { + // simple redaction logic for the test + return content.replaceAll("secret", "*****"); Review Comment: can just be `replace`, no regex needed. ########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; + + PiiRedacter piiRedacter; + + private boolean piiEnabled = false; + + public static final String REDACTED_HTML = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'><title>REDACTED</title></head><body>REDACTED</body></html>"; + + public static final byte[] REDACTED_BYTES = REDACTED_HTML.getBytes(StandardCharsets.UTF_8); + + /** + * Returns a Scheduler instance based on the configuration * + */ + public static PiiRedacter getInstance(Map<String, Object> stormConf) { + PiiRedacter redacter; + + String className = ConfUtils.getString(stormConf, PII_REDACTER_CLASS_PARAM); + if (className == null || className.isEmpty()) { + throw new RuntimeException("PiiRedacter class name must be defined in the configuration (pii.redacter.class)"); + } + + LOG.info("Loading PII Redacter class, name={}", className); + try { + redacter = InitialisationUtil.initializeFromQualifiedName(className, PiiRedacter.class); + } catch (Exception e) { + throw new RuntimeException("Can't instantiate " + className, e); + } + + LOG.info("Initializing PII Redacter instance"); + try { + redacter.init(stormConf); + } catch (Exception e) { + LOG.error("Error while initializing PII Redacter", e); + } + + return redacter; + } + + public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { + // Uncomment if extending StatusEmitterBolt + //super.prepare(topoConf, context, collector); + + this._collector = collector; + + this.piiRedacter = getInstance(topoConf); + LOG.info("Initialized PiiRedacter instance"); + + // Get language metadata field name + String confLanguageField = ConfUtils.getString(topoConf, "pii.language.field"); + if (confLanguageField != null && !confLanguageField.isEmpty()) { + languageFieldName = confLanguageField; + } + LOG.info("PII language field: {}", languageFieldName); + + piiEnabled = ConfUtils.getBoolean(topoConf, PII_ENABLE_FIELD, false); + LOG.info("PII disabled: {}", piiEnabled); + + } + + @Override + public void execute(Tuple input) { + String url = input.getStringByField(FIELD_URL); + Metadata metadata = (Metadata) input.getValueByField(FIELD_METADATA); + String text = input.getStringByField(FIELD_TEXT); + byte[] originalBytes = input.getBinaryByField(FIELD_CONTENT); + + LOG.info("Processing URL for PII redaction: {}", url); + + if (!piiEnabled) { + emitTuple(input, url, originalBytes, metadata, text); + this._collector.ack(input); + return; + } + + if (StringUtils.isBlank(text)) { + LOG.info("No text to process for URL: {}", url); + metadata.addValue("pii.processed", "false"); + // Force the binary content to a dummy content + emitTuple(input, url, REDACTED_BYTES, metadata, ""); + this._collector.ack(input); + return; + } + + try { + String language = metadata.getFirstValue(languageFieldName); + String redacted = (language != null) ? + piiRedacter.redact(text, language) : + piiRedacter.redact(text); + + if (redacted == null) { + throw new Exception("PII Redacter returned null"); Review Comment: Is this needed? Shouldn't we fallback or just default to something instead of raising a hard exception here; triggering a re-try in the topology? ########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; + + PiiRedacter piiRedacter; + + private boolean piiEnabled = false; + + public static final String REDACTED_HTML = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'><title>REDACTED</title></head><body>REDACTED</body></html>"; + + public static final byte[] REDACTED_BYTES = REDACTED_HTML.getBytes(StandardCharsets.UTF_8); + + /** + * Returns a Scheduler instance based on the configuration * + */ + public static PiiRedacter getInstance(Map<String, Object> stormConf) { + PiiRedacter redacter; + + String className = ConfUtils.getString(stormConf, PII_REDACTER_CLASS_PARAM); + if (className == null || className.isEmpty()) { + throw new RuntimeException("PiiRedacter class name must be defined in the configuration (pii.redacter.class)"); + } + + LOG.info("Loading PII Redacter class, name={}", className); + try { + redacter = InitialisationUtil.initializeFromQualifiedName(className, PiiRedacter.class); + } catch (Exception e) { + throw new RuntimeException("Can't instantiate " + className, e); + } + + LOG.info("Initializing PII Redacter instance"); + try { + redacter.init(stormConf); + } catch (Exception e) { + LOG.error("Error while initializing PII Redacter", e); + } + + return redacter; + } + + public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { + // Uncomment if extending StatusEmitterBolt + //super.prepare(topoConf, context, collector); + + this._collector = collector; + + this.piiRedacter = getInstance(topoConf); + LOG.info("Initialized PiiRedacter instance"); + + // Get language metadata field name + String confLanguageField = ConfUtils.getString(topoConf, "pii.language.field"); + if (confLanguageField != null && !confLanguageField.isEmpty()) { + languageFieldName = confLanguageField; + } + LOG.info("PII language field: {}", languageFieldName); + + piiEnabled = ConfUtils.getBoolean(topoConf, PII_ENABLE_FIELD, false); + LOG.info("PII disabled: {}", piiEnabled); + + } + + @Override + public void execute(Tuple input) { + String url = input.getStringByField(FIELD_URL); + Metadata metadata = (Metadata) input.getValueByField(FIELD_METADATA); + String text = input.getStringByField(FIELD_TEXT); + byte[] originalBytes = input.getBinaryByField(FIELD_CONTENT); + + LOG.info("Processing URL for PII redaction: {}", url); + + if (!piiEnabled) { + emitTuple(input, url, originalBytes, metadata, text); Review Comment: Can't we do `this.collector.emit(tuple, tuple.getValues());` directly here and move the input field retrieval after the enabled check? ########## external/presidio/src/main/java/org/apache/stormcrawler/pii/PresidioRedacter.java: ########## @@ -0,0 +1,313 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.LoggerFactory; + +import org.apache.stormcrawler.util.ConfUtils; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; + +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +/** + * PII Redacter implementation for Microsoft Presidio + */ +public class PresidioRedacter implements PiiRedacter { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PresidioRedacter.class); + + private static final String PRESIDIO_ANONYMIZER_ENDPOINT = "presidio.anonymizer.endpoint"; + + private static final String PRESIDIO_ANALYZER_ENDPOINT = "presidio.analyzer.endpoint"; + + private static final String PRESIDIO_ANALYZER_ENTITIES = "presidio.analyzer.entities"; + + private static final String PRESIDIO_SUPPORTED_LANGUAGES = "presidio.supported.languages"; + + private String analyzerEndpoint = "https://your-presidio-endpoint/analyze"; + + private String anonymizerEndpoint = "https://your-presidio-endpoint/anonymize"; ; + + private List<String> analyzerEntities = null; + + private List<String> supportedLanguages = Arrays.asList("en", "fr", "de", "xx"); + + private OkHttpClient httpClient = new OkHttpClient(); Review Comment: Should we make some of the properties configurable or re-use existing configuration, i.e. user-agent, timeouts or a like? ########## core/src/main/java/org/apache/stormcrawler/pii/PiiBolt.java: ########## @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import org.apache.commons.lang3.StringUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.stormcrawler.Metadata; +import org.apache.stormcrawler.util.ConfUtils; +import org.apache.stormcrawler.util.InitialisationUtil; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * StormCrawler bolt that performs PII redaction on the content of web pages + * before they are passed to the indexing or persistence bolt.<br> + * If enabled, the HTML content will be overwritten with a dummy HTML page (containing just "REDACTED")<br><br> + * <b>pii.redacter.class</b> is the name of the class implementing the PiiInterface interface (e.g. org.apache.stormcrawler.pii.PresidioRedacter)<br> + * <b>pii.language.field</b>, if set, allows to set the name of a Metadata field that contains the language to be passed to the PII redacter instance + * + */ +@SuppressWarnings("serial") +public class PiiBolt extends BaseRichBolt { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PiiBolt.class); + + /* + * Name of config field defining the PII Redacter class + * (This class must implement the PiiRedacter interface + */ + public static final String PII_REDACTER_CLASS_PARAM = "pii.redacter.class"; + + /* + * Name of the field for configurating language detection + */ + public static final String PII_DETECT_LANGUAGE_PARAM = "pii.detect.language"; + + /* + * Name of the field for defining Metadata field containing language + */ + public static final String PII_LANGUAGE_FIELD = "pii.language.field"; + + /* + * Name of the field for disabling PII removal + */ + public static final String PII_ENABLE_FIELD = "pii.removal.enable"; + + private static final String FIELD_URL = "url"; + private static final String FIELD_CONTENT = "content"; + private static final String FIELD_METADATA = "metadata"; + private static final String FIELD_TEXT = "text"; + + + // Default value for language metadata field + private String languageFieldName = "parse.lang"; + + OutputCollector _collector; + + PiiRedacter piiRedacter; + + private boolean piiEnabled = false; + + public static final String REDACTED_HTML = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'><title>REDACTED</title></head><body>REDACTED</body></html>"; + + public static final byte[] REDACTED_BYTES = REDACTED_HTML.getBytes(StandardCharsets.UTF_8); + + /** + * Returns a Scheduler instance based on the configuration * + */ + public static PiiRedacter getInstance(Map<String, Object> stormConf) { + PiiRedacter redacter; + + String className = ConfUtils.getString(stormConf, PII_REDACTER_CLASS_PARAM); + if (className == null || className.isEmpty()) { + throw new RuntimeException("PiiRedacter class name must be defined in the configuration (pii.redacter.class)"); + } + + LOG.info("Loading PII Redacter class, name={}", className); + try { + redacter = InitialisationUtil.initializeFromQualifiedName(className, PiiRedacter.class); + } catch (Exception e) { + throw new RuntimeException("Can't instantiate " + className, e); + } + + LOG.info("Initializing PII Redacter instance"); + try { + redacter.init(stormConf); + } catch (Exception e) { + LOG.error("Error while initializing PII Redacter", e); + } + + return redacter; + } + + public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { + // Uncomment if extending StatusEmitterBolt + //super.prepare(topoConf, context, collector); + + this._collector = collector; + + this.piiRedacter = getInstance(topoConf); + LOG.info("Initialized PiiRedacter instance"); + + // Get language metadata field name + String confLanguageField = ConfUtils.getString(topoConf, "pii.language.field"); + if (confLanguageField != null && !confLanguageField.isEmpty()) { + languageFieldName = confLanguageField; + } + LOG.info("PII language field: {}", languageFieldName); + + piiEnabled = ConfUtils.getBoolean(topoConf, PII_ENABLE_FIELD, false); + LOG.info("PII disabled: {}", piiEnabled); + + } + + @Override + public void execute(Tuple input) { + String url = input.getStringByField(FIELD_URL); + Metadata metadata = (Metadata) input.getValueByField(FIELD_METADATA); + String text = input.getStringByField(FIELD_TEXT); + byte[] originalBytes = input.getBinaryByField(FIELD_CONTENT); + + LOG.info("Processing URL for PII redaction: {}", url); + + if (!piiEnabled) { + emitTuple(input, url, originalBytes, metadata, text); + this._collector.ack(input); + return; + } + + if (StringUtils.isBlank(text)) { + LOG.info("No text to process for URL: {}", url); + metadata.addValue("pii.processed", "false"); + // Force the binary content to a dummy content + emitTuple(input, url, REDACTED_BYTES, metadata, ""); + this._collector.ack(input); + return; + } + + try { + String language = metadata.getFirstValue(languageFieldName); + String redacted = (language != null) ? + piiRedacter.redact(text, language) : + piiRedacter.redact(text); + + if (redacted == null) { + throw new Exception("PII Redacter returned null"); + } + + metadata.addValue("pii.processed", "true"); + + // Force the binary content to a dummy content + emitTuple(input, url, REDACTED_BYTES, metadata, redacted); + } catch (Exception e) { + LOG.error("Error during PII redaction for URL {}: {}", url, e.getMessage()); + metadata.addValue("pii.error", e.getMessage()); + + // How to handle the content in case of error ? + emitTuple(input, url, originalBytes, metadata, text); Review Comment: Fail soft imho. So just return the original data + the added metadata? ########## external/presidio/README.md: ########## @@ -0,0 +1,59 @@ +# stormcrawler-aws Review Comment: This README needs an update. Looks wrong to me. ########## core/src/test/java/org/apache/stormcrawler/pii/PiiBoltTest.java: ########## @@ -0,0 +1,202 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import static org.junit.jupiter.api.Assertions.*; Review Comment: please avoid star imports. ########## external/presidio/src/main/java/org/apache/stormcrawler/pii/PresidioRedacter.java: ########## @@ -0,0 +1,313 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.stormcrawler.pii; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.LoggerFactory; + +import org.apache.stormcrawler.util.ConfUtils; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; + +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +/** + * PII Redacter implementation for Microsoft Presidio + */ +public class PresidioRedacter implements PiiRedacter { + + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PresidioRedacter.class); + + private static final String PRESIDIO_ANONYMIZER_ENDPOINT = "presidio.anonymizer.endpoint"; + + private static final String PRESIDIO_ANALYZER_ENDPOINT = "presidio.analyzer.endpoint"; + + private static final String PRESIDIO_ANALYZER_ENTITIES = "presidio.analyzer.entities"; + + private static final String PRESIDIO_SUPPORTED_LANGUAGES = "presidio.supported.languages"; + + private String analyzerEndpoint = "https://your-presidio-endpoint/analyze"; + + private String anonymizerEndpoint = "https://your-presidio-endpoint/anonymize"; ; + + private List<String> analyzerEntities = null; + + private List<String> supportedLanguages = Arrays.asList("en", "fr", "de", "xx"); + + private OkHttpClient httpClient = new OkHttpClient(); + + public static final MediaType JSON = MediaType.get("application/json"); + + public PresidioRedacter() { + LOG.info("Created PresidioRedactor instance"); + } + + private ObjectMapper objectMapper = new ObjectMapper().registerModule(new Jdk8Module()); + + class AnalyzerPayload { Review Comment: I guess, that these inner classes can be static ########## external/presidio/pom.xml: ########## @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.stormcrawler</groupId> + <artifactId>stormcrawler-external</artifactId> + <version>3.5.1-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>presidio</artifactId> + <packaging>jar</packaging> + + <name>stormcrawler-presidio</name> + <url>https://github.com/apache/stormcrawler/tree/master/external/presidio</url> + <description>Interface with Microsoft Presisio for Data Protection and De-identification</description> + + <properties> + <aws.version>1.12.792</aws.version> + </properties> + + <dependencies> + <!-- Java 8 Datatypes --> + <dependency> Review Comment: For what reason do we need jdk8 datatypes? We are on Java 11 as a baseline atm, so no need for that one, imho with normal ObjectMapper Jackson usage? -- 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]
