Open sobolevn opened 5 years ago
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")}]
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:
And then I actually verify it.
So, my proposal is to allow something like: