make federation errors much louder so we can better debug issues temporarialy

This commit is contained in:
Maxwell Salzberg 2011-10-25 11:41:52 -07:00
parent 0512ade65a
commit 2cbb61be75
2 changed files with 8 additions and 8 deletions

View file

@ -72,12 +72,12 @@ class Postzord::Receiver::Private < Postzord::Receiver
end
def validate_object
return false if contact_required_unless_request
return false if relayable_without_parent?
raise "Contact required unless request" if contact_required_unless_request
raise "Relayable object, but no parent object found" if relayable_without_parent?
assign_sender_handle_if_request
return false if author_does_not_match_xml_author?
raise "Author does not match XML author" if author_does_not_match_xml_author?
@object
end

View file

@ -23,7 +23,7 @@ describe "attack vectors" do
zord = Postzord::Receiver::Private.new(bob, :salmon_xml => salmon_xml)
expect {
zord.perform!
}.should raise_error /not a valid object/
}.should raise_error /Contact required unless request/
bob.visible_shareables(Post).include?(post_from_non_contact).should be_false
Post.count.should == post_count
@ -40,7 +40,7 @@ describe "attack vectors" do
zord = Postzord::Receiver::Private.new(bob, :salmon_xml => salmon_xml)
expect {
zord.perform!
}.should raise_error /not a valid object/
}.should raise_error /Contact required unless request/
alice.reload.visible_shareables(Post).should_not include(StatusMessage.find(original_message.id))
end
@ -98,7 +98,7 @@ describe "attack vectors" do
zord = Postzord::Receiver::Private.new(bob, :salmon_xml => salmon_xml)
expect {
zord.perform!
}.should raise_error /not a valid object/
}.should raise_error /Author does not match XML author/
eve.reload.profile.first_name.should == first_name
end
@ -165,7 +165,7 @@ describe "attack vectors" do
zord = Postzord::Receiver::Private.new(bob, :salmon_xml => salmon_xml)
expect {
zord.perform!
}.should raise_error /not a valid object/
}.should raise_error /Author does not match XML author/
bob.reload.visible_shareables(Post).count.should == 1
end
@ -197,7 +197,7 @@ describe "attack vectors" do
zord = Postzord::Receiver::Private.new(bob, :salmon_xml => salmon_xml)
expect {
zord.perform!
}.should raise_error /not a valid object/
}.should raise_error /Author does not match XML author/
bob.reload.contacts.count.should == 2
end