anchor.diff:              {RequestorType, KeyData}
       end.
   
  -%% @doc Returns the base URI for the server as called by the client as a string.
  -base_uri(Req) ->
  -    Scheme = scheme(Req),
  -    Host = string:join(lists:reverse(wrq:host_tokens(Req)), "."),
  -    PortString = port_string(wrq:port(Req)),
  -    Scheme ++ "://" ++ Host ++ PortString.
  -
  -full_uri(Req) ->
  -    base_uri(Req) ++ wrq:disp_path(Req).
  -
  -scheme(Req) ->
  -    case wrq:get_req_header("x-forwarded-proto", Req) of
  -        undefined ->
  -            case wrq:scheme(Req) of
  -                https -> "https";
  -                http -> "http";
  -                P -> erlang:atom_to_list(P)
  -            end;
  -        Proto -> Proto
  -    end.
  -
  -%% So this is kind of gross and will prevent correct port info if you run https on port 80
  -%% or http on port 443; otherwise it should work. The problem is two-fold, first webmachine
  -%% ignores scheme information when parsing the host header and so always sets the port to 80
  -%% if no port is present in the host header. But in a load-balanced situation, the scheme
  -%% from webmachine may not reflect what is in use at the load balancer. A simple compromise
  -%% is to treat both 80 and 443 as default and only include a port string if the port differs
  -%% from those.
  -port_string(Default) when Default =:= 80; Default =:= 443 ->
  -    "";
  -port_string(Port) ->
  -    [$:|erlang:integer_to_list(Port)].
  -
   %% Tells whether this user is the superuser.
   is_superuser(UserName) ->
       case application:get_env(oc_chef_wm, superusers) of
  
positive.code:             Body = body_or_default(Req, <<>>),
              HTTPMethod = iolist_to_binary(atom_to_list(wrq:method(Req))),
              Path = iolist_to_binary(wrq:path(Req)),
              {GetHeader, State1} = get_header_fun(Req, State),
              case chef_authn:authenticate_user_request(GetHeader, HTTPMethod,
                                                        Path, Body, KeyData,
                                                        AuthSkew) of
  
negative.code: %%
  
  malformed_request_message(bad_clock, Req, State) ->
      {GetHeader, _State1} = chef_wm_util:get_header_fun(Req, State),
      User = case GetHeader(<<"X-Ops-UserId">>) of
                 undefined -> <<"">>;
                 UID -> UID
  