Remove rabl dependency (#5894)
* Remove rabl dependency * Replicate old Oj configuration
This commit is contained in:
parent
0393a64a90
commit
42bcbd36b7
9 changed files with 45 additions and 49 deletions
|
@ -184,6 +184,21 @@ class Account < ApplicationRecord
|
|||
@keypair ||= OpenSSL::PKey::RSA.new(private_key || public_key)
|
||||
end
|
||||
|
||||
def magic_key
|
||||
modulus, exponent = [keypair.public_key.n, keypair.public_key.e].map do |component|
|
||||
result = []
|
||||
|
||||
until component.zero?
|
||||
result << [component % 256].pack('C')
|
||||
component >>= 8
|
||||
end
|
||||
|
||||
result.reverse.join
|
||||
end
|
||||
|
||||
(['RSA'] + [modulus, exponent].map { |n| Base64.urlsafe_encode64(n) }).join('.')
|
||||
end
|
||||
|
||||
def subscription(webhook_url)
|
||||
@subscription ||= OStatus2::Subscription.new(remote_url, secret: secret, webhook: webhook_url, hub: hub_url)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue