datarobot_genai.drmcputils.auth
auth
set_request_headers
Inject request headers from any runtime adapter (FastMCP, Starlette, LangChain, tests).
Source code in datarobot_genai/drmcputils/auth.py
get_request_headers
set_auth_context
get_auth_context
Return authorization context injected for the current request.
Source code in datarobot_genai/drmcputils/auth.py
must_get_auth_context
async
Retrieve the AuthCtx from the current request context or raise error.
Source code in datarobot_genai/drmcputils/auth.py
extract_auth_context_from_headers
Parse x-datarobot-authorization-context into an :class:AuthCtx.
Source code in datarobot_genai/drmcputils/auth.py
get_access_token
async
Retrieve access token from the DataRobot OAuth Provider Service.
Source code in datarobot_genai/drmcputils/auth.py
oauth_access_token_header_name
Build x-datarobot-<segment>-access-token from header_segment (normalized).
Source code in datarobot_genai/drmcputils/auth.py
resolve_datarobot_token
Resolve the DataRobot API token according to auth_resolution_strategy.
Source code in datarobot_genai/drmcputils/auth.py
resolve_secret
Resolve a secret from request headers and/or config per auth_resolution_strategy.
Source code in datarobot_genai/drmcputils/auth.py
resolve_oauth_access_token_from_headers
Read x-datarobot-<segment>-access-token for header_segment (raw or Bearer).
Source code in datarobot_genai/drmcputils/auth.py
get_oauth_access_token_with_header_fallback
async
get_oauth_access_token_with_header_fallback(provider_type: str, *, display_name: str, access_token_header_segment: str) -> str | ToolError
Resolve an OAuth access token via OBO or request header (http strategy only).