auth_utils
auth_utils ¶
get_auth_from_codeengine
async
¶
get_auth_from_codeengine(
config_auth: DomoAuth,
sudo_package_id: str,
sudo_package_version: str,
retrieval_account_name: str,
is_return_access_token: bool = True,
target_instance: str | None = None,
function_name: str = "get_account",
debug_api: bool = False,
return_raw: bool = False,
context: RouteContext | None = None,
**context_kwargs
) -> DomoTokenAuth | ResponseGetData
Retrieve account object in clear text using a CodeEngine package. optionally converts to DomoTokenAuth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_auth
|
DomoAuth
|
DomoAuth with access to the Domo instance (authenticates the API request) |
required |
target_instance
|
str | None
|
The Domo instance for which credentials are requested |
None
|
sudo_package_id
|
str
|
The CodeEngine package ID |
required |
sudo_package_version
|
str
|
The version of the CodeEngine package |
required |
retreival_account_name
|
The alias of the account to retrieve (must be shared with the package) |
required | |
function_name
|
str
|
The CodeEngine function to call (default: "get_account") |
'get_account'
|
is_return_access_token
|
bool
|
If True, returns a DomoTokenAuth; if False, returns the raw ResponseGetData |
True
|
Returns:
| Type | Description |
|---|---|
DomoTokenAuth | ResponseGetData
|
DomoTokenAuth for the requested account, or ResponseGetData if is_return_access_token is False |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the returned token is invalid |
Source code in src/crew_dcs/integrations/auth_utils.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |