fix: normalize secret names to lowercase for case-insensitive matching (#413) (#431)

The Slack channel capabilities.json declares secret names in lowercase
(slack_bot_token) but the web UI stored them in UPPERCASE
(SLACK_BOT_TOKEN), causing credential injection to fail with
"not_authed".

Changes:
- CreateSecretParams::new() normalizes name to lowercase on creation
- All SecretsStore lookups (get, exists, delete, is_accessible) now
  lowercase the name parameter before querying
- Applied to all three backends: PostgreSQL, libSQL, InMemory
- CredentialInjector::is_secret_allowed() uses case-insensitive
  comparison

Co-authored-by: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Zaki Manian
2026-03-01 08:33:58 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent f62937d482
commit ec31e83a7d
3 changed files with 42 additions and 24 deletions
+6 -4
View File
@@ -235,14 +235,16 @@ impl CredentialInjector {
Ok(result)
}
/// Check if a secret name is in the allowed list.
/// Check if a secret name is in the allowed list (case-insensitive).
fn is_secret_allowed(&self, name: &str) -> bool {
let name_lower = name.to_lowercase();
for pattern in &self.allowed_secrets {
if pattern == name {
let pattern_lower = pattern.to_lowercase();
if pattern_lower == name_lower {
return true;
}
if let Some(prefix) = pattern.strip_suffix('*')
&& name.starts_with(prefix)
if let Some(prefix) = pattern_lower.strip_suffix('*')
&& name_lower.starts_with(prefix)
{
return true;
}