Added a check for characters which an API key cannot contain (#1227)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-24 17:20:13 +01:00
1 parent c72a1948b3
commit e5a7f5423f
40 files changed
+1179 -71

No files matched your search

@@ -59,13 +59,11 @@ public sealed class ProviderValidation
return apiKeyStorageIssue;
// A self-hosted server may well run without any key, so an empty field is fine for it:
if(this.GetProvider() is LLMProviders.SELF_HOSTED)
return null;
if(string.IsNullOrWhiteSpace(apiKey))
return TA("Please enter an API key.");
return this.GetProvider() is LLMProviders.SELF_HOSTED ? null : TA("Please enter an API key.");
return null;
// A key which is there has to be one we can send, also the optional key of a self-hosted server:
return APIKeyValidation.Validate(apiKey);
}
public string? ValidatingInstanceName(string instanceName)