Skip to content

Instantly share code, notes, and snippets.

View CandyGumdrop's full-sized avatar

Candy Gumdrop CandyGumdrop

View GitHub Profile
@foxnewsnetwork
foxnewsnetwork / exposition.markdown
Created September 5, 2015 23:54
Elixir application module attributes production loading

The setup

In my Elixir phoenix web app, I have a plug which handles requests made to an internal endpoint which forbids access to all users without a proper authorization in the request header.

Sounds simple right? Well it is, the below is my plug. It checks if the incoming request has a "simwms-master-key" field, and passes all users who have that key.