1
0
Fork 0
forked from gitea/nas

Fix: LD Signaturesで署名された投稿の検索許可(検索範囲)が改竄できる問題

This commit is contained in:
KMY 2024-09-10 06:51:26 +09:00
parent 39e73b4df8
commit 91a2dc81c4
7 changed files with 36 additions and 9 deletions

View file

@ -632,7 +632,7 @@ RSpec.describe ActivityPub::Activity::Create do
end
context 'with direct' do
let(:searchable_by) { '' }
let(:searchable_by) { 'https://example.com/actor' }
it 'create status' do
status = sender.statuses.first
@ -642,6 +642,17 @@ RSpec.describe ActivityPub::Activity::Create do
end
end
context 'with empty array' do
let(:searchable_by) { '' }
it 'create status' do
status = sender.statuses.first
expect(status).to_not be_nil
expect(status.searchability).to be_nil
end
end
context 'with direct when not specify' do
let(:searchable_by) { nil }

View file

@ -210,7 +210,7 @@ RSpec.describe ActivityPub::TagManager do
it 'returns empty array for direct status' do
status = Fabricate(:status, searchability: :direct)
expect(subject.searchable_by(status)).to eq []
expect(subject.searchable_by(status)).to eq ["https://cb6e6126.ngrok.io/users/#{status.account.username}"]
end
it 'returns as:Limited array for limited status' do