mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Merge commit '31abef8917879917a330419fe3981a2fb7f35b69' into glitch-soc/merge-upstream
Conflicts: - `app/services/post_status_service.rb`: Upstream added a line adjacent to one that had been modified due to local-only posting. Added upstream's change. - `tsconfig.json`: Upstream updated Typescript and updated `tsconfig` in the process by changing paths, where glitch-soc had extra paths. Updated as upstream did.
This commit is contained in:
@@ -32,6 +32,7 @@ RSpec.describe ActivityPub::Activity::FeatureRequest do
|
||||
.with(satisfying do |body|
|
||||
response_json = JSON.parse(body)
|
||||
response_json['type'] == 'Accept' &&
|
||||
response_json['object'] == 'https://example.com/feature_requests/1' &&
|
||||
response_json['to'] == sender.uri
|
||||
end, recipient.id, sender.inbox_url)
|
||||
end
|
||||
@@ -46,6 +47,7 @@ RSpec.describe ActivityPub::Activity::FeatureRequest do
|
||||
.with(satisfying do |body|
|
||||
response_json = JSON.parse(body)
|
||||
response_json['type'] == 'Reject' &&
|
||||
response_json['object'] == 'https://example.com/feature_requests/1' &&
|
||||
response_json['to'] == sender.uri
|
||||
end, recipient.id, sender.inbox_url)
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
|
||||
subject { described_class.new(json) }
|
||||
|
||||
let(:keyid) { 'http://example.com/alice#rsa-key' }
|
||||
let!(:sender) { Fabricate(:account, uri: 'http://example.com/alice', domain: 'example.com') }
|
||||
|
||||
let(:raw_json) do
|
||||
@@ -25,7 +26,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
context 'when signature matches' do
|
||||
let(:raw_signature) do
|
||||
{
|
||||
'creator' => 'http://example.com/alice',
|
||||
'creator' => keyid,
|
||||
'created' => '2017-09-23T20:21:34Z',
|
||||
}
|
||||
end
|
||||
@@ -40,7 +41,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
context 'when local account record is missing a public key' do
|
||||
let(:raw_signature) do
|
||||
{
|
||||
'creator' => 'http://example.com/alice',
|
||||
'creator' => keyid,
|
||||
'created' => '2017-09-23T20:21:34Z',
|
||||
}
|
||||
end
|
||||
@@ -59,15 +60,14 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
|
||||
allow(ActivityPub::FetchRemoteKeyService).to receive(:new).and_return(service_stub)
|
||||
|
||||
allow(service_stub).to receive(:call).with('http://example.com/alice') do
|
||||
sender.update!(public_key: old_key)
|
||||
sender
|
||||
allow(service_stub).to receive(:call).with(keyid) do
|
||||
Keypair.new(account: sender, type: :rsa, public_key: old_key, uri: keyid)
|
||||
end
|
||||
end
|
||||
|
||||
it 'fetches key and returns creator' do
|
||||
expect(subject.verify_actor!).to eq sender
|
||||
expect(service_stub).to have_received(:call).with('http://example.com/alice').once
|
||||
expect(service_stub).to have_received(:call).with(keyid).once
|
||||
end
|
||||
end
|
||||
|
||||
@@ -82,7 +82,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
context 'when signature is tampered' do
|
||||
let(:raw_signature) do
|
||||
{
|
||||
'creator' => 'http://example.com/alice',
|
||||
'creator' => keyid,
|
||||
'created' => '2017-09-23T20:21:34Z',
|
||||
}
|
||||
end
|
||||
@@ -100,7 +100,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
|
||||
let(:raw_signature) do
|
||||
{
|
||||
'creator' => 'http://example.com/alice',
|
||||
'creator' => keyid,
|
||||
'created' => '2017-09-23T20:21:34Z',
|
||||
}
|
||||
end
|
||||
@@ -116,7 +116,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
|
||||
let(:raw_signature) do
|
||||
{
|
||||
'creator' => 'http://example.com/alice',
|
||||
'creator' => keyid,
|
||||
'created' => '2017-09-23T20:21:34Z',
|
||||
}
|
||||
end
|
||||
@@ -132,7 +132,7 @@ RSpec.describe ActivityPub::LinkedDataSignature do
|
||||
|
||||
let(:raw_signature) do
|
||||
{
|
||||
'creator' => 'http://example.com/alice',
|
||||
'creator' => keyid,
|
||||
'created' => '2017-09-23T20:21:34Z',
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user