Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Consolidate the access_token information in the admin api (#11861)
Browse files Browse the repository at this point in the history
Co-authored-by: reivilibre <olivier@librepush.net>
  • Loading branch information
dklimpel and reivilibre authored Jan 31, 2022
1 parent 02755c3 commit 0da2301
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 95 deletions.
1 change: 1 addition & 0 deletions changelog.d/11861.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Consolidate the `access_token` information at the top of each relevant page in the Admin API documentation.
3 changes: 3 additions & 0 deletions docs/admin_api/account_validity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This API allows a server administrator to manage the validity of an account. To
use it, you must enable the account validity feature (under
`account_validity`) in Synapse's configuration.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

## Renew account

This API extends the validity of an account by as much time as configured in the
Expand Down
6 changes: 3 additions & 3 deletions docs/admin_api/delete_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This API lets a server admin delete a local group. Doing so will kick all
users out of the group so that their clients will correctly handle the group
being deleted.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

The API is:

```
POST /_synapse/admin/v1/delete_group/<group_id>
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: see [Admin API](../usage/administration/admin_api).
7 changes: 3 additions & 4 deletions docs/admin_api/event_reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

This API returns information about reported events.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

The api is:
```
GET /_synapse/admin/v1/event_reports?from=0&limit=10
```
To use it, you will need to authenticate by providing an `access_token` for a
server admin: see [Admin API](../usage/administration/admin_api).

It returns a JSON body like the following:

Expand Down Expand Up @@ -94,8 +95,6 @@ The api is:
```
GET /_synapse/admin/v1/event_reports/<report_id>
```
To use it, you will need to authenticate by providing an `access_token` for a
server admin: see [Admin API](../usage/administration/admin_api).

It returns a JSON body like the following:

Expand Down
8 changes: 3 additions & 5 deletions docs/admin_api/media_admin_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

These APIs allow extracting media information from the homeserver.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

## List all media in a room

This API gets a list of known media in a room.
Expand All @@ -11,8 +14,6 @@ The API is:
```
GET /_synapse/admin/v1/room/<room_id>/media
```
To use it, you will need to authenticate by providing an `access_token` for a
server admin: see [Admin API](../usage/administration/admin_api).

The API returns a JSON body like the following:
```json
Expand Down Expand Up @@ -300,8 +301,5 @@ The following fields are returned in the JSON response body:

* `deleted`: integer - The number of media items successfully deleted

To use it, you will need to authenticate by providing an `access_token` for a
server admin: see [Admin API](../usage/administration/admin_api).

If the user re-requests purged remote media, synapse will re-request the media
from the originating server.
9 changes: 3 additions & 6 deletions docs/admin_api/purge_history_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ paginate further back in the room from the point being purged from.
Note that Synapse requires at least one message in each room, so it will never
delete the last message in a room.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

The API is:

```
POST /_synapse/admin/v1/purge_history/<room_id>[/<event_id>]
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

By default, events sent by local users are not deleted, as they may represent
the only copies of this content in existence. (Events sent by remote users are
deleted.)
Expand Down Expand Up @@ -57,9 +57,6 @@ It is possible to poll for updates on recent purges with a second API;
GET /_synapse/admin/v1/purge_history_status/<purge_id>
```

Again, you will need to authenticate by providing an `access_token` for a
server admin.

This API returns a JSON body like the following:

```json
Expand Down
6 changes: 3 additions & 3 deletions docs/admin_api/room_membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ to a room with a given `room_id_or_alias`. You can only modify the membership of
local users. The server administrator must be in the room and have permission to
invite users.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

## Parameters

The following parameters are available:
Expand All @@ -23,9 +26,6 @@ POST /_synapse/admin/v1/join/<room_id_or_alias>
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: see [Admin API](../usage/administration/admin_api).

Response:

```json
Expand Down
6 changes: 3 additions & 3 deletions docs/admin_api/rooms.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ The List Room admin API allows server admins to get a list of rooms on their
server. There are various parameters available that allow for filtering and
sorting the returned list. This API supports pagination.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

**Parameters**

The following query parameters are available:
Expand Down Expand Up @@ -478,9 +481,6 @@ several minutes or longer.
The local server will only have the power to move local user and room aliases to
the new room. Users on other servers will be unaffected.

To use it, you will need to authenticate by providing an ``access_token`` for a
server admin: see [Admin API](../usage/administration/admin_api).

## Version 1 (old version)

This version works synchronously. That means you only get the response once the server has
Expand Down
6 changes: 3 additions & 3 deletions docs/admin_api/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
Returns information about all local media usage of users. Gives the
possibility to filter them by time and user.

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

The API is:

```
GET /_synapse/admin/v1/statistics/users/media
```

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

A response body like the following is returned:

```json
Expand Down
73 changes: 5 additions & 68 deletions docs/admin_api/user_admin_api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# User Admin API

To use it, you will need to authenticate by providing an `access_token`
for a server admin: see [Admin API](../usage/administration/admin_api).

## Query User Account

This API returns information about a specific user account.
Expand All @@ -10,9 +13,6 @@ The api is:
GET /_synapse/admin/v2/users/<user_id>
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

It returns a JSON body like the following:

```jsonc
Expand Down Expand Up @@ -104,9 +104,6 @@ with a body of:
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

Returns HTTP status code:
- `201` - When a new user object was created.
- `200` - When a user was modified.
Expand Down Expand Up @@ -156,9 +153,6 @@ By default, the response is ordered by ascending user ID.
GET /_synapse/admin/v2/users?from=0&limit=10&guests=false
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -278,9 +272,6 @@ GET /_matrix/client/r0/admin/whois/<userId>
See also: [Client Server
API Whois](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid).

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

It returns a JSON body like the following:

```json
Expand Down Expand Up @@ -335,9 +326,6 @@ with a body of:
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

The erase parameter is optional and defaults to `false`.
An empty body may be passed for backwards compatibility.

Expand Down Expand Up @@ -394,9 +382,6 @@ with a body of:
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

The parameter `new_password` is required.
The parameter `logout_devices` is optional and defaults to `true`.

Expand All @@ -409,9 +394,6 @@ The api is:
GET /_synapse/admin/v1/users/<user_id>/admin
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -439,10 +421,6 @@ with a body of:
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)


## List room memberships of a user

Gets a list of all `room_id` that a specific `user_id` is member.
Expand All @@ -453,9 +431,6 @@ The API is:
GET /_synapse/admin/v1/users/<user_id>/joined_rooms
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -574,9 +549,6 @@ The API is:
GET /_synapse/admin/v1/users/<user_id>/media
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -691,9 +663,6 @@ The API is:
DELETE /_synapse/admin/v1/users/<user_id>/media
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -766,9 +735,6 @@ The API is:
GET /_synapse/admin/v2/users/<user_id>/devices
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -834,9 +800,6 @@ POST /_synapse/admin/v2/users/<user_id>/delete_devices
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

An empty JSON dict is returned.

**Parameters**
Expand All @@ -858,9 +821,6 @@ The API is:
GET /_synapse/admin/v2/users/<user_id>/devices/<device_id>
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -906,9 +866,6 @@ PUT /_synapse/admin/v2/users/<user_id>/devices/<device_id>
}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

An empty JSON dict is returned.

**Parameters**
Expand All @@ -935,9 +892,6 @@ DELETE /_synapse/admin/v2/users/<user_id>/devices/<device_id>
{}
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

An empty JSON dict is returned.

**Parameters**
Expand All @@ -956,9 +910,6 @@ The API is:
GET /_synapse/admin/v1/users/<user_id>/pushers
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -1053,9 +1004,6 @@ To un-shadow-ban a user the API is:
DELETE /_synapse/admin/v1/users/<user_id>/shadow_ban
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

An empty JSON dict is returned in both cases.

**Parameters**
Expand All @@ -1078,9 +1026,6 @@ The API is:
GET /_synapse/admin/v1/users/<user_id>/override_ratelimit
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -1120,9 +1065,6 @@ The API is:
POST /_synapse/admin/v1/users/<user_id>/override_ratelimit
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

A response body like the following is returned:

```json
Expand Down Expand Up @@ -1165,9 +1107,6 @@ The API is:
DELETE /_synapse/admin/v1/users/<user_id>/override_ratelimit
```

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)

An empty JSON dict is returned.

```json
Expand Down Expand Up @@ -1196,7 +1135,5 @@ The API is:
GET /_synapse/admin/v1/username_available?username=$localpart
```

The request and response format is the same as the [/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API.

To use it, you will need to authenticate by providing an `access_token` for a
server admin: [Admin API](../usage/administration/admin_api)
The request and response format is the same as the
[/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API.

0 comments on commit 0da2301

Please sign in to comment.