feat(auth): add OAuth2 support for xAI with PKCE and token persistence
- Implemented xAI OAuth2 integration with PKCE (Proof Key for Code Exchange) support. - Added logic for token exchange, refresh, and persistent storage in JSON format. - Created `xai` package with helpers for OAuth discovery, API token handling, and URL building. - Introduced `XAIExecutor` for integrating xAI credentials into runtime HTTP requests. - Added unit tests to validate OAuth flow, token persistence, and endpoint validation.
This commit is contained in:
@@ -215,6 +215,7 @@ func detectChangedProviders(oldData, newData *staticModelsJSON) []string {
|
||||
{"codex", oldData.CodexPro, newData.CodexPro},
|
||||
{"kimi", oldData.Kimi, newData.Kimi},
|
||||
{"antigravity", oldData.Antigravity, newData.Antigravity},
|
||||
{"xai", oldData.XAI, newData.XAI},
|
||||
}
|
||||
|
||||
seen := make(map[string]bool, len(sections))
|
||||
@@ -335,6 +336,7 @@ func validateModelsCatalog(data *staticModelsJSON) error {
|
||||
{name: "codex-pro", models: data.CodexPro},
|
||||
{name: "kimi", models: data.Kimi},
|
||||
{name: "antigravity", models: data.Antigravity},
|
||||
{name: "xai", models: data.XAI},
|
||||
}
|
||||
|
||||
for _, section := range requiredSections {
|
||||
|
||||
Reference in New Issue
Block a user