anchor.diff:  
   allowed_methods(Req, State) ->
       {['POST'], Req, State}.
  +
  +is_authorized(Req, State) ->
  +    case cowboy_http_req:header(<<"Authorization">>, Req) of
  +        {<<"Basic ", Base64/binary>>, Req2} ->
  +            case binary:split(base64:decode(Base64), <<":">>) of
  +                [_User, TokenId = <<"t.", _/binary>>] ->
  +                    case logplex_token:lookup(TokenId) of
  +                        undefined ->
  +                            {{false, <<"Basic realm=Logplex">>}, Req2, State};
  +                        Token ->
  +                            Name = logplex_token:name(Token),
  +                            ChanId = logplex_token:channel_id(Token),
  +                            {true, Req2, State#state{name=Name,
  +                                                     channel_id=ChanId}}
  +                    end;
  +                _ ->
  +                    {{false, <<"Basic realm=Logplex">>}, Req2, State}
  +            end;
  +        {_, Req2} ->
  +            {{false, <<"Basic realm=Logplex">>}, Req2, State}
  +    end.
   
   known_content_type(Req, State) ->
       case cowboy_http_req:header(<<"Content-Type">>, Req) of
  
positive.code: %%             {false, Req2, State2}
  %%     end.
  
  process_post(Req, State = #state{token = Token})
               when is_binary(Token) ->
      case parse_logplex_body(Req, State) of
          {parsed, Req2, State2 = #state{msgs = Msgs}} when is_list(Msgs)->
  
negative.code:                       cowboy_tcp_transport,
                        [{port, logplex_app:config(http_log_input_port)}],
                        cowboy_http_protocol,
                        [{dispatch,
                          [{'_', [{[<<"logs">>, token], ?MODULE, []}]}]}]).
  
  init(_Transport, _Req, _Opts) ->
      {upgrade, protocol, cowboy_http_rest}.
  