Add ActivityPub secure mode (#11269)
* Add HTTP signature requirement for served ActivityPub resources * Change `SECURE_MODE` to `AUTHORIZED_FETCH` * Add 'Signature' to 'Vary' header and improve code style * Improve code style by adding `public_fetch_mode?` method
This commit is contained in:
parent
4e1260feaa
commit
5bf67ca913
14 changed files with 89 additions and 34 deletions
|
@ -4,7 +4,7 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe ActivityPub::InboxesController, type: :controller do
|
||||
describe 'POST #create' do
|
||||
context 'if signed_request_account' do
|
||||
context 'with signed_request_account' do
|
||||
it 'returns 202' do
|
||||
allow(controller).to receive(:signed_request_account) do
|
||||
Fabricate(:account)
|
||||
|
@ -15,7 +15,7 @@ RSpec.describe ActivityPub::InboxesController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
context 'not signed_request_account' do
|
||||
context 'without signed_request_account' do
|
||||
it 'returns 401' do
|
||||
allow(controller).to receive(:signed_request_account) do
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue