mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
feat(azure-foundry): add Microsoft Entra ID auth
Use azure-identity DefaultAzureCredential for keyless Foundry auth. Preserve refreshable callable credentials through OpenAI and Anthropic client paths. Add setup, doctor, auth status, docs, and tests for Entra auth. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
457fa913b8
commit
9df9816dab
38 changed files with 3772 additions and 122 deletions
|
|
@ -1288,9 +1288,15 @@ def _truncate_token(value: Optional[str], visible: int = 6) -> str:
|
|||
OAuth access token. JWT prefixes (the part before the first dot) are
|
||||
stripped first when present so the visible suffix is always part of
|
||||
the signing region rather than a meaningless header chunk.
|
||||
|
||||
Returns the Entra-ID placeholder when handed a callable (Azure Foundry
|
||||
bearer provider) — the callable is NEVER invoked here.
|
||||
"""
|
||||
if not value:
|
||||
return ""
|
||||
if callable(value) and not isinstance(value, str):
|
||||
# Entra ID bearer provider — never reveal a minted token in the UI.
|
||||
return "<entra-id-bearer>"
|
||||
s = str(value)
|
||||
if "." in s and s.count(".") >= 2:
|
||||
# Looks like a JWT — show the trailing piece of the signature only.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue