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

9 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 12:42 +0000

1from typing import Annotated 

2 

3from fastapi import Depends 

4 

5from polar.auth.dependencies import Authenticator 

6from polar.auth.models import AuthSubject, User 

7from polar.auth.scope import Scope 

8 

9_NotificationsRead = Authenticator( 

10 required_scopes={ 

11 Scope.web_read, 

12 Scope.web_write, 

13 Scope.notifications_read, 

14 }, 

15 allowed_subjects={User}, 

16) 

17NotificationsRead = Annotated[AuthSubject[User], Depends(_NotificationsRead)] 

18 

19_NotificationsWrite = Authenticator( 

20 required_scopes={ 

21 Scope.web_write, 

22 Scope.notifications_write, 

23 }, 

24 allowed_subjects={User}, 

25) 

26NotificationsWrite = Annotated[AuthSubject[User], Depends(_NotificationsWrite)]