From 4b511c4dadd2803a845621fdbc4b052b642a9815 Mon Sep 17 00:00:00 2001 From: Guillem Arias Date: Fri, 29 May 2026 14:50:49 +0200 Subject: [PATCH] fix(ci): replace sk-ant- prefixed test placeholders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pipelock secret scanner pattern-matches `sk-ant-*` as a real Anthropic API key and fails the PR security-scan check. Test stubs and ClimateControl env values used `sk-ant-test`, `sk-ant-from-setting`, `sk-ant-x`, `sk-ant-y` as obvious placeholders, but the scanner does not care about value entropy. Switched to `fake-anthropic-key-*` / `fake-token-*` strings so the scanner stops flagging them. No production code touched, no behavior change — Provider::Anthropic still accepts any non-blank token. --- test/models/provider/anthropic_test.rb | 4 ++-- test/models/provider/registry_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/models/provider/anthropic_test.rb b/test/models/provider/anthropic_test.rb index d0beb9da9..26d894566 100644 --- a/test/models/provider/anthropic_test.rb +++ b/test/models/provider/anthropic_test.rb @@ -67,11 +67,11 @@ class Provider::AnthropicTest < ActiveSupport::TestCase Setting.stubs(:anthropic_access_token).returns(nil) assert_not Provider::Anthropic.configured? - Setting.stubs(:anthropic_access_token).returns("sk-ant-x") + Setting.stubs(:anthropic_access_token).returns("fake-token-1") assert Provider::Anthropic.configured? end - ClimateControl.modify("ANTHROPIC_API_KEY" => "sk-ant-y") do + ClimateControl.modify("ANTHROPIC_API_KEY" => "fake-token-2") do Setting.stubs(:anthropic_access_token).returns(nil) assert Provider::Anthropic.configured? end diff --git a/test/models/provider/registry_test.rb b/test/models/provider/registry_test.rb index bcf0509c5..2aa274662 100644 --- a/test/models/provider/registry_test.rb +++ b/test/models/provider/registry_test.rb @@ -62,7 +62,7 @@ class Provider::RegistryTest < ActiveSupport::TestCase end test "anthropic provider initializes from ANTHROPIC_API_KEY env" do - ClimateControl.modify("ANTHROPIC_API_KEY" => "sk-ant-test", "ANTHROPIC_ACCESS_TOKEN" => nil) do + ClimateControl.modify("ANTHROPIC_API_KEY" => "fake-anthropic-key-for-tests", "ANTHROPIC_ACCESS_TOKEN" => nil) do Setting.stubs(:anthropic_access_token).returns(nil) provider = Provider::Registry.get_provider(:anthropic) @@ -78,7 +78,7 @@ class Provider::RegistryTest < ActiveSupport::TestCase "ANTHROPIC_BASE_URL" => "", "ANTHROPIC_MODEL" => "" ) do - Setting.stubs(:anthropic_access_token).returns("sk-ant-from-setting") + Setting.stubs(:anthropic_access_token).returns("fake-anthropic-key-from-setting") Setting.stubs(:anthropic_base_url).returns(nil) Setting.stubs(:anthropic_model).returns(nil)