MSC2140 Add hash configuration.

This commit is contained in:
Anatoly Sablin
2019-11-06 00:20:39 +03:00
parent 14ad4435bc
commit 8d346037b7
4 changed files with 42 additions and 14 deletions

View File

@@ -3,6 +3,9 @@ package io.kamax.mxisd.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
public class HashingConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(HashingConfig.class);
@@ -12,6 +15,7 @@ public class HashingConfig {
private RotationPolicyEnum rotationPolicy;
private HashStorageEnum hashStorageType;
private long delay = 10;
private List<Algorithm> algorithms = new ArrayList<>();
public void build() {
if (isEnabled()) {
@@ -27,6 +31,11 @@ public class HashingConfig {
}
}
public enum Algorithm {
NONE,
SHA256
}
public enum RotationPolicyEnum {
PER_REQUESTS,
PER_SECONDS
@@ -76,4 +85,12 @@ public class HashingConfig {
public void setDelay(long delay) {
this.delay = delay;
}
public List<Algorithm> getAlgorithms() {
return algorithms;
}
public void setAlgorithms(List<Algorithm> algorithms) {
this.algorithms = algorithms;
}
}