salzhrani / hapi-brute

Brute force plugin for hapi
MIT License
15 stars 2 forks source link

The timeWindow option can only be set globally #2

Open praisane opened 7 years ago

praisane commented 7 years ago

It appears that you can only set the timeWindow option once globally, when registering the hapi-brute plugin, thanks to the way how it is used to construct the TTL for the cache the plugin creates.

All other options can be set on a per-route basis when defining once routes, but the timeWindow not. Well it can be set, but it will not have any effect.

salzhrani commented 7 years ago

It is because there is a single cache which is configured on server registration. I guess it is possible to instantiate another with a different expiry if the route requires it.