Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

api-docs: Document /dev_list_users endpoint.

moustafad4c5fdff3546
diff --git a/api_docs/include/rest-endpoints.md b/api_docs/include/rest-endpoints.md
index 92dce89a326..4e0c48beebd 100644
--- a/api_docs/include/rest-endpoints.md
+++ b/api_docs/include/rest-endpoints.md
@@ -165,6 +165,7 @@
* [Fetch an API key (production)](/api/fetch-api-key)
* [Fetch an API key (development only)](/api/dev-fetch-api-key)
* [Fetch an API key (JWT)](/api/jwt-fetch-api-key)
+* [List users (development only)](/api/dev-list-users)
* [Register a logged-in device](/api/register-client-device)
* [Remove a registered device](/api/remove-client-device)
* [Send an E2EE test notification to mobile device(s)](/api/e2ee-test-notify)
diff --git a/zerver/openapi/markdown_extension.py b/zerver/openapi/markdown_extension.py
index c592fac203b..1946413bc9c 100644
--- a/zerver/openapi/markdown_extension.py
+++ b/zerver/openapi/markdown_extension.py
@@ -279,6 +279,7 @@ def generate_curl_example(
"/dev_fetch_api_key:post",
"/fetch_api_key:post",
"/jwt/fetch_api_key:post",
+ "/dev_list_users:get",
]
lines = []
if operation in insecure_operations:
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 3e4d18d3333..7fd2d5a8c0d 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -251,6 +251,89 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ApiKeyResponse"
+ /dev_list_users:
+ get:
+ operationId: dev-list-users
+ summary: List users (development only)
+ tags:
+ - authentication
+ description: |
+ Get a list of all, non-bot users in a [Zulip development
+ server](https://zulip.readthedocs.io/en/latest/development/overview.html).
+ This endpoint is used by mobile developers to fetch users for the
+ development login flow.
+
+ !!! warn ""
+
+ **Note:** This endpoint is only available on Zulip development
+ servers; for obvious security reasons it will always return an error
+ in a Zulip production server.
+ security: []
+ responses:
+ "200":
+ description: Success.
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/JsonSuccessBase"
+ - type: object
+ additionalProperties: false
+ properties:
+ result: {}
+ msg: {}
+ ignored_parameters_unsupported: {}
+ direct_admins:
+ type: array
+ description: |
+ A list of administrators in the development server.
+ items:
+ type: object
+ additionalProperties: false
+ properties:
+ email:
+ type: string
+ description: |
+ The email of the dev admin user.
+ realm_url:
+ type: string
+ description: |
+ The URL of the dev admin user's organization.
+ direct_users:
+ type: array
+ description: |
+ A list of non-admin users in the development server.
+ items:
+ type: object
+ additionalProperties: false
+ properties:
+ email:
+ type: string
+ description: |
+ The email of the dev user.
+ realm_url:
+ type: string
+ description: |
+ The URL of the dev user's organization.
+ example:
+ {
+ "msg": "",
+ "result": "success",
+ "direct_admins":
+ [
+ {
+ "email": "[email protected]",
+ "realm_url": http://localhost:9991,
+ },
+ ],
+ "direct_users":
+ [
+ {
+ "email": "[email protected]",
+ "realm_url": http://localhost:9991,
+ },
+ ],
+ }
/events:
get:
operationId: get-events
diff --git a/zerver/tests/test_openapi.py b/zerver/tests/test_openapi.py
index ab66c059dc1..c50578283ce 100644
--- a/zerver/tests/test_openapi.py
+++ b/zerver/tests/test_openapi.py
@@ -222,9 +222,6 @@ class OpenAPIArgumentsTest(ZulipTestCase):
"/default_stream_groups/create",
"/default_stream_groups/{group_id}",
"/default_stream_groups/{group_id}/streams",
- #### Mobile-app only endpoints; important for mobile developers.
- # Mobile interface for development environment login
- "/dev_list_users",
#### These personal settings endpoints have modest value to document:
"/users/me/avatar",
# Much more valuable would be an org admin bulk-upload feature.