fixed couple of specs, removed the federation fallback, and fixed the public hashtag pages (not displaying the publisher)
This commit is contained in:
parent
352be4d0c0
commit
2cebfa54cc
3 changed files with 5 additions and 18 deletions
|
|
@ -58,7 +58,8 @@
|
|||
%h2
|
||||
= "##{params[:name]}"
|
||||
|
||||
= render 'shared/publisher', :selected_aspects => all_aspects.map{|a| a.id}, :aspect_ids => all_aspects.map{|a| a.id}, :for_all_aspects => true, :aspect => all_aspects.first
|
||||
- if current_user
|
||||
= render 'shared/publisher', :selected_aspects => all_aspects.map{|a| a.id}, :aspect_ids => all_aspects.map{|a| a.id}, :for_all_aspects => true, :aspect => all_aspects.first
|
||||
|
||||
%hr
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
module Diaspora
|
||||
module Encryptable
|
||||
|
||||
LAST_FALLBACK_TIME = "Sept 19 2011 17:00 UTC "
|
||||
# Check that signature is a correct signature of #signable_string by person
|
||||
#
|
||||
# @param [String] signature The signature to be verified.
|
||||
|
|
@ -20,9 +18,6 @@ module Diaspora
|
|||
end
|
||||
log_string = "event=verify_signature status=complete guid=#{self.guid}"
|
||||
validity = person.public_key.verify OpenSSL::Digest::SHA256.new, Base64.decode64(signature), signable_string
|
||||
if !validity && Time.now < Time.parse(LAST_FALLBACK_TIME)
|
||||
validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string
|
||||
end
|
||||
log_string += " validity=#{validity}"
|
||||
Rails.logger.info(log_string)
|
||||
validity
|
||||
|
|
|
|||
|
|
@ -21,18 +21,9 @@ describe Diaspora::Encryptable do
|
|||
@comment.verify_signature(sig, bob.person).should be_true
|
||||
end
|
||||
|
||||
context "fallback" do
|
||||
it "checks the SHA if it's within the week of the rollout window" do
|
||||
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
|
||||
@comment.verify_signature(sig, bob.person).should be_true
|
||||
end
|
||||
|
||||
it 'does not verify the fallback after rollout window' do
|
||||
Kernel::silence_warnings { Diaspora::Encryptable.const_set(:LAST_FALLBACK_TIME,((Time.now - 1.week).to_s))}
|
||||
|
||||
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
|
||||
@comment.verify_signature(sig, bob.person).should be_false
|
||||
end
|
||||
it 'does not verify the fallback after rollout window' do
|
||||
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
|
||||
@comment.verify_signature(sig, bob.person).should be_false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue