projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request 'purge chat and shout endpoints' (#97) from purge-chat into develop
[akkoma]
/
lib
/
pleroma
/
web
/
admin_api
/
controllers
/
media_proxy_cache_controller.ex
diff --git
a/lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex
b/lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex
index 6d92e9f7ffdc376e82cd8b1450de3a361d84a1c2..a6d7aaf54a49e28568ed9c69e7fbd1bb196dee45 100644
(file)
--- a/
lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex
+++ b/
lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
@@
-9,16
+9,18
@@
defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
alias Pleroma.Web.MediaProxy
alias Pleroma.Web.Plugs.OAuthScopesPlug
alias Pleroma.Web.MediaProxy
alias Pleroma.Web.Plugs.OAuthScopesPlug
+ @cachex Pleroma.Config.get([:cachex, :provider], Cachex)
+
plug(Pleroma.Web.ApiSpec.CastAndValidate)
plug(
OAuthScopesPlug,
plug(Pleroma.Web.ApiSpec.CastAndValidate)
plug(
OAuthScopesPlug,
- %{scopes: ["
read:media_proxy_caches"], admin: true
} when action in [:index]
+ %{scopes: ["
admin:read:media_proxy_caches"]
} when action in [:index]
)
plug(
OAuthScopesPlug,
)
plug(
OAuthScopesPlug,
- %{scopes: ["
write:media_proxy_caches"], admin: true
} when action in [:purge, :delete]
+ %{scopes: ["
admin:write:media_proxy_caches"]
} when action in [:purge, :delete]
)
action_fallback(Pleroma.Web.AdminAPI.FallbackController)
)
action_fallback(Pleroma.Web.AdminAPI.FallbackController)
@@
-38,7
+40,7
@@
defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
defp fetch_entries(params) do
MediaProxy.cache_table()
defp fetch_entries(params) do
MediaProxy.cache_table()
- |>
C
achex.stream!(Cachex.Query.create(true, :key))
+ |>
@c
achex.stream!(Cachex.Query.create(true, :key))
|> filter_entries(params[:query])
end
|> filter_entries(params[:query])
end