Fix to many request filter URL configuration, order and added a config

for the UI.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
kaizimmerm
2017-05-17 17:46:07 +02:00
parent cacb32da1a
commit 28765b168c
4 changed files with 61 additions and 20 deletions

View File

@@ -48,8 +48,8 @@ public class DosFilter extends OncePerRequestFilter {
private final Cache<String, AtomicInteger> writeCountCache = CacheBuilder.newBuilder()
.expireAfterAccess(1, TimeUnit.SECONDS).build();
private final Integer maxRead;
private final Integer maxWrite;
private final int maxRead;
private final int maxWrite;
private final Pattern whitelist;
@@ -73,7 +73,7 @@ public class DosFilter extends OncePerRequestFilter {
* the header containing the forwarded IP address e.g.
* {@code x-forwarded-for}
*/
public DosFilter(final Integer maxRead, final Integer maxWrite, final String ipDosWhiteListPattern,
public DosFilter(final int maxRead, final int maxWrite, final String ipDosWhiteListPattern,
final String ipBlackListPattern, final String forwardHeader) {
this.maxRead = maxRead;

View File

@@ -40,8 +40,7 @@ public class HawkbitSecurityProperties {
private String blacklist = "";
/**
* Name of the http header from which the remote ip is extracted for DDI
* connected clients.
* Name of the http header from which the remote ip is extracted.
*/
private String remoteIpHeader = "X-Forwarded-For";
@@ -98,6 +97,11 @@ public class HawkbitSecurityProperties {
private int maxRolloutGroupsPerRollout = 500;
private final Filter filter = new Filter();
private final Filter uiFilter = new Filter();
public Filter getUiFilter() {
return uiFilter;
}
public Filter getFilter() {
return filter;