@@ -234,56 +234,77 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
234234 @ Inject
235235 private MessageBus messageBus ;
236236
237- private static final ConfigKey <Integer > IntegrationAPIPort = new ConfigKey <Integer >( "Advanced"
237+ private static final ConfigKey <Integer > IntegrationAPIPort = new ConfigKey <>( ConfigKey . CATEGORY_ADVANCED
238238 , Integer .class
239239 , "integration.api.port"
240240 , "0"
241241 , "Integration (unauthenticated) API port. To disable set it to 0 or negative."
242242 , false
243243 , ConfigKey .Scope .Global );
244- private static final ConfigKey <Long > ConcurrentSnapshotsThresholdPerHost = new ConfigKey <Long >( "Advanced"
244+ private static final ConfigKey <Long > ConcurrentSnapshotsThresholdPerHost = new ConfigKey <>( ConfigKey . CATEGORY_ADVANCED
245245 , Long .class
246246 , "concurrent.snapshots.threshold.perhost"
247247 , null
248248 , "Limits number of snapshots that can be handled by the host concurrently; default is NULL - unlimited"
249249 , true // not sure if this is to be dynamic
250250 , ConfigKey .Scope .Global );
251- private static final ConfigKey <Boolean > EncodeApiResponse = new ConfigKey <Boolean >( "Advanced"
251+ private static final ConfigKey <Boolean > EncodeApiResponse = new ConfigKey <>( ConfigKey . CATEGORY_ADVANCED
252252 , Boolean .class
253253 , "encode.api.response"
254254 , "false"
255255 , "Do URL encoding for the api response, false by default"
256256 , false
257257 , ConfigKey .Scope .Global );
258- static final ConfigKey <String > JSONcontentType = new ConfigKey <String >( "Advanced"
258+ static final ConfigKey <String > JSONcontentType = new ConfigKey <>( ConfigKey . CATEGORY_ADVANCED
259259 , String .class
260260 , "json.content.type"
261261 , "application/json; charset=UTF-8"
262262 , "Http response content type for .js files (default is text/javascript)"
263263 , false
264264 , ConfigKey .Scope .Global );
265- static final ConfigKey <Boolean > EnableSecureSessionCookie = new ConfigKey <Boolean >( "Advanced"
265+ static final ConfigKey <Boolean > EnableSecureSessionCookie = new ConfigKey <>( ConfigKey . CATEGORY_ADVANCED
266266 , Boolean .class
267267 , "enable.secure.session.cookie"
268268 , "false"
269269 , "Session cookie is marked as secure if this is enabled. Secure cookies only work when HTTPS is used."
270270 , false
271271 , ConfigKey .Scope .Global );
272- private static final ConfigKey <String > JSONDefaultContentType = new ConfigKey <String > ("Advanced"
272+ private static final ConfigKey <String > JSONDefaultContentType = new ConfigKey <> (ConfigKey . CATEGORY_ADVANCED
273273 , String .class
274274 , "json.content.type"
275275 , "application/json; charset=UTF-8"
276276 , "Http response content type for JSON"
277277 , false
278278 , ConfigKey .Scope .Global );
279279
280- private static final ConfigKey <Boolean > UseEventAccountInfo = new ConfigKey <Boolean >( "advanced"
280+ private static final ConfigKey <Boolean > UseEventAccountInfo = new ConfigKey <>( ConfigKey . CATEGORY_ADVANCED
281281 , Boolean .class
282282 , "event.accountinfo"
283283 , "false"
284284 , "use account info in event logging"
285285 , true
286286 , ConfigKey .Scope .Global );
287+ static final ConfigKey <Boolean > useForwardHeader = new ConfigKey <>(ConfigKey .CATEGORY_NETWORK
288+ , Boolean .class
289+ , "proxy.header.verify"
290+ , "false"
291+ , "enables/disables checking of ipaddresses from a proxy set header. See \" proxy.header.names\" for the headers to allow."
292+ , true
293+ , ConfigKey .Scope .Global );
294+ static final ConfigKey <String > listOfForwardHeaders = new ConfigKey <>(ConfigKey .CATEGORY_NETWORK
295+ , String .class
296+ , "proxy.header.names"
297+ , "X-Forwarded-For,HTTP_CLIENT_IP,HTTP_X_FORWARDED_FOR"
298+ , "a list of names to check for allowed ipaddresses from a proxy set header. See \" proxy.cidr\" for the proxies allowed to set these headers."
299+ , true
300+ , ConfigKey .Scope .Global );
301+ static final ConfigKey <String > proxyForwardList = new ConfigKey <>(ConfigKey .CATEGORY_NETWORK
302+ , String .class
303+ , "proxy.cidr"
304+ , ""
305+ , "a list of cidrs for which \" proxy.header.names\" are honoured if the \" Remote_Addr\" is in this list."
306+ , true
307+ , ConfigKey .Scope .Global );
287308
288309 @ Override
289310 public boolean configure (final String name , final Map <String , Object > params ) throws ConfigurationException {
@@ -1499,7 +1520,10 @@ public ConfigKey<?>[] getConfigKeys() {
14991520 ConcurrentSnapshotsThresholdPerHost ,
15001521 EncodeApiResponse ,
15011522 EnableSecureSessionCookie ,
1502- JSONDefaultContentType
1523+ JSONDefaultContentType ,
1524+ proxyForwardList ,
1525+ useForwardHeader ,
1526+ listOfForwardHeaders
15031527 };
15041528 }
15051529}
0 commit comments