That’s pretty much what I was going with; however, by reflex I made my lookup use a simple service with an Ormlite friendly POCO for BlacklistItem and used a built-in handler. I like your Gandalf reference, but I may opt for an xfiles Trust No One reference.
If others have used 3rd party blacklist services, I’m all ears!
Copied my code snippet for reference:
if (appSettings.Get<bool>("useBlacklist", false))
return Resolve<BlacklistService>().IsBlacklisted(req.RemoteIp, req.PathInfo)
? new ServiceStack.Host.Handlers.ForbiddenHttpHandler()
public bool IsBlacklisted(string ip, string path = null)
var ev = OrmLiteConfig.DialectProvider.SqlExpression<BlacklistInfo>();
ev.Or(a => a.ip == ip);
ev.Or(a => a.path == path);
if (Db.Count(ev) > 0)