mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 09:35:45 +03:00
Use auto_attribs for RefreshTokenLookupResult (#11386)
This commit is contained in:
parent
4bd54b263e
commit
539e441399
2 changed files with 8 additions and 7 deletions
1
changelog.d/11386.misc
Normal file
1
changelog.d/11386.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Use `auto_attribs` on the `attrs` class `RefreshTokenLookupResult`.
|
|
@ -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."""
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue