developer
developer ¶
Developer authentication classes for Domo (OAuth2 client credentials).
DomoDeveloperAuth
dataclass
¶
DomoDeveloperAuth(
domo_client_id: str,
domo_client_secret: str,
domo_instance: str,
token_name: str | None = None,
token: str | None = None,
user_id: str | None = None,
is_valid_token: bool = False,
cache_responses: bool = False,
cache_size: int = 1000,
cache_default_ttl: int = 300,
cache_strategy: str | None = None,
custom_cache_rules: dict[str, list[str]] | None = None,
)
Bases: DomoAuth
Developer authentication using client credentials.
This authentication method uses OAuth2 client credentials (client ID and secret) to obtain bearer tokens. This is typically used for applications built on Domo's developer platform and requires developer app registration.
Attributes:
| Name | Type | Description |
|---|---|---|
domo_client_id |
str
|
OAuth2 client ID from developer app registration |
domo_client_secret |
str
|
OAuth2 client secret (not shown in repr) |
domo_instance |
str
|
The Domo instance identifier |
token_name |
str | None
|
Name identifier for the token |
token |
str | None
|
The bearer token (not shown in repr) |
user_id |
str | None
|
The authenticated user's ID |
is_valid_token |
bool
|
Whether the current token is valid |
cache_responses |
bool
|
Enable HTTP response caching (default: False) |
cache_size |
int
|
Maximum number of cache entries (default: 1000) |
cache_default_ttl |
int
|
Default cache TTL in seconds (default: 300) |
cache_strategy |
str | None
|
Cache invalidation strategy (default: None, uses SMART) |
custom_cache_rules |
dict | None
|
Custom cache invalidation rules (default: None) |
Example
auth = DomoDeveloperAuth( ... domo_client_id="your-client-id", ... domo_client_secret="
", # pragma: allowlist secret ... domo_instance="mycompany" ... ) token = await auth.get_auth_token()
auth_header
property
¶
auth_header: dict
Generate the authentication header for developer token authentication.
get_auth_token
async
¶
get_auth_token(**context_kwargs) -> str
Retrieve the developer token using client credentials and update internal attributes.
Source code in src/crew_dcs/auth/developer.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
who_am_i
async
¶
who_am_i(**context_kwargs) -> ResponseGetData
Use cached user_id from get_auth_token response (no separate API call).
Source code in src/crew_dcs/auth/developer.py
123 124 125 126 127 128 129 130 131 132 133 134 | |