fix: persist configurable model request deadlines
This commit is contained in:
@@ -43,11 +43,14 @@ func testProviderLifecycle(t *testing.T, ctx context.Context, pool *pgxpool.Pool
|
||||
t.Fatal("stale configuration accepted")
|
||||
}
|
||||
token := "test-private-provider-key"
|
||||
input = service.ProviderInput{Name: "configured vendor", BaseURL: "https://provider.example/v1", ModelName: "configured-model", ModelCatalogURL: "https://provider.example/v1/models", TimeoutSeconds: 15, Enabled: true, APIKey: &token, ExpectedVersion: config.Version}
|
||||
input = service.ProviderInput{Name: "configured vendor", BaseURL: "https://provider.example/v1", ModelName: "configured-model", ModelCatalogURL: "https://provider.example/v1/models", TimeoutSeconds: 120, Enabled: true, APIKey: &token, ExpectedVersion: config.Version}
|
||||
config, err = svc.Save(ctx, actor, "model_primary", uuid.NewString(), input)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if config.TimeoutSeconds != 120 {
|
||||
t.Fatal("model deadline was not persisted")
|
||||
}
|
||||
data, _ := json.Marshal(config)
|
||||
if bytes.Contains(data, []byte(token)) || bytes.Contains(data, []byte("encrypted_api_key")) {
|
||||
t.Fatal("API exposes credential")
|
||||
|
||||
Reference in New Issue
Block a user