-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Currently, the CKEditor AI Agent module passes API keys directly to the JavaScript plugin, which sends them in HTTP Authorization: Bearer headers to AI providers. This exposes API keys in the browser.
Proposed Change
Restructure the module to route all AI requests through a Drupal controller that uses the ai module's AiProviderPluginManager, following the same pattern as dxpr/dxpr_builder#4061.
Architecture: Frontend → Drupal Controller → ai module → ai_provider_dxpr → Kavya API
Implementation
- Create
src/Controller/AiChatController.php— proxy endpoint that routes requests through theaimodule - Add route
ckeditor_ai_agent.ai_chatat/api/ckeditor-ai-agent/ai/chat - Update
getDynamicPluginConfig()inAiAgent.phpandgetCkEditorConfig()inAiAgentConfigurationManager.phpto passendpointUrlinstead ofapiKeywhen theaimodule is available - Add
aiandai_provider_dxpras module dependencies - The JS plugin already supports
endpointUrlwithoutapiKey(ckeditor5-ai-agent PR #174)
Benefits
- API keys are never exposed to the browser
- Centralized AI provider management through the
aimodule - Consistent architecture with DXPR Builder
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels