base
base ¶
Base authentication classes for Domo authentication.
DomoAuth ¶
Bases: ABC
Abstract contract for Domo authentication implementations.
All concrete auth classes must inherit from this class and provide the required authentication surface used by routes and entities.
auth_header
abstractmethod
property
¶
auth_header: dict
Generate authentication headers for API requests.
url_manual_login
property
¶
url_manual_login: str
Generate the manual login URL for the Domo instance.
cache_stats ¶
cache_stats() -> dict
Get HTTP cache statistics.
Source code in src/crew_dcs/auth/base.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
clear_cache ¶
clear_cache() -> None
Clear all HTTP caches for this auth instance.
Source code in src/crew_dcs/auth/base.py
225 226 227 228 229 230 | |
close_session
async
¶
close_session() -> None
Close and drop the pooled session cached on this auth, if any.
A reused session is otherwise held open until the auth is GC'd. Call this (or use the auth as an async context manager) for clean teardown::
async with DomoTokenAuth(...) as auth:
await DomoCard.create(auth=auth, ...) # reuses one pooled session
# session closed here
Source code in src/crew_dcs/auth/base.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
elevate_otp
async
¶
elevate_otp(
one_time_password: str,
debug_api: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
) -> ResponseGetData
Elevate the authentication to include OTP (One-Time Password) if required.
Calls route
Source code in src/crew_dcs/auth/base.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
get_auth_token
abstractmethod
async
¶
get_auth_token(**context_kwargs) -> str | ResponseGetData
Retrieve or generate an authentication token.
Source code in src/crew_dcs/auth/base.py
127 128 129 130 131 132 133 | |
invalidate_cache
async
¶
invalidate_cache(url_pattern: str) -> None
Manually invalidate cache entries matching URL pattern.
Source code in src/crew_dcs/auth/base.py
254 255 256 257 258 259 | |
print_is_token
async
¶
print_is_token(
token_name: str | None = None, **context_kwargs
) -> bool
Print token status and return True if token is valid, otherwise False.
Source code in src/crew_dcs/auth/base.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
set_cache_strategy ¶
set_cache_strategy(strategy) -> None
Change cache invalidation strategy.
Source code in src/crew_dcs/auth/base.py
261 262 263 264 265 266 | |
who_am_i
async
¶
who_am_i(**context_kwargs) -> ResponseGetData
Perform an API call to identify the user associated with the token.
Calls route
Source code in src/crew_dcs/auth/base.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |