Skip to content

fix(config): vault token resolution must not auto-create channel configs#2133

Merged
bug-ops merged 3 commits intomainfrom
fix-2132-vault-token-resolution
Mar 22, 2026
Merged

fix(config): vault token resolution must not auto-create channel configs#2133
bug-ops merged 3 commits intomainfrom
fix-2132-vault-token-resolution

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 22, 2026

Summary

  • resolve_vault_secrets() used get_or_insert to create TelegramConfig/DiscordConfig/SlackConfig when vault tokens were found, even without a corresponding config section
  • This caused startup failure: empty allowed_userstelegram.allowed_users must not be empty
  • Fix: replace get_or_insert with as_mut() let-chains — vault tokens are only injected into configs that already exist from the TOML file

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --features full --workspace -- -D warnings passes
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 6397 tests pass

Closes #2132

bug-ops added 2 commits March 22, 2026 20:26
resolve_vault_secrets() used get_or_insert to create TelegramConfig,
DiscordConfig, and SlackConfig when vault tokens were found, even when
no corresponding section existed in the config file. This caused
immediate startup failure due to empty allowed_users.

Replace get_or_insert with as_mut() let-chains so vault tokens are
only injected into existing channel configs. If no [telegram]/[discord]/
[slack] section is present, the vault token is silently ignored and the
agent starts in CLI mode as expected.

Closes #2132
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working labels Mar 22, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 22, 2026 21:16
@github-actions github-actions bot added the size/M Medium PR (51-200 lines) label Mar 22, 2026
…ution behavior

age_encrypt_decrypt_resolve_secrets_roundtrip now asserts telegram is None
when no [telegram] section exists in config (new correct behavior).

Added age_vault_injects_token_into_existing_telegram_config to verify that
vault tokens ARE injected when the config section already exists.
@bug-ops bug-ops merged commit 4ed5539 into main Mar 22, 2026
25 checks passed
@bug-ops bug-ops deleted the fix-2132-vault-token-resolution branch March 22, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): vault token resolution must not auto-create channel config with empty allowed_users

1 participant