Coverage for polar/refund/auth.py: 100%
7 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 17:15 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 17:15 +0000
1from typing import Annotated 1a
3from fastapi import Depends 1a
5from polar.auth.dependencies import Authenticator 1a
6from polar.auth.models import AuthSubject, Organization, User 1a
7from polar.auth.scope import Scope 1a
9RefundsRead = Annotated[ 1a
10 AuthSubject[User | Organization],
11 Depends(
12 Authenticator(
13 required_scopes={
14 Scope.web_read,
15 Scope.web_write,
16 Scope.refunds_read,
17 Scope.refunds_write,
18 },
19 allowed_subjects={User, Organization},
20 )
21 ),
22]
24RefundsWrite = Annotated[ 1a
25 AuthSubject[User | Organization],
26 Depends(
27 Authenticator(
28 required_scopes={
29 Scope.web_write,
30 Scope.refunds_write,
31 },
32 allowed_subjects={User, Organization},
33 )
34 ),
35]