-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconfig.py
More file actions
43 lines (39 loc) · 1.68 KB
/
Copy pathconfig.py
File metadata and controls
43 lines (39 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Configuration classes and utilities for auth0-api-python.
"""
from typing import Callable, Optional
class ApiClientOptions:
"""
Configuration for the ApiClient.
Args:
domain: The Auth0 domain, e.g., "my-tenant.us.auth0.com".
audience: The expected 'aud' claim in the token.
custom_fetch: Optional callable that can replace the default HTTP fetch logic.
dpop_enabled: Whether DPoP is enabled (default: True for backward compatibility).
dpop_required: Whether DPoP is required (default: False, allows both Bearer and DPoP).
dpop_iat_leeway: Leeway in seconds for DPoP proof iat claim (default: 30).
dpop_iat_offset: Maximum age in seconds for DPoP proof iat claim (default: 300).
client_id: Optional required if you want to use get_access_token_for_connection.
client_secret: Optional required if you want to use get_access_token_for_connection.
"""
def __init__(
self,
domain: str,
audience: str,
custom_fetch: Optional[Callable[..., object]] = None,
dpop_enabled: bool = True,
dpop_required: bool = False,
dpop_iat_leeway: int = 30,
dpop_iat_offset: int = 300,
client_id: Optional[str] = None,
client_secret: Optional[str] = None,
):
self.domain = domain
self.audience = audience
self.custom_fetch = custom_fetch
self.dpop_enabled = dpop_enabled
self.dpop_required = dpop_required
self.dpop_iat_leeway = dpop_iat_leeway
self.dpop_iat_offset = dpop_iat_offset
self.client_id = client_id
self.client_secret = client_secret