Crowdhailer

Crowdhailer

Creator of Raxx

Plug to validate signature and digest HTTP headers

I am building an application where we have the requirement to check the digest and signature headers sent in HTTP requests.

The digest header contains a hashed version of the request body. (info)
The signature headers contains a signed hash of the other headers in the request. (info)

Using the combination of these standards the whole request an be secured.

Are there any plugs that do one or both of the above?

I have started implementing one myself, however the digest plug needs to read the body but that can only be done once for a conn.

Most Liked

sribe

sribe

Highly likely that you may need your plug to read the body, and stash it in the conn for downstream plugs to use. I’ve had to do that to support a legacy API where the JSON body could contain authentication info that needs to be checked on every call.

Crowdhailer

Crowdhailer

Creator of Raxx

This is more or less what we ended up doing. Couldn’t think of anything better

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement