The rule engine is not the hard part. Everyone builds a rule engine. The hard part is deciding what order the checks run in — because the difference between a hash map lookup and a regex match is two orders of magnitude, and you're doing this on every single request.

Six-stage pipeline. Production. 50+ client websites, 100K+ daily requests. I'll trace one request through all of it.

http

POST /api/login HTTP/1.1

Host: client-website.com