Skip to content

fix: add api_key field to provider schema for inline key setup#57

Merged
houko merged 1 commit intomainfrom
fix/provider-schema-api-key
Apr 15, 2026
Merged

fix: add api_key field to provider schema for inline key setup#57
houko merged 1 commit intomainfrom
fix/provider-schema-api-key

Conversation

@houko
Copy link
Copy Markdown
Contributor

@houko houko commented Apr 15, 2026

Summary

  • Add optional api_key field (marked secret = true) to the provider schema so the dashboard creation form can accept the actual API key value during provider setup
  • The backend (fix(dashboard): fix stale state bugs in provider config modal librefang#2537) strips this field from the TOML file and saves it to secrets.env instead, so the provider is immediately configured after creation

Context

Previously, creating a custom provider via the dashboard only collected api_key_env (the environment variable name) but not the actual key value. The provider was always created as "unconfigured" and the user had to separately open the config modal to enter the key.

Test plan

  • Create a custom provider via dashboard with an API key — verify it appears in "configured" tab immediately
  • Create a custom provider without an API key — verify it appears in "unconfigured" tab (no regression)

The provider creation form only collected api_key_env (the env var
name) but not the actual key value. New providers were always created
as "unconfigured" because no key was stored.

Add an optional secret api_key field so the dashboard can pass the
key value during creation. The backend strips it from the TOML and
saves it to secrets.env instead.
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@houko houko merged commit 6439fb1 into main Apr 15, 2026
3 checks passed
@houko houko deleted the fix/provider-schema-api-key branch April 15, 2026 03:49
houko added a commit to librefang/librefang that referenced this pull request Apr 15, 2026
…ton for all providers

1. Backend: extract optional api_key from provider creation request
   body, save it to secrets.env and set the env var before
   detect_auth() so the provider is immediately configured. The key
   value is stripped from the TOML file.
2. Frontend: show "Remove Key" button on all configured provider
   cards (not just custom ones). The delete action only removes the
   API key so it is safe for built-in providers. Custom providers
   show "Delete", built-in ones show "Remove Key" with distinct
   confirmation wording.
3. Frontend: auto-switch to "configured" tab after creating a
   provider so the user sees it immediately.

Companion PR: librefang/librefang-registry#57
houko added a commit to librefang/librefang that referenced this pull request Apr 15, 2026
…ton for all providers (#2540)

* fix(dashboard): save API key on provider creation and show remove button for all providers

1. Backend: extract optional api_key from provider creation request
   body, save it to secrets.env and set the env var before
   detect_auth() so the provider is immediately configured. The key
   value is stripped from the TOML file.
2. Frontend: show "Remove Key" button on all configured provider
   cards (not just custom ones). The delete action only removes the
   API key so it is safe for built-in providers. Custom providers
   show "Delete", built-in ones show "Remove Key" with distinct
   confirmation wording.
3. Frontend: auto-switch to "configured" tab after creating a
   provider so the user sees it immediately.

Companion PR: librefang/librefang-registry#57

* fix(runtime): remove orphaned doc comment causing empty_line_after_doc_comments lint
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.

1 participant