Close certificate auth before revoking worker tokens and rotating its secret
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from messenger.models import CreateChat, CreateMessage, CreateUser
|
||||
|
||||
|
||||
@pytest.mark.parametrize("scalar", ["\ud800", "\udfff"])
|
||||
def test_unpaired_surrogates_rejected(scalar):
|
||||
for factory in (
|
||||
lambda: CreateUser(username="valid_user", display_name=scalar, password="valid-pass-123"),
|
||||
lambda: CreateUser(
|
||||
username="valid_user", display_name="Valid", password="valid-pass-" + scalar
|
||||
),
|
||||
lambda: CreateChat(title=scalar, member_ids=["00000000-0000-4000-8000-000000000001"]),
|
||||
lambda: CreateMessage(text=scalar),
|
||||
):
|
||||
with pytest.raises(ValidationError):
|
||||
factory()
|
||||
|
||||
|
||||
def test_valid_unicode_and_nul():
|
||||
assert CreateMessage(text="😀\x00").text == "😀\x00"
|
||||
Reference in New Issue
Block a user