feat(oauth): improve credential schema validation in provider

This commit is contained in:
Harry 2025-07-11 16:48:38 +08:00
parent 0532135a9c
commit ab6ae1f209
1 changed files with 2 additions and 2 deletions

View File

@ -139,9 +139,9 @@ class BuiltinToolProviderController(ToolProviderController):
returns the credential support type of the provider
"""
types = []
if self.entity.credentials_schema is not None:
if self.entity.credentials_schema is not None and len(self.entity.credentials_schema) > 0:
types.append(CredentialType.API_KEY.value)
if self.entity.oauth_schema is not None:
if self.entity.oauth_schema is not None and len(self.entity.oauth_schema.credentials_schema) > 0:
types.append(CredentialType.OAUTH2.value)
return types