Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add template for elli_basicauth elli_handler

  • Loading branch information...
commit c6f7c8ffc60bb23af7483fc5d4bbc713848f5862 1 parent a04cabf
@martinrehfeld authored
Showing with 38 additions and 0 deletions.
  1. +38 −0 src/elli_basicauth.erl
View
38 src/elli_basicauth.erl
@@ -0,0 +1,38 @@
+%% @doc Elli basicauth overview
+%%
+%% This middleware provides basic authentication to protect
+%% Reqs based on a user-configured Predicate
+
+-module(elli_basicauth).
+-behaviour(elli_handler).
+-export([handle/2, handle_event/3]).
+
+
+handle(_Req, _Config) ->
+ ignore.
+
+
+handle_event(request_complete, [_Req, _ResponseCode, _ResponseHeaders,
+ _ResponseBody, _Timings], _Config) ->
+ ok;
+
+handle_event(request_throw, _, _Config) ->
+ ok;
+
+handle_event(request_exit, _, _Config) ->
+ ok;
+
+handle_event(request_error, _, _Config) ->
+ ok;
+
+handle_event(request_parse_error, [_Data], _Args) ->
+ ok;
+
+handle_event(client_closed, [_When], _Config) ->
+ ok;
+
+handle_event(client_timeout, [_When], _Config) ->
+ ok;
+
+handle_event(elli_startup, [], _Config) ->
+ ok.
Please sign in to comment.
Something went wrong with that request. Please try again.