feat: 完整游戏运维功能
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"browser.local/platform/domain"
|
||||
)
|
||||
|
||||
func TestAIProviderResponseExposesOnlyKeyReference(t *testing.T) {
|
||||
func TestAIProviderResponseExposesOnlyKeyPresence(t *testing.T) {
|
||||
responseType := reflect.TypeOf(AIProviderResponse{})
|
||||
if _, ok := responseType.FieldByName("APIKey"); ok {
|
||||
t.Fatal("AI provider response must not expose raw API key")
|
||||
@@ -15,8 +15,11 @@ func TestAIProviderResponseExposesOnlyKeyReference(t *testing.T) {
|
||||
if _, ok := responseType.FieldByName("RawAPIKey"); ok {
|
||||
t.Fatal("AI provider response must not expose raw API key")
|
||||
}
|
||||
if _, ok := responseType.FieldByName("APIKeyRef"); !ok {
|
||||
t.Fatal("AI provider response must expose API key reference")
|
||||
if _, ok := responseType.FieldByName("APIKeyRef"); ok {
|
||||
t.Fatal("AI provider response must not expose internal API key reference")
|
||||
}
|
||||
if _, ok := responseType.FieldByName("APIKeyConfigured"); !ok {
|
||||
t.Fatal("AI provider response must expose API key presence")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +44,8 @@ func TestAIProviderFromDomainCopiesModels(t *testing.T) {
|
||||
if provider.Models[0] != "gpt-4.1" {
|
||||
t.Fatalf("expected response models to be copied, got source models %+v", provider.Models)
|
||||
}
|
||||
if response.APIKeyRef != provider.APIKeyRef {
|
||||
t.Fatalf("expected API key reference to be preserved, got %q", response.APIKeyRef)
|
||||
if !response.APIKeyConfigured {
|
||||
t.Fatal("expected configured API key presence")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user