Commit beacc73f by Greg Price

Merge pull request #59 from edx/gprice/header-auth

Allow authentication by HTTP header
parents 6b31385f cf39aabd
...@@ -61,7 +61,8 @@ DEFAULT_PER_PAGE = 20 ...@@ -61,7 +61,8 @@ DEFAULT_PER_PAGE = 20
if RACK_ENV.to_s != "test" # disable api_key auth in test environment if RACK_ENV.to_s != "test" # disable api_key auth in test environment
before do before do
error 401 unless params[:api_key] == CommentService.config[:api_key] api_key = CommentService.config[:api_key]
error 401 unless params[:api_key] == api_key or env["HTTP_X_EDX_API_KEY"] == api_key
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment