Was working on implementing a Filter for allowing restricted access based on IP and User Credentials. Though about sharing it with dev community
Need - Wanted a filter that would allow restricted access to Server based on a) IP and b) User Name This a common requirement on a lot of enterprise platforms. Was using Blacklist filter for this. The default implementation uses a list of addresses to block and traverses the list each time. Hmm, could afford this iteration each time. Using hashmap for storing user names was a messy implementation. This is what I did 1. Used hashmap for storing allowed IP's (they are very less in number, even a 100 won't hurt) 2. Used embedded ApacheDS for storing the User credentials (LDAP is a better choice as its better organized, fast and can later use it for a) Now the filter uses both to allow a connection. I am still in the process of implementation of this My queries are 1. Is there a better way to store and manage IP Addresses. Can I get rid of hashmap ? 2. Is there a better approach for allowing access on select keys like user name, state or attributes that can be read from input packets The only big problem that I see is, ApacheDS 1.5.4 come bundled with MINA 1.1.6 jars and I am using MINA 2.0 M3 For now I can afford to have LDAP outside, but eventually would like to have it embedded within the implementation FYI: Its just a standalone filter implementation and writing it just for fun. Suggestions..... -- thanks ashish Blog: http://www.ashishpaliwal.com/blog My Photo Galleries: http://www.pbase.com/ashishpaliwal
