fix(provider): test-credentials now resolves all secret field types#106
Merged
fix(provider): test-credentials now resolves all secret field types#106
Conversation
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
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously,
test_provider_credentialsonly looked up secrets using the hardcoded field nameapi_keyvia_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.passwordortoken), even when credentials had been correctly saved.Fix: load the provider's credential schema via
_get_api_service_secret_field_namesand iterate over every field whosestorageis"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.yamldefines a secret credential field with a key other thanapi_key(e.g. Qingteng HIDS usingpassword/token).