[#1427] Extra check that admin OAuth scope is used by admin. Adjusted tests.
[akkoma] / docs / API / admin_api.md
index ce70b512273347decc21c266d573ef01c8ed329c..b19793150226d8ad0d06013d4b9bac78655cde44 100644 (file)
@@ -2,6 +2,13 @@
 
 Authentication is required and the user must be an admin.
 
+Configuration options:
+* `[:auth, :enforce_oauth_admin_scope_usage]` — OAuth admin scope requirement toggle.
+    If `true`, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token (client app must support admin scopes).
+    If `false` and token doesn't have admin scope(s), `is_admin` user flag grants access to admin-specific actions.
+    Note that client app needs to explicitly support admin scopes and request them when obtaining auth token.
+
 ## `GET /api/pleroma/admin/users`
 
 ### List users
@@ -58,7 +65,6 @@ Authentication is required and the user must be an admin.
 
 ### Remove a user
 
-- Method `DELETE`
 - Params:
   - `nicknames`
 - Response: Array of user nicknames
@@ -236,14 +242,6 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
 }
 ```
 
-## DEPRECATED `PATCH /api/pleroma/admin/users/:nickname/activation_status`
-
-### Active or deactivate a user
-
-- Params:
-  - `nickname`
-  - `status` BOOLEAN field, false value means deactivation.
-
 ## `GET /api/pleroma/admin/users/:nickname_or_id`
 
 ### Retrive the details of a user
@@ -735,7 +733,6 @@ Copy settings on key `:pleroma` to DB.
 
 Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB.
 
-- Method `GET`
 - Params: none
 - Response:
 
@@ -880,3 +877,19 @@ Compile time settings (need instance reboot):
 - Authentication: required
 - Params: None
 - Response: JSON, "ok" and 200 status
+
+## `PATCH /api/pleroma/admin/users/confirm_email`
+
+### Confirm users' emails
+
+- Params:
+  - `nicknames`
+- Response: Array of user nicknames
+
+## `PATCH /api/pleroma/admin/users/resend_confirmation_email`
+
+### Resend confirmation email
+
+- Params:
+  - `nicknames`
+- Response: Array of user nicknames