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

10 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 16:17 +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_CheckoutLinkRead = Authenticator( 1a

11 required_scopes={ 

12 Scope.web_read, 

13 Scope.web_write, 

14 Scope.checkout_links_read, 

15 Scope.checkout_links_write, 

16 }, 

17 allowed_subjects={User, Organization}, 

18) 

19CheckoutLinkRead = Annotated[ 1a

20 AuthSubject[User | Organization], Depends(_CheckoutLinkRead) 

21] 

22 

23_CheckoutLinkWrite = Authenticator( 1a

24 required_scopes={ 

25 Scope.web_write, 

26 Scope.checkout_links_write, 

27 }, 

28 allowed_subjects={User, Organization}, 

29) 

30CheckoutLinkWrite = Annotated[ 1a

31 AuthSubject[User | Organization], Depends(_CheckoutLinkWrite) 

32]