anchor.diff:  -module(menelaus_cbauth).
   
   -export([handle_cbauth_post/1]).
  --behaviour(gen_event).
  +-behaviour(gen_server).
   
   -export([start_link/0]).
   
   
  --export([init/1, handle_event/2, handle_call/2,
  +-export([init/1, handle_call/3, handle_cast/2,
            handle_info/2, terminate/2, code_change/3]).
   
   -record(state, {cbauth_info = undefined, rpc_processes = []}).
  
positive.code:                                    Processes
                             end
                     end,
      {ok, ok, State#state{rpc_processes = NewProcesses,
                           cbauth_info = Info}}.
  
  handle_info({'DOWN', MRef, _, Pid, Reason},
              #state{rpc_processes = Processes} = State) ->
      {value, {MRef, Label}, NewProcesses} = lists:keytake(MRef, 1, Processes),
      ?log_debug("Observed json rpc process ~p died with reason ~p", [{Label, Pid}, Reason]),
      {ok, State#state{rpc_processes = NewProcesses}};
  
  handle_info(_Info, State) ->
      {ok, State}.
  
  maybe_notify_cbauth(#state{rpc_processes = Processes,
                             cbauth_info = CBAuthInfo} = State) ->
  
negative.code: is_interesting({read_only_user_creds, _}) -> true;
  is_interesting(_) -> false.
  
  handle_call(_Msg, _From, State) ->
      {reply, not_implemented, State}.
  
  handle_cast({Msg, Label, Pid}, #state{rpc_processes = Processes,
                                        cbauth_info = CBAuthInfo} = State) ->
      ?log_debug("Observed json rpc process ~p ~p", [{Label, Pid}, Msg]),
      Info = case CBAuthInfo of
  