middleware #1

Open
opened 2024-12-29 06:08:33 +00:00 by unusualevent · 1 comment
Owner
No description provided.
Author
Owner

pre-request per-user dictionary of allowed IPs? vs sqlite round-trip? or at least, cached per user.

select from allowed_ips where user=x and ip=y

if allowing CIDR ranges...

ipAddress, ipNet, err := net.ParseCIDR("123.45.67.64/27") <- from settings
ipNet.Contains(net.ParseIP("123.45.67.69") <- from r.RemoteAddr (unless r.Header.Get("X-Forwarded-For"), in which case it either needs to be told the depth, or the list of trusted proxy addresses, or learn those, guess, and display to the user)

pre-request per-user dictionary of allowed IPs? vs sqlite round-trip? or at least, cached per user. select from allowed_ips where user=x and ip=y if allowing CIDR ranges... ipAddress, ipNet, err := net.ParseCIDR("123.45.67.64/27") <- from settings ipNet.Contains(net.ParseIP("123.45.67.69") <- from r.RemoteAddr (unless r.Header.Get("X-Forwarded-For"), in which case it either needs to be told the depth, or the list of trusted proxy addresses, or learn those, guess, and display to the user)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: use/haunt#1
No description provided.