Coverage for polar/customer/auth.py: 100%
10 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, User
7from polar.auth.scope import Scope
8from polar.models.organization import Organization
10_CustomerRead = Authenticator(
11 required_scopes={
12 Scope.web_read,
13 Scope.web_write,
14 Scope.customers_read,
15 Scope.customers_write,
16 },
17 allowed_subjects={User, Organization},
18)
19CustomerRead = Annotated[AuthSubject[User | Organization], Depends(_CustomerRead)]
21_CustomerWrite = Authenticator(
22 required_scopes={
23 Scope.web_write,
24 Scope.customers_write,
25 },
26 allowed_subjects={User, Organization},
27)
28CustomerWrite = Annotated[AuthSubject[User | Organization], Depends(_CustomerWrite)]