-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What is the bug?
Hello guys, I have an use case where I need to stop my workflow when for example an Email is detected instead just applying the REDACTED message
The detection is working well and I suppose that the alert service is what I need. But, I'm getting no alerts on DefaultAlertService, take a look on my code:
final var email = new EmailAddress();
final var emailStrategy = new EmailAddressFilterStrategy();
emailStrategy.setAlert(true);
email.setEmailAddressFilterStrategies(List.of(emailStrategy));
final var identifiers = new Identifiers();
identifiers.setEmailAddress(email);
final Policy policy = new Policy();
policy.setIdentifiers(identifiers);
final var cache = new InMemoryCache();
final var alertService = new DefaultAlertService(cache);
final FilterConfiguration filterConfiguration = new FilterConfiguration.FilterConfigurationBuilder()
.withAlertService(alertService)
.withAnonymizationService(new AgeAnonymizationService(cache))
.build();
final var emailFilter = new EmailAddressFilter(filterConfiguration, false, false);
FilterResult result = emailFilter.filter(policy, null, null, 0, candidate, new HashMap<>());
// result contains spans about detected emails
// alert service getAlerts() return empty list
// cache service also is empty
It's a bug or i'm using wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working