diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2022-09-05 15:42:02 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2022-09-05 15:42:02 +0000 |
commit | b8d6cb5845f4fd1c28b09d608684a7f988dc3e1a (patch) | |
tree | 33cb90b93c84457f42e92164afaf31f00438a471 /lib/pleroma | |
parent | 346c130ddca08a6927e9290a164212bf88463ca5 (diff) | |
parent | 9874b4c985ea715a37cf2d2a5c8db2fb26e28f3a (diff) | |
download | pleroma-b8d6cb5845f4fd1c28b09d608684a7f988dc3e1a.tar.gz |
Merge branch 'from/upstream-develop/tusooa/2892-backup-scope' into 'develop'
Make backups require its own scope
Closes #2892
See merge request pleroma/pleroma!3721
Diffstat (limited to 'lib/pleroma')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/pleroma_backup_operation.ex | 4 | ||||
-rw-r--r-- | lib/pleroma/web/pleroma_api/controllers/backup_controller.ex | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/api_spec/operations/pleroma_backup_operation.ex b/lib/pleroma/web/api_spec/operations/pleroma_backup_operation.ex index 82ec1e7bb..45fa2b058 100644 --- a/lib/pleroma/web/api_spec/operations/pleroma_backup_operation.ex +++ b/lib/pleroma/web/api_spec/operations/pleroma_backup_operation.ex @@ -16,7 +16,7 @@ defmodule Pleroma.Web.ApiSpec.PleromaBackupOperation do %Operation{ tags: ["Backups"], summary: "List backups", - security: [%{"oAuth" => ["read:account"]}], + security: [%{"oAuth" => ["read:backups"]}], operationId: "PleromaAPI.BackupController.index", responses: %{ 200 => @@ -37,7 +37,7 @@ defmodule Pleroma.Web.ApiSpec.PleromaBackupOperation do %Operation{ tags: ["Backups"], summary: "Create a backup", - security: [%{"oAuth" => ["read:account"]}], + security: [%{"oAuth" => ["read:backups"]}], operationId: "PleromaAPI.BackupController.create", responses: %{ 200 => diff --git a/lib/pleroma/web/pleroma_api/controllers/backup_controller.ex b/lib/pleroma/web/pleroma_api/controllers/backup_controller.ex index 1a0548295..b9daed22b 100644 --- a/lib/pleroma/web/pleroma_api/controllers/backup_controller.ex +++ b/lib/pleroma/web/pleroma_api/controllers/backup_controller.ex @@ -9,7 +9,7 @@ defmodule Pleroma.Web.PleromaAPI.BackupController do alias Pleroma.Web.Plugs.OAuthScopesPlug action_fallback(Pleroma.Web.MastodonAPI.FallbackController) - plug(OAuthScopesPlug, %{scopes: ["read:accounts"]} when action in [:index, :create]) + plug(OAuthScopesPlug, %{scopes: ["read:backups"]} when action in [:index, :create]) plug(Pleroma.Web.ApiSpec.CastAndValidate) defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaBackupOperation |