plug_require_header icon indicating copy to clipboard operation
plug_require_header copied to clipboard

Allow to set required header values

Open sobolevn opened this issue 6 years ago • 0 comments

My use-case is pretty simple: I want to use webhooks with a secret key. Both parties know this value.

And currently I write this code:

plug PlugRequireHeader, headers: [auth_token: "X-Gitlab-Token"]
plug :verify_auth_token

And then I actually verify it.

So, my proposal is to allow something like:

plug PlugRequireHeader, headers: [auth_token: %{"X-Gitlab-Token" => System.get_env("SECRET_KEY")}]

sobolevn avatar Feb 13 '19 17:02 sobolevn