Resolve Auth Mode • AI Agent SDK
resolve_auth_mode: Resolve authentication mode based on bind host and explicit configuration.
resolve_auth_mode
Function
</div>
This function is defined in the protocols module.
Resolve authentication mode based on bind host and explicit configuration.
Signature
def resolve_auth_mode(bind_host: str, configured: Optional[AuthMode]) -> AuthModeParameters
ParamField
strHost/IP that the service is bound to
ParamField
Optional[AuthMode]Explicitly configured auth mode (takes precedence)
Returns
ResponseField
AuthModeThe resolved authentication mode
Usage
>>> resolve_auth_mode("127.0.0.1")
'local'
>>> resolve_auth_mode("0.0.0.0")
'token'
>>> resolve_auth_mode("127.0.0.1", "token")
'token'Uses
is_loopback
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 2673