Use auto_attribs/native type hints for attrs classes. (#11692)

This commit is contained in:
Patrick Cloke 2022-01-13 08:49:28 -05:00 committed by GitHub
parent b92a2ff797
commit 10a88ba91c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 300 additions and 307 deletions

View file

@ -23,19 +23,19 @@ from synapse.types import JsonDict
from synapse.util import json_encoder, stringutils
@attr.s(slots=True)
@attr.s(slots=True, auto_attribs=True)
class UIAuthSessionData:
session_id = attr.ib(type=str)
session_id: str
# The dictionary from the client root level, not the 'auth' key.
clientdict = attr.ib(type=JsonDict)
clientdict: JsonDict
# The URI and method the session was intiatied with. These are checked at
# each stage of the authentication to ensure that the asked for operation
# has not changed.
uri = attr.ib(type=str)
method = attr.ib(type=str)
uri: str
method: str
# A string description of the operation that the current authentication is
# authorising.
description = attr.ib(type=str)
description: str
class UIAuthWorkerStore(SQLBaseStore):