Coverage for polar/refund/auth.py: 100%
7 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 12:42 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 12:42 +0000
1from typing import Annotated
3from fastapi import Depends
5from polar.auth.dependencies import Authenticator
6from polar.auth.models import AuthSubject, Organization, User
7from polar.auth.scope import Scope
9RefundsRead = Annotated[
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[
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]