0
0
Fork 0

Add HTTP signatures to all outgoing ActivityPub GET requests (#11284)

This commit is contained in:
Eugen Rochko 2019-07-11 14:49:55 +02:00 committed by GitHub
parent a6dc6a242f
commit 4e8dcc5dbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 42 deletions

View file

@ -40,8 +40,8 @@ class Request
set_digest! if options.key?(:body)
end
def on_behalf_of(account, key_id_format = :acct, sign_with: nil)
raise ArgumentError, 'account must be local' unless account&.local?
def on_behalf_of(account, key_id_format = :uri, sign_with: nil)
raise ArgumentError, 'account must not be nil' if account.nil?
@account = account
@keypair = sign_with.present? ? OpenSSL::PKey::RSA.new(sign_with) : @account.keypair