Coverage for polar/event_type/auth.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 17:15 +0000

1from typing import Annotated 1a

2 

3from fastapi import Depends 1a

4 

5from polar.auth.dependencies import Authenticator 1a

6from polar.auth.models import AuthSubject, User 1a

7from polar.auth.scope import Scope 1a

8from polar.models.organization import Organization 1a

9 

10_EventTypeRead = Authenticator( 1a

11 required_scopes={ 

12 Scope.web_read, 

13 Scope.web_write, 

14 Scope.events_read, 

15 Scope.events_write, 

16 }, 

17 allowed_subjects={User, Organization}, 

18) 

19EventTypeRead = Annotated[AuthSubject[User | Organization], Depends(_EventTypeRead)] 1a

20 

21_EventTypeWrite = Authenticator( 1a

22 required_scopes={ 

23 Scope.web_write, 

24 }, 

25 allowed_subjects={User, Organization}, 

26) 

27EventTypeWrite = Annotated[AuthSubject[User | Organization], Depends(_EventTypeWrite)] 1a