Skip to content

Conversation

@hellovai
Copy link
Contributor

@hellovai hellovai commented Nov 9, 2025

Summary

Adds comprehensive authentication documentation for the Azure OpenAI provider, including support for Azure AD (Entra ID) OAuth authentication via DefaultAzureCredential chain.

This PR adds user-facing documentation that:

  • Documents the DefaultAzureCredential chain (Environment variables, Managed Identity, Azure CLI, API key fallback)
  • Explains each authentication method with examples (API Key, Azure CLI, Service Principal, Managed Identity)
  • Maintains backward compatibility with existing api_key field while introducing new nested auth object pattern
  • Defaults to credential chain when no auth is specified (no breaking changes)

The authentication pattern follows the same design as our existing Vertex AI and AWS Bedrock implementations.

Implementation Details

Authentication Methods Supported:

  1. Default (DefaultAzureCredential chain): Tries Environment → Managed Identity → Azure CLI → AZURE_OPENAI_API_KEY
  2. API Key: Direct API key authentication (backward compatible)
  3. Azure CLI: Uses credentials from az login
  4. Service Principal: Client ID + Client Secret + Tenant ID
  5. Managed Identity: For Azure-hosted resources (VMs, App Service, etc.)

Configuration Design:

  • When neither auth nor api_key is specified, defaults to auth { type "default" }
  • Existing configs with api_key continue to work (backward compatible)
  • New auth object uses nested structure with type field (follows GCP/AWS pattern)

Test plan

  • Review documentation for clarity and completeness
  • Verify examples are valid BAML syntax
  • Confirm backward compatibility story makes sense

🤖 Generated with Claude Code


Note

Adds Azure OpenAI authentication docs (DefaultAzureCredential, API key, AAD methods), strengthens WASM JWT/Vertex auth validation and error messages, and auto-saves API key deletions in the playground.

  • Docs (azure-openai):
    • Add comprehensive authentication section with examples: default credential chain, API key, Azure CLI, service principal, managed identity.
    • Introduce options.auth { type ... } pattern and clarify api_key behavior/overrides.
  • Runtime (Rust, WASM):
    • vertex/wasm_auth.rs: validate credential strings (length check) and improve error contexts (claims serialization, JWT encoding); remove debug noise.
    • wasm_jwt.rs: enhance PEM handling (strip RSA/PKCS#8 headers, normalize newlines), add key length validation, and expand actionable error messages (missing WebCrypto, base64 decode, key import).
  • Playground UI:
    • api-keys-dialog/atoms.ts: auto-save deletions to userApiKeysAtom and clear pending changes; maintain recently added keys state.

Written by Cursor Bugbot for commit 5e58c77. This will update automatically on new commits. Configure here.

hellovai and others added 5 commits October 30, 2025 13:58
This commit fixes two critical issues:

1. **Fix JWT encoding for GCP service account keys in WASM**
   - Handle literal `\n` characters in JSON (common in GCP service account files)
   - Add support for both PKCS#8 and PKCS#1 format PEM headers
   - Validate key length before attempting import (must be >= 100 bytes)
   - Improve error messages with actionable troubleshooting steps
   - Add new `KeyTooShort` error variant with context

2. **Fix environment variable deletion not persisting**
   - `deleteApiKeyAtom` now auto-saves changes to storage
   - Deletion behavior now consistent with edit auto-save
   - Fixes bug where clicking trash icon only updated local state

Technical details:
- WASM JWT: Added `.replace("\\n", "")` to handle escaped newlines in JSON strings
- WASM JWT: Enhanced error messages for WebCrypto import failures
- WASM Auth: Add early validation for credentials string length
- TypeScript: Modified `deleteApiKeyAtom` to persist deletions immediately

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Adds comprehensive authentication documentation for Azure OpenAI provider, including:
- DefaultAzureCredential chain (Environment, Managed Identity, Azure CLI, API Key fallback)
- API Key authentication (both top-level and nested patterns)
- Azure CLI authentication
- Service Principal authentication
- Managed Identity authentication

Maintains backward compatibility with existing api_key field while introducing new nested auth object pattern with type field. When no authentication is specified, defaults to DefaultAzureCredential chain with AZURE_OPENAI_API_KEY as final fallback for easy migration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vercel
Copy link

vercel bot commented Nov 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
promptfiddle Ready Ready Preview Comment Nov 9, 2025 5:42am

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

@hellovai hellovai temporarily deployed to boundary-tools-dev November 9, 2025 05:25 — with GitHub Actions Inactive
@hellovai hellovai temporarily deployed to boundary-tools-dev November 9, 2025 05:25 — with GitHub Actions Inactive
@hellovai hellovai temporarily deployed to boundary-tools-dev November 9, 2025 05:25 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Nov 9, 2025

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants