Hi Martin, thanks for your reply. I checked what you suggested, and it makes sense. I’m assuming you meant, that I dont need to store the key in Redis at all, that it’d be enough to just modify the session object straight from the middleware.
The thing is, it’s not working, this is an snippet…
@Hook
def MyPreMiddleware(request, session, spec):
ip = request.get_header('X-Real-Ip') #Obtain IP
request.add_header('x-limit-authorization', ip) # Save IP to request
#Specify what will happen with this session... WRONG?
session.apply_policy_id = "58cae541d81dd609b3d249d5"
session.org_id = "58cad6dfd81dd609b3d249cc"
return request, session
The idea is to have the Pre Middleware apply a policy at this level, and limit requests per IP.
thoughts?