API Keys: UX clarity & env var configuration #31
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_aibroker#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The API Keys page shows a generic "Create Key" button with only a name field. This is confusing — it's not clear that these are keys you issue to others to use your broker. Also, there is no way to configure the underlying provider API keys (e.g. OpenRouter, Groq).
Expected Behavior
OPENROUTER_API_KEYGROQ_API_KEYCLAUDE_API_KEY(custom)Acceptance Criteria
mahmoud referenced this issue2026-03-30 10:33:26 +00:00
Implementation Spec for Issue #31: API Keys UX Clarity & Provider Configuration
Objective
Refactor the AIBroker admin dashboard so that (1) the existing "API Keys" tab clearly communicates it is for issuing access keys to other users of your broker, and (2) provider API key configuration (OpenRouter, Groq, etc.) is moved to a new dedicated "Providers" tab with env-var-style input fields and runtime update capability.
Requirements
rpc()helper, fragment-based tab panesFiles to Modify/Create
crates/hero_aibroker_ui/templates/index.htmlcrates/hero_aibroker_ui/templates/fragments/apikeys_pane.htmlcrates/hero_aibroker_ui/templates/fragments/providers_pane.htmlcrates/hero_aibroker_ui/src/api/mod.rsproviders.list,providers.set_key,providers.remove_keycrates/hero_aibroker/src/config/mod.rscrates/hero_aibroker_server/openrpc.jsonImplementation Plan
Step 1: Enhance API Keys Tab UX (Template Only)
fragments/apikeys_pane.htmlStep 2: Create Providers Tab (Template)
providers_pane.htmlwith card-based layout showing all known providersindex.htmlStep 3: Add Provider RPC Handlers (Backend)
ProviderStatusstruct and status methods to ConfigArc<RwLock<Config>>for runtime mutabilityproviders.list,providers.set_key,providers.remove_keyRPC handlersStep 4: Hot-Reload Providers on Key Change (Backend)
rebuild_providers()functionStep 5: Update OpenRPC Specification
providers.list,providers.set_key,providers.remove_keymethod definitionsProviderStatusschemaAcceptance Criteria
providers.*methodsNotes
providers.listmust always return masked keys.providers.set_keyis behind admin auth.<script>blocks — new fragments follow this pattern.Test Results
hero_aibroker_examples(unrelated to this change)cargo checkpasses cleanly for all modified cratesImplementation Summary
Files Created
crates/hero_aibroker_ui/templates/fragments/apikeys_pane.html- New fragment for Access Keys tab with clarifying UX copy, label field, and info alertcrates/hero_aibroker_ui/templates/fragments/providers_pane.html- New Providers tab with card-based provider status, key management formsFiles Modified
crates/hero_aibroker_ui/templates/index.html- Renamed "API Keys" to "Access Keys", added "Providers" tab, extracted inline JS to fragmentscrates/hero_aibroker/src/config/mod.rs- AddedProviderStatusstruct,provider_status(),add_provider_key(),remove_provider_key()methodscrates/hero_aibroker_ui/src/api/mod.rs- Wrapped Config inArc<RwLock<Config>>, addedproviders.list,providers.set_key,providers.remove_keyRPC handlerscrates/hero_aibroker_server/openrpc.json- Added 3 new provider method definitions andProviderStatusschemaNotes