Coverage for polar/notification_recipient/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_NotificationRecipientRead = Authenticator( 

10 required_scopes={ 

11 Scope.web_read, 

12 Scope.web_write, 

13 Scope.notification_recipients_read, 

14 Scope.notification_recipients_write, 

15 }, 

16 allowed_subjects={User}, 

17) 

18NotificationRecipientRead = Annotated[ 

19 AuthSubject[User], Depends(_NotificationRecipientRead) 

20] 

21 

22_NotificationRecipientWrite = Authenticator( 

23 required_scopes={ 

24 Scope.web_write, 

25 Scope.notification_recipients_write, 

26 }, 

27 allowed_subjects={User}, 

28) 

29NotificationRecipientWrite = Annotated[ 

30 AuthSubject[User], Depends(_NotificationRecipientWrite) 

31]