From 886d1c37ff3a1c7c7c59b57a8da2acff0c1753d3 Mon Sep 17 00:00:00 2001 From: robs Date: Mon, 30 Dec 2024 19:46:25 +0100 Subject: [PATCH] move opml route behind basic auth until proper solution is implemented --- lib/pinchflat_web/router.ex | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pinchflat_web/router.ex b/lib/pinchflat_web/router.ex index f7b7875..db8fe6d 100644 --- a/lib/pinchflat_web/router.ex +++ b/lib/pinchflat_web/router.ex @@ -23,12 +23,20 @@ defmodule PinchflatWeb.Router do plug :maybe_basic_auth end + pipeline :protected_feeds do + plug :basic_auth + end + + scope "/", PinchflatWeb do + pipe_through :protected_feeds + # has to match before /sources/:id + get "/sources/opml", Podcasts.PodcastController, :opml_feed + end + # Routes in here _may not be_ protected by basic auth. This is necessary for # media streaming to work for RSS podcast feeds. scope "/", PinchflatWeb do pipe_through :feeds - # has to match before /sources/:id - get "/sources/opml", Podcasts.PodcastController, :opml_feed get "/sources/:uuid/feed", Podcasts.PodcastController, :rss_feed get "/sources/:uuid/feed_image", Podcasts.PodcastController, :feed_image