mirror of
https://github.com/element-hq/synapse.git
synced 2025-07-04 00:00:27 -04:00
Compare commits
11 Commits
531b1a1081
...
96d9ddc062
Author | SHA1 | Date | |
---|---|---|---|
|
96d9ddc062 | ||
|
82757144e9 | ||
|
2f9c9d5eba | ||
|
6ddbb03612 | ||
|
cc8da2c5ed | ||
|
c733dd618a | ||
|
9c951a5e3f | ||
|
7a7b2dea30 | ||
|
45df0517e5 | ||
|
a75871abc7 | ||
|
94c5e9a414 |
140
.github/workflows/docker.yml
vendored
140
.github/workflows/docker.yml
vendored
@ -5,7 +5,7 @@ name: Build docker images
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
branches: [ master, main, develop ]
|
branches: [master, main, develop]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@ -14,24 +14,22 @@ permissions:
|
|||||||
id-token: write # needed for signing the images with GitHub OIDC Token
|
id-token: write # needed for signing the images with GitHub OIDC Token
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
name: Build and push image for ${{ matrix.platform }}
|
||||||
|
runs-on: ${{ matrix.runs_on }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- platform: linux/amd64
|
||||||
|
runs_on: ubuntu-24.04
|
||||||
|
suffix: linux-amd64
|
||||||
|
- platform: linux/arm64
|
||||||
|
runs_on: ubuntu-24.04-arm
|
||||||
|
suffix: linux-arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Set up QEMU
|
|
||||||
id: qemu
|
|
||||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
|
||||||
with:
|
|
||||||
platforms: arm64
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||||
|
|
||||||
- name: Inspect builder
|
|
||||||
run: docker buildx inspect
|
|
||||||
|
|
||||||
- name: Install Cosign
|
|
||||||
uses: sigstore/cosign-installer@fb28c2b6339dcd94da6e4cbcbc5e888961f6f8c3 # v3.9.0
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
||||||
@ -55,13 +53,79 @@ jobs:
|
|||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Calculate docker image tag
|
- name: Build and push by digest
|
||||||
id: set-tag
|
id: build
|
||||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
||||||
with:
|
with:
|
||||||
images: |
|
push: true
|
||||||
|
labels: |
|
||||||
|
gitsha1=${{ github.sha }}
|
||||||
|
org.opencontainers.image.version=${{ env.SYNAPSE_VERSION }}
|
||||||
|
tags: |
|
||||||
docker.io/matrixdotorg/synapse
|
docker.io/matrixdotorg/synapse
|
||||||
ghcr.io/element-hq/synapse
|
ghcr.io/element-hq/synapse
|
||||||
|
file: "docker/Dockerfile"
|
||||||
|
platforms: ${{ matrix.platform }}
|
||||||
|
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
|
||||||
|
|
||||||
|
- name: Export digest
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ runner.temp }}/digests
|
||||||
|
digest="${{ steps.build.outputs.digest }}"
|
||||||
|
touch "${{ runner.temp }}/digests/${digest#sha256:}"
|
||||||
|
|
||||||
|
- name: Upload digest
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: digests-${{ matrix.suffix }}
|
||||||
|
path: ${{ runner.temp }}/digests/*
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
merge:
|
||||||
|
name: Push merged images to ${{ matrix.repository }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repository:
|
||||||
|
- docker.io/matrixdotorg/synapse
|
||||||
|
- ghcr.io/element-hq/synapse
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
steps:
|
||||||
|
- name: Download digests
|
||||||
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||||
|
with:
|
||||||
|
path: ${{ runner.temp }}/digests
|
||||||
|
pattern: digests-*
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Log in to DockerHub
|
||||||
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||||
|
if: ${{ startsWith(matrix.repository, 'docker.io') }}
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Log in to GHCR
|
||||||
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||||
|
if: ${{ startsWith(matrix.repository, 'ghcr.io') }}
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||||
|
|
||||||
|
- name: Install Cosign
|
||||||
|
uses: sigstore/cosign-installer@fb28c2b6339dcd94da6e4cbcbc5e888961f6f8c3 # v3.9.0
|
||||||
|
|
||||||
|
- name: Calculate docker image tag
|
||||||
|
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
||||||
|
with:
|
||||||
|
images: ${{ matrix.repository }}
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=false
|
latest=false
|
||||||
tags: |
|
tags: |
|
||||||
@ -69,31 +133,23 @@ jobs:
|
|||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=pep440,pattern={{raw}}
|
type=pep440,pattern={{raw}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
- name: Build and push all platforms
|
- name: Create manifest list and push
|
||||||
id: build-and-push
|
working-directory: ${{ runner.temp }}/digests
|
||||||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
labels: |
|
|
||||||
gitsha1=${{ github.sha }}
|
|
||||||
org.opencontainers.image.version=${{ env.SYNAPSE_VERSION }}
|
|
||||||
tags: "${{ steps.set-tag.outputs.tags }}"
|
|
||||||
file: "docker/Dockerfile"
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
# arm64 builds OOM without the git fetch setting. c.f.
|
|
||||||
# https://github.com/rust-lang/cargo/issues/10583
|
|
||||||
build-args: |
|
|
||||||
CARGO_NET_GIT_FETCH_WITH_CLI=true
|
|
||||||
|
|
||||||
- name: Sign the images with GitHub OIDC Token
|
|
||||||
env:
|
env:
|
||||||
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
REPOSITORY: ${{ matrix.repository }}
|
||||||
TAGS: ${{ steps.set-tag.outputs.tags }}
|
|
||||||
run: |
|
run: |
|
||||||
images=""
|
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||||
for tag in ${TAGS}; do
|
$(printf "$REPOSITORY@sha256:%s " *)
|
||||||
images+="${tag}@${DIGEST} "
|
|
||||||
|
- name: Sign each manifest
|
||||||
|
env:
|
||||||
|
REPOSITORY: ${{ matrix.repository }}
|
||||||
|
run: |
|
||||||
|
DIGESTS=""
|
||||||
|
for TAG in $(echo "$DOCKER_METADATA_OUTPUT_JSON" | jq -r '.tags[]'); do
|
||||||
|
DIGEST="$(docker buildx imagetools inspect $TAG --format '{{json .Manifest}}' | jq -r '.digest')"
|
||||||
|
DIGESTS="$DIGESTS $REPOSITORY@$DIGEST"
|
||||||
done
|
done
|
||||||
cosign sign --yes ${images}
|
cosign sign --yes $DIGESTS
|
||||||
|
2
.github/workflows/fix_lint.yaml
vendored
2
.github/workflows/fix_lint.yaml
vendored
@ -44,6 +44,6 @@ jobs:
|
|||||||
- run: cargo fmt
|
- run: cargo fmt
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0
|
- uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
|
||||||
with:
|
with:
|
||||||
commit_message: "Attempt to fix linting"
|
commit_message: "Attempt to fix linting"
|
||||||
|
7
.github/workflows/release-artifacts.yml
vendored
7
.github/workflows/release-artifacts.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: "3.x"
|
||||||
- id: set-distros
|
- id: set-distros
|
||||||
run: |
|
run: |
|
||||||
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
|
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
|
||||||
@ -76,7 +76,7 @@ jobs:
|
|||||||
- name: Set up python
|
- name: Set up python
|
||||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: "3.x"
|
||||||
|
|
||||||
- name: Build the packages
|
- name: Build the packages
|
||||||
# see https://github.com/docker/build-push-action/issues/252
|
# see https://github.com/docker/build-push-action/issues/252
|
||||||
@ -179,7 +179,7 @@ jobs:
|
|||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
|
|
||||||
- run: pip install build
|
- run: pip install build
|
||||||
|
|
||||||
@ -191,7 +191,6 @@ jobs:
|
|||||||
name: Sdist
|
name: Sdist
|
||||||
path: dist/*.tar.gz
|
path: dist/*.tar.gz
|
||||||
|
|
||||||
|
|
||||||
# if it's a tag, create a release and attach the artifacts to it
|
# if it's a tag, create a release and attach the artifacts to it
|
||||||
attach-assets:
|
attach-assets:
|
||||||
name: "Attach assets to release"
|
name: "Attach assets to release"
|
||||||
|
1
changelog.d/18575.misc
Normal file
1
changelog.d/18575.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Raise poetry-core version cap to 2.1.3.
|
1
changelog.d/18594.bugfix
Normal file
1
changelog.d/18594.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Respond with 401 & `M_USER_LOCKED` when a locked user calls `POST /login`, as per the spec.
|
1
changelog.d/18620.misc
Normal file
1
changelog.d/18620.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Speed up the building of Docker images in CI.
|
1
changelog.d/18625.misc
Normal file
1
changelog.d/18625.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Log the room ID we're purging state for.
|
@ -374,7 +374,7 @@ tomli = ">=1.2.3"
|
|||||||
# runtime errors caused by build system changes.
|
# runtime errors caused by build system changes.
|
||||||
# We are happy to raise these upper bounds upon request,
|
# We are happy to raise these upper bounds upon request,
|
||||||
# provided we check that it's safe to do so (i.e. that CI passes).
|
# provided we check that it's safe to do so (i.e. that CI passes).
|
||||||
requires = ["poetry-core>=1.1.0,<=1.9.1", "setuptools_rust>=1.3,<=1.10.2"]
|
requires = ["poetry-core>=1.1.0,<=2.1.3", "setuptools_rust>=1.3,<=1.10.2"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ from synapse.api.errors import (
|
|||||||
InvalidClientTokenError,
|
InvalidClientTokenError,
|
||||||
MissingClientTokenError,
|
MissingClientTokenError,
|
||||||
UnrecognizedRequestError,
|
UnrecognizedRequestError,
|
||||||
|
UserLockedError,
|
||||||
)
|
)
|
||||||
from synapse.http.site import SynapseRequest
|
from synapse.http.site import SynapseRequest
|
||||||
from synapse.logging.opentracing import active_span, force_tracing, start_active_span
|
from synapse.logging.opentracing import active_span, force_tracing, start_active_span
|
||||||
@ -162,12 +163,7 @@ class InternalAuth(BaseAuth):
|
|||||||
if not allow_locked and await self.store.get_user_locked_status(
|
if not allow_locked and await self.store.get_user_locked_status(
|
||||||
requester.user.to_string()
|
requester.user.to_string()
|
||||||
):
|
):
|
||||||
raise AuthError(
|
raise UserLockedError()
|
||||||
401,
|
|
||||||
"User account has been locked",
|
|
||||||
errcode=Codes.USER_LOCKED,
|
|
||||||
additional_fields={"soft_logout": True},
|
|
||||||
)
|
|
||||||
|
|
||||||
# Deny the request if the user account has expired.
|
# Deny the request if the user account has expired.
|
||||||
# This check is only done for regular users, not appservice ones.
|
# This check is only done for regular users, not appservice ones.
|
||||||
|
@ -306,6 +306,20 @@ class UserDeactivatedError(SynapseError):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class UserLockedError(SynapseError):
|
||||||
|
"""The error returned to the client when the user attempted to access an
|
||||||
|
authenticated endpoint, but the account has been locked.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self) -> None:
|
||||||
|
super().__init__(
|
||||||
|
code=HTTPStatus.UNAUTHORIZED,
|
||||||
|
msg="User account has been locked",
|
||||||
|
errcode=Codes.USER_LOCKED,
|
||||||
|
additional_fields={"soft_logout": True},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FederationDeniedError(SynapseError):
|
class FederationDeniedError(SynapseError):
|
||||||
"""An error raised when the server tries to federate with a server which
|
"""An error raised when the server tries to federate with a server which
|
||||||
is not on its federation whitelist.
|
is not on its federation whitelist.
|
||||||
|
@ -42,6 +42,7 @@ from synapse.api.errors import (
|
|||||||
NotApprovedError,
|
NotApprovedError,
|
||||||
SynapseError,
|
SynapseError,
|
||||||
UserDeactivatedError,
|
UserDeactivatedError,
|
||||||
|
UserLockedError,
|
||||||
)
|
)
|
||||||
from synapse.api.ratelimiting import Ratelimiter
|
from synapse.api.ratelimiting import Ratelimiter
|
||||||
from synapse.api.urls import CLIENT_API_PREFIX
|
from synapse.api.urls import CLIENT_API_PREFIX
|
||||||
@ -313,7 +314,7 @@ class LoginRestServlet(RestServlet):
|
|||||||
should_issue_refresh_token=should_issue_refresh_token,
|
should_issue_refresh_token=should_issue_refresh_token,
|
||||||
# The user represented by an appservice's configured sender_localpart
|
# The user represented by an appservice's configured sender_localpart
|
||||||
# is not actually created in Synapse.
|
# is not actually created in Synapse.
|
||||||
should_check_deactivated=qualified_user_id != appservice.sender,
|
should_check_deactivated_or_locked=qualified_user_id != appservice.sender,
|
||||||
request_info=request_info,
|
request_info=request_info,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -367,7 +368,7 @@ class LoginRestServlet(RestServlet):
|
|||||||
auth_provider_id: Optional[str] = None,
|
auth_provider_id: Optional[str] = None,
|
||||||
should_issue_refresh_token: bool = False,
|
should_issue_refresh_token: bool = False,
|
||||||
auth_provider_session_id: Optional[str] = None,
|
auth_provider_session_id: Optional[str] = None,
|
||||||
should_check_deactivated: bool = True,
|
should_check_deactivated_or_locked: bool = True,
|
||||||
*,
|
*,
|
||||||
request_info: RequestInfo,
|
request_info: RequestInfo,
|
||||||
) -> LoginResponse:
|
) -> LoginResponse:
|
||||||
@ -389,8 +390,8 @@ class LoginRestServlet(RestServlet):
|
|||||||
should_issue_refresh_token: True if this login should issue
|
should_issue_refresh_token: True if this login should issue
|
||||||
a refresh token alongside the access token.
|
a refresh token alongside the access token.
|
||||||
auth_provider_session_id: The session ID got during login from the SSO IdP.
|
auth_provider_session_id: The session ID got during login from the SSO IdP.
|
||||||
should_check_deactivated: True if the user should be checked for
|
should_check_deactivated_or_locked: True if the user should be checked for
|
||||||
deactivation status before logging in.
|
deactivation or locked status before logging in.
|
||||||
|
|
||||||
This exists purely for appservice's configured sender_localpart
|
This exists purely for appservice's configured sender_localpart
|
||||||
which doesn't have an associated user in the database.
|
which doesn't have an associated user in the database.
|
||||||
@ -415,11 +416,14 @@ class LoginRestServlet(RestServlet):
|
|||||||
)
|
)
|
||||||
user_id = canonical_uid
|
user_id = canonical_uid
|
||||||
|
|
||||||
# If the account has been deactivated, do not proceed with the login.
|
# If the account has been deactivated or locked, do not proceed with the login.
|
||||||
if should_check_deactivated:
|
if should_check_deactivated_or_locked:
|
||||||
deactivated = await self._main_store.get_user_deactivated_status(user_id)
|
deactivated = await self._main_store.get_user_deactivated_status(user_id)
|
||||||
if deactivated:
|
if deactivated:
|
||||||
raise UserDeactivatedError("This account has been deactivated")
|
raise UserDeactivatedError("This account has been deactivated")
|
||||||
|
locked = await self._main_store.get_user_locked_status(user_id)
|
||||||
|
if locked:
|
||||||
|
raise UserLockedError()
|
||||||
|
|
||||||
device_id = login_submission.get("device_id")
|
device_id = login_submission.get("device_id")
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ from synapse.metrics.background_process_metrics import wrap_as_background_proces
|
|||||||
from synapse.storage.database import LoggingTransaction
|
from synapse.storage.database import LoggingTransaction
|
||||||
from synapse.storage.databases import Databases
|
from synapse.storage.databases import Databases
|
||||||
from synapse.types.storage import _BackgroundUpdates
|
from synapse.types.storage import _BackgroundUpdates
|
||||||
|
from synapse.util.stringutils import shortstr
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from synapse.server import HomeServer
|
from synapse.server import HomeServer
|
||||||
@ -167,6 +168,12 @@ class PurgeEventsStorageController:
|
|||||||
break
|
break
|
||||||
|
|
||||||
(room_id, groups_to_sequences) = next_to_delete
|
(room_id, groups_to_sequences) = next_to_delete
|
||||||
|
|
||||||
|
logger.info(
|
||||||
|
"[purge] deleting state groups for room %s: %s",
|
||||||
|
room_id,
|
||||||
|
shortstr(groups_to_sequences.keys(), maxitems=10),
|
||||||
|
)
|
||||||
made_progress = await self._delete_state_groups(
|
made_progress = await self._delete_state_groups(
|
||||||
room_id, groups_to_sequences
|
room_id, groups_to_sequences
|
||||||
)
|
)
|
||||||
|
@ -2846,6 +2846,16 @@ class UserRestTestCase(unittest.HomeserverTestCase):
|
|||||||
self.assertEqual(Codes.USER_LOCKED, channel.json_body["errcode"])
|
self.assertEqual(Codes.USER_LOCKED, channel.json_body["errcode"])
|
||||||
self.assertTrue(channel.json_body["soft_logout"])
|
self.assertTrue(channel.json_body["soft_logout"])
|
||||||
|
|
||||||
|
# User is not authorized to log in anymore
|
||||||
|
channel = self.make_request(
|
||||||
|
"POST",
|
||||||
|
"/_matrix/client/r0/login",
|
||||||
|
{"type": "m.login.password", "user": "user", "password": "pass"},
|
||||||
|
)
|
||||||
|
self.assertEqual(401, channel.code, msg=channel.json_body)
|
||||||
|
self.assertEqual(Codes.USER_LOCKED, channel.json_body["errcode"])
|
||||||
|
self.assertTrue(channel.json_body["soft_logout"])
|
||||||
|
|
||||||
@override_config({"user_directory": {"enabled": True, "search_all_users": True}})
|
@override_config({"user_directory": {"enabled": True, "search_all_users": True}})
|
||||||
def test_locked_user_not_in_user_dir(self) -> None:
|
def test_locked_user_not_in_user_dir(self) -> None:
|
||||||
# User is available in the user dir
|
# User is available in the user dir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user