Return suspended status when querying user account (#17952)
Some checks failed
Build docker images / build (push) Has been cancelled
Deploy the documentation / Calculate variables for GitHub Pages deployment (push) Has been cancelled
Build release artifacts / Calculate list of debian distros (push) Has been cancelled
Build release artifacts / Build wheels on ubuntu-22.04 for aarch64 (push) Has been cancelled
Build release artifacts / Build wheels on macos-13 for x86_64 (push) Has been cancelled
Build release artifacts / Build wheels on ubuntu-22.04 for x86_64 (push) Has been cancelled
Build release artifacts / Build sdist (push) Has been cancelled
Tests / changes (push) Has been cancelled
Tests / check-lockfile (push) Has been cancelled
Tests / lint-crlf (push) Has been cancelled
Tests / lint-newsfile (push) Has been cancelled
Tests / trial (push) Has been cancelled
Tests / trial-olddeps (push) Has been cancelled
Tests / trial-pypy (all, pypy-3.9) (push) Has been cancelled
Tests / sytest (push) Has been cancelled
Tests / export-data (push) Has been cancelled
Tests / portdb (11, 3.9) (push) Has been cancelled
Tests / portdb (17, 3.13) (push) Has been cancelled
Tests / complement (monolith, Postgres) (push) Has been cancelled
Tests / complement (monolith, SQLite) (push) Has been cancelled
Tests / complement (workers, Postgres) (push) Has been cancelled
Tests / cargo-test (push) Has been cancelled
Tests / cargo-bench (push) Has been cancelled
Tests / tests-done (push) Has been cancelled
Deploy the documentation / GitHub Pages (push) Has been cancelled
Build release artifacts / Build .deb packages (push) Has been cancelled
Build release artifacts / Attach assets to release (push) Has been cancelled
Tests / check-sampleconfig (push) Has been cancelled
Tests / check-schema-delta (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / Typechecking (push) Has been cancelled
Tests / lint-pydantic (push) Has been cancelled
Tests / lint-clippy (push) Has been cancelled
Tests / lint-clippy-nightly (push) Has been cancelled
Tests / lint-rustfmt (push) Has been cancelled
Tests / lint-readme (push) Has been cancelled
Tests / linting-done (push) Has been cancelled
Tests / calculate-test-jobs (push) Has been cancelled

This commit is contained in:
Shay 2024-11-22 04:37:19 -08:00 committed by GitHub
parent 4c67d20af7
commit 4587decd67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 1 deletions

1
changelog.d/17952.misc Normal file
View file

@ -0,0 +1 @@
Return whether the user is suspended when querying the user account in the Admin API.

View file

@ -55,7 +55,8 @@ It returns a JSON body like the following:
} }
], ],
"user_type": null, "user_type": null,
"locked": false "locked": false,
"suspended": false
} }
``` ```

View file

@ -124,6 +124,7 @@ class AdminHandler:
"consent_ts": user_info.consent_ts, "consent_ts": user_info.consent_ts,
"user_type": user_info.user_type, "user_type": user_info.user_type,
"is_guest": user_info.is_guest, "is_guest": user_info.is_guest,
"suspended": user_info.suspended,
} }
if self._msc3866_enabled: if self._msc3866_enabled:

View file

@ -3222,6 +3222,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
self.assertIn("consent_ts", content) self.assertIn("consent_ts", content)
self.assertIn("external_ids", content) self.assertIn("external_ids", content)
self.assertIn("last_seen_ts", content) self.assertIn("last_seen_ts", content)
self.assertIn("suspended", content)
# This key was removed intentionally. Ensure it is not accidentally re-included. # This key was removed intentionally. Ensure it is not accidentally re-included.
self.assertNotIn("password_hash", content) self.assertNotIn("password_hash", content)