utils
utils ¶
Utility functions for authentication validation.
test_is_full_auth ¶
test_is_full_auth(
auth,
function_name: str | None = None,
debug_num_stacks_to_drop: int = 1,
) -> None
Test that the provided object is a DomoFullAuth instance.
This validation function ensures that the authentication object is of the correct type for functions that specifically require full authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
The authentication object to validate |
required | |
function_name
|
str | None
|
Override function name for error reporting |
None
|
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop for debugging |
1
|
Raises:
| Type | Description |
|---|---|
AuthError
|
If auth is not a DomoFullAuth instance |
Source code in src/crew_dcs/auth/utils.py
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 | |
test_is_jupyter_auth ¶
test_is_jupyter_auth(
auth, required_auth_type_ls: list | None = None
) -> None
Test that the provided object is a valid Jupyter authentication instance.
This validation function ensures that the authentication object is one of the accepted Jupyter authentication types for functions that specifically require Jupyter authentication capabilities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
The authentication object to validate |
required | |
required_auth_type_ls
|
list | None
|
list of acceptable auth types. Defaults to [DomoJupyterFullAuth, DomoJupyterTokenAuth] |
None
|
Raises:
| Type | Description |
|---|---|
AuthError
|
If auth is not one of the required Jupyter auth types |
Source code in src/crew_dcs/auth/utils.py
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 | |