Populate request peer metadata across server adapters
- Dominant language
- Erlang
- Stars
- 56
- Forks
- 2
- Avg merge
- 42m
- Merged PRs (30d)
- 2
Description
### Summary
`livery_req:peer/1` is part of the public request model, but the H1, H2, and H3 server adapters currently return `undefined` from `peer_info/1`. This prevents handlers and middleware from safely implementing trusted-proxy processing, client-IP logging, and source-aware access controls.
### Requested behavior
Populate `peer` with `{inet:ip_address(), inet:port_number()}` for accepted server connections across H1, H2, and H3. TLS metadata can remain separate in the existing `tls` field.
It would be helpful to define what happens when peer lookup fails (presumably `undefined`) and add adapter-level tests for IPv4 and IPv6.
The underlying H1/H2 libraries may need a supported connection-info accessor so Livery does not inspect private process state.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the H1, H2, and H3 server adapters and their peer_info/1 implementations, then inspect the underlying H1/H2 connection-info accessors. Add adapter-level IPv4 and IPv6 tests, define the lookup-failure result as described, and verify accepted connections populate peer without changing tls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100