Coverage for src/kwai/modules/identity/tokens/access_token_query.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2024-01-01 00:00 +0000

1"""Module that defines an interface for an access token query.""" 

2 

3from abc import abstractmethod 

4 

5from kwai.core.domain.repository.query import Query 

6from kwai.modules.identity.tokens.token_identifier import TokenIdentifier 

7 

8 

9class AccessTokenQuery(Query): 

10 """An interface for querying an access token.""" 

11 

12 @abstractmethod 

13 def filter_by_id(self, id_: int) -> "AccessTokenQuery": 

14 """Filter for the given id.""" 

15 raise NotImplementedError 

16 

17 @abstractmethod 

18 def filter_by_token_identifier( 

19 self, identifier: TokenIdentifier 

20 ) -> "AccessTokenQuery": 

21 """Filter for the given token identifier.""" 

22 raise NotImplementedError