If HTTP signature is wrong and webfinger cache is stale, retry with resolve (#5129)
If the signature could not be verified and the webfinger of the account was last retrieved longer than the cache period, try re-resolving the account and then attempting to verify the signature again
This commit is contained in:
@ -137,6 +137,15 @@ class Account < ApplicationRecord
|
||||
subscription_expires_at.present?
|
||||
end
|
||||
|
||||
def possibly_stale?
|
||||
last_webfingered_at.nil? || last_webfingered_at <= 1.day.ago
|
||||
end
|
||||
|
||||
def refresh!
|
||||
return if local?
|
||||
ResolveRemoteAccountService.new.call(acct)
|
||||
end
|
||||
|
||||
def keypair
|
||||
@keypair ||= OpenSSL::PKey::RSA.new(private_key || public_key)
|
||||
end
|
||||
|
Reference in New Issue
Block a user