I have a question about getting consistent access to the Request Body in Plug.
According to the documentation for
Plug.Conn.read_body the body is consumed once it is accessed.
If you need to access the body multiple times, it is your responsibility to store it. Finally keep in mind some plugs like Plug.Parsers may read the body, so the body may be unavailable after being accessed by such plugs.
I’m trying to figure out a good way to build a Plug that plays nicely in an ecosystem where downstream code relies on Plug.Parsers handling JSON but some routes need to verify a signature on the raw request body? Is this possible at all or do I need to put a service in front of everything to block unsigned requests to the protected endpoints?