diff options
author | reivilibre <oliverw@matrix.org> | 2021-11-18 14:40:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 14:40:26 +0000 |
commit | 539e44139911dc95c34784f3df2b3706c00b7db9 (patch) | |
tree | 8775cedba741d7d21c562aaa248dd3ac334451a8 | |
parent | Do not allow MSC3440 threads to fork threads (#11161) (diff) | |
download | synapse-539e44139911dc95c34784f3df2b3706c00b7db9.tar.xz |
Use auto_attribs for RefreshTokenLookupResult (#11386)
-rw-r--r-- | changelog.d/11386.misc | 1 | ||||
-rw-r--r-- | synapse/storage/databases/main/registration.py | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/changelog.d/11386.misc b/changelog.d/11386.misc new file mode 100644 index 0000000000..3178d53f05 --- /dev/null +++ b/changelog.d/11386.misc @@ -0,0 +1 @@ +Use `auto_attribs` on the `attrs` class `RefreshTokenLookupResult`. diff --git a/synapse/storage/databases/main/registration.py b/synapse/storage/databases/main/registration.py index 5e55440570..7ee699f981 100644 --- a/synapse/storage/databases/main/registration.py +++ b/synapse/storage/databases/main/registration.py @@ -84,26 +84,26 @@ class TokenLookupResult: return self.user_id -@attr.s(frozen=True, slots=True) +@attr.s(auto_attribs=True, frozen=True, slots=True) class RefreshTokenLookupResult: """Result of looking up a refresh token.""" - user_id = attr.ib(type=str) + user_id: str """The user this token belongs to.""" - device_id = attr.ib(type=str) + device_id: str """The device associated with this refresh token.""" - token_id = attr.ib(type=int) + token_id: int """The ID of this refresh token.""" - next_token_id = attr.ib(type=Optional[int]) + next_token_id: Optional[int] """The ID of the refresh token which replaced this one.""" - has_next_refresh_token_been_refreshed = attr.ib(type=bool) + has_next_refresh_token_been_refreshed: bool """True if the next refresh token was used for another refresh.""" - has_next_access_token_been_used = attr.ib(type=bool) + has_next_access_token_been_used: bool """True if the next access token was already used at least once.""" |