2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-04 01:15:08 +08:00
discourse/spec/lib/onebox
Rafael dos Santos Silva 508b75ebf4
FEATURE: Add Reddit OAuth support for onebox (#38040)
Reddit blocks many server IPs from accessing their `.json` endpoint.
This adds optional OAuth support using `client_credentials` flow so
authenticated requests go through `oauth.reddit.com`, bypassing IP
blocks.

- Adds `reddit_onebox_client_id` and `reddit_onebox_client_secret` site
settings
- Bearer token is cached for 50 minutes (Reddit tokens last 60 min)
- Falls back to unauthenticated `www.reddit.com` when credentials are
not configured

---------

Co-authored-by: Régis Hanol <regis@hanol.fr>
2026-02-25 10:44:32 -03:00
..
engine FEATURE: Add Reddit OAuth support for onebox (#38040) 2026-02-25 10:44:32 -03:00
domain_checker_spec.rb
engine_spec.rb
helpers_spec.rb FIX: Plus encoding (+) was not handled correctly in onebox and UI (#36822) 2025-12-23 14:32:22 +11:00
json_ld_spec.rb
layout_spec.rb
matcher_spec.rb
movie_spec.rb
oembed_spec.rb
open_graph_spec.rb FIX: Don't escape HTML entities twice in oneboxes (#37141) 2026-01-16 11:40:18 +01:00
preview_spec.rb SECURITY: Fixes for main (#28137) 2024-07-30 14:19:01 +08:00
status_check_spec.rb