FEATURE: API Scope for latest.rss feed (#21906)

Adds an API scope for the `/latest.rss` route.

https://meta.discourse.org/t/188480
This commit is contained in:
Blake Erickson 2023-06-02 08:28:14 -06:00 committed by GitHub
parent 6409794e0f
commit 56ee46bf63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@ class ApiKeyScope < ActiveRecord::Base
class << self
def list_actions
actions = %w[list#category_feed list#category_default]
actions = %w[list#category_feed list#category_default list#latest_feed]
%i[latest unread new top].each { |f| actions.concat(["list#category_#{f}", "list##{f}"]) }

View File

@ -434,6 +434,8 @@ RSpec.describe Admin::ApiController do
"invites",
"wordpress",
)
expect(scopes["topics"].any? { |h| h["urls"].include?("/latest.rss (GET)") }).to be_truthy
end
end