mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-17 07:37:42 +01:00
Switch webpush
dependency to latest version of Mastodon-maintained fork (#33572)
This commit is contained in:
parent
50449ae7ac
commit
68d818121d
2
Gemfile
2
Gemfile
@ -94,7 +94,7 @@ gem 'twitter-text', '~> 3.1.0'
|
|||||||
gem 'tzinfo-data', '~> 1.2023'
|
gem 'tzinfo-data', '~> 1.2023'
|
||||||
gem 'webauthn', '~> 3.0'
|
gem 'webauthn', '~> 3.0'
|
||||||
gem 'webpacker', '~> 5.4'
|
gem 'webpacker', '~> 5.4'
|
||||||
gem 'webpush', github: 'ClearlyClaire/webpush', ref: 'f14a4d52e201128b1b00245d11b6de80d6cfdcd9'
|
gem 'webpush', github: 'mastodon/webpush', ref: '52725def8baf67e0d645c9d1c6c0bdff69da0c60'
|
||||||
|
|
||||||
gem 'json-ld'
|
gem 'json-ld'
|
||||||
gem 'json-ld-preloaded', '~> 3.2'
|
gem 'json-ld-preloaded', '~> 3.2'
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
GIT
|
GIT
|
||||||
remote: https://github.com/ClearlyClaire/webpush.git
|
remote: https://github.com/mastodon/webpush.git
|
||||||
revision: f14a4d52e201128b1b00245d11b6de80d6cfdcd9
|
revision: 52725def8baf67e0d645c9d1c6c0bdff69da0c60
|
||||||
ref: f14a4d52e201128b1b00245d11b6de80d6cfdcd9
|
ref: 52725def8baf67e0d645c9d1c6c0bdff69da0c60
|
||||||
specs:
|
specs:
|
||||||
webpush (0.3.8)
|
webpush (1.1.0)
|
||||||
hkdf (~> 0.2)
|
hkdf (~> 0.2)
|
||||||
jwt (~> 2.0)
|
jwt (~> 2.0)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class WebPushRequest
|
|||||||
end
|
end
|
||||||
|
|
||||||
def encrypt(payload)
|
def encrypt(payload)
|
||||||
Webpush::Encryption.encrypt(payload, key_p256dh, key_auth)
|
Webpush::Legacy::Encryption.encrypt(payload, key_p256dh, key_auth)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
class WebPushKeyValidator < ActiveModel::Validator
|
class WebPushKeyValidator < ActiveModel::Validator
|
||||||
def validate(subscription)
|
def validate(subscription)
|
||||||
begin
|
begin
|
||||||
Webpush::Encryption.encrypt('validation_test', subscription.key_p256dh, subscription.key_auth)
|
Webpush::Legacy::Encryption.encrypt('validation_test', subscription.key_p256dh, subscription.key_auth)
|
||||||
rescue ArgumentError, OpenSSL::PKey::EC::Point::Error
|
rescue ArgumentError, OpenSSL::PKey::EC::Point::Error
|
||||||
subscription.errors.add(:base, I18n.t('crypto.errors.invalid_key'))
|
subscription.errors.add(:base, I18n.t('crypto.errors.invalid_key'))
|
||||||
end
|
end
|
||||||
|
@ -35,7 +35,7 @@ RSpec.describe Web::PushNotificationWorker do
|
|||||||
before do
|
before do
|
||||||
Setting.site_contact_email = contact_email
|
Setting.site_contact_email = contact_email
|
||||||
|
|
||||||
allow(Webpush::Encryption).to receive(:encrypt).and_return(payload)
|
allow(Webpush::Legacy::Encryption).to receive(:encrypt).and_return(payload)
|
||||||
allow(JWT).to receive(:encode).and_return('jwt.encoded.payload')
|
allow(JWT).to receive(:encode).and_return('jwt.encoded.payload')
|
||||||
|
|
||||||
stub_request(:post, endpoint).to_return(status: 201, body: '')
|
stub_request(:post, endpoint).to_return(status: 201, body: '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user