anchor.diff:           init_resource_state/1,
            malformed_request_message/3,
            request_type/0,
  +         resource_exists/2,
            validate_request/3
           ]).
   
  
positive.code:                         ping/2]}]).
  
  -mixin([{?BASE_RESOURCE, [forbidden/2,
                            is_authorized/2,
                            service_available/2]}]).
  
  %% chef_wm behaviour callbacks
  
negative.code:       {<<"type">>, <<"client">>}]}.
  
  to_json(Req, #base_state{resource_state =
                               #principal_state{principal =
                                                    #chef_client{} = Client}} = State) ->
      EJson = assemble_pubkey_ejson(Client),
      Json = ejson:encode(EJson),
      {Json, Req, State};
  to_json(Req, #base_state{resource_state =
                               #principal_state{principal =
                                                    #chef_user{} = User}} = State) ->
      EJson = assemble_pubkey_ejson(User),
      Json = ejson:encode(EJson),
      {Json, Req, State}.
  