Skip to content

fix(provider): test-credentials now resolves all secret field types#106

Merged
xiami762 merged 1 commit intomainfrom
fix/test-credentials-non-apikey-secrets
Apr 13, 2026
Merged

fix(provider): test-credentials now resolves all secret field types#106
xiami762 merged 1 commit intomainfrom
fix/test-credentials-non-apikey-secrets

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

Previously, test_provider_credentials only looked up secrets using the hardcoded field name api_key via _get_api_service_secret_candidates. This caused credential validation to always fail with "No credentials configured for this service" for API services that use other secret field names (e.g. password or token), even when credentials had been correctly saved.

Fix: load the provider's credential schema via
_get_api_service_secret_field_names and iterate over every field whose storage is "secret" when searching the secret manager. Falls back to ["api_key"] when no schema is available, preserving backward compatibility with existing providers.

Affected services: any API service whose _provider.yaml defines a secret credential field with a key other than api_key (e.g. Qingteng HIDS using password/token).

Previously, `test_provider_credentials` only looked up secrets using the
hardcoded field name `api_key` via `_get_api_service_secret_candidates`.
This caused credential validation to always fail with "No credentials
configured for this service" for API services that use other secret field
names (e.g. `password` or `token`), even when credentials had been
correctly saved.

Fix: load the provider's credential schema via
`_get_api_service_secret_field_names` and iterate over every field whose
`storage` is `"secret"` when searching the secret manager. Falls back to
`["api_key"]` when no schema is available, preserving backward
compatibility with existing providers.

Affected services: any API service whose `_provider.yaml` defines a
secret credential field with a key other than `api_key` (e.g. Qingteng
HIDS using `password`/`token`).

Made-with: Cursor
@xiami762 xiami762 self-requested a review April 13, 2026 07:49
@xiami762 xiami762 merged commit 290b34a into main Apr 13, 2026
2 checks passed
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