-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathconstants.py
More file actions
94 lines (61 loc) · 2.78 KB
/
constants.py
File metadata and controls
94 lines (61 loc) · 2.78 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
"""
Python SDK for OpenFGA
API version: 1.x
Website: https://openfga.dev
Documentation: https://openfga.dev/docs
Support: https://openfga.dev/community
License: [Apache-2.0](https://github.com/openfga/python-sdk/blob/main/LICENSE)
NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT.
"""
from typing import Final
# Version of the OpenFGA Python SDK.
SDK_VERSION: Final[str] = "0.10.2" # x-release-please-version
# User agent used in HTTP requests.
USER_AGENT: Final[str] = "openfga-sdk python/0.10.2" # x-release-please-version
# Example API domain for documentation/tests.
SAMPLE_BASE_DOMAIN: Final[str] = "fga.example"
# API URL used for tests.
TEST_API_URL: Final[str] = f"https://api.{SAMPLE_BASE_DOMAIN}"
# API Token Issuer URL used for tests.
TEST_ISSUER_URL: Final[str] = f"https://issuer.{SAMPLE_BASE_DOMAIN}"
# Default API URL.
DEFAULT_API_URL: Final[str] = "http://localhost:8080"
# Retry configuration
# Maximum allowed number of retries for HTTP requests.
RETRY_MAX_ALLOWED_NUMBER: Final[int] = 15
# Default maximum number of retries for HTTP requests.
DEFAULT_MAX_RETRY: Final[int] = 3
# Default minimum wait time between retries in milliseconds.
DEFAULT_MIN_WAIT_IN_MS: Final[int] = 100
# Maximum backoff time in seconds.
MAX_BACKOFF_TIME_IN_SEC: Final[int] = 120
# Maximum allowable duration for retry headers in seconds.
RETRY_HEADER_MAX_ALLOWABLE_DURATION_IN_SEC: Final[int] = 1800
# Standard HTTP header for retry-after.
RETRY_AFTER_HEADER_NAME: Final[str] = "Retry-After"
# Rate limit reset header name.
RATE_LIMIT_RESET_HEADER_NAME: Final[str] = "X-RateLimit-Reset"
# Alternative rate limit reset header name.
RATE_LIMIT_RESET_ALT_HEADER_NAME: Final[str] = "X-Rate-Limit-Reset"
# Client methods
# Maximum number of parallel requests for a single method.
CLIENT_MAX_METHOD_PARALLEL_REQUESTS: Final[int] = 10
# Maximum batch size for batch requests.
CLIENT_MAX_BATCH_SIZE: Final[int] = 50
# Header used to identify the client method.
CLIENT_METHOD_HEADER: Final[str] = "X-OpenFGA-Client-Method"
# Header used to identify bulk requests.
CLIENT_BULK_REQUEST_ID_HEADER: Final[str] = "X-OpenFGA-Client-Bulk-Request-Id"
# Connection options
# Default timeout for HTTP requests in milliseconds.
DEFAULT_REQUEST_TIMEOUT_IN_MS: Final[int] = 10000
# Default connection timeout in milliseconds.
DEFAULT_CONNECTION_TIMEOUT_IN_MS: Final[int] = 10000
# Token management
# Buffer time in seconds before token expiry to consider it expired.
TOKEN_EXPIRY_THRESHOLD_BUFFER_IN_SEC: Final[int] = 300
# Jitter time in seconds to add randomness to token expiry checks.
TOKEN_EXPIRY_JITTER_IN_SEC: Final[int] = 300
# FGA Response Headers
# Response header name for query duration in milliseconds.
QUERY_DURATION_HEADER_NAME: Final[str] = "fga-query-duration-ms"