Skip to main content

build_auths_context

Function build_auths_context 

Source
pub fn build_auths_context(
    repo_path: &Path,
    env_config: &EnvironmentConfig,
    passphrase_provider: Option<Arc<dyn PassphraseProvider + Send + Sync>>,
) -> Result<AuthsContext>
Expand description

Builds a canonical AuthsContext for CLI commands.

This is the single composition root for all storage and keychain wiring. All commands that need an AuthsContext must use this function instead of assembling the context inline.

Args:

  • repo_path: Path to the auths registry Git repository.
  • env_config: Environment configuration used to select the keychain backend.
  • passphrase_provider: Optional passphrase provider; None uses the keychain default.

Usage:

let ctx = build_auths_context(&repo_path, &env_config, Some(passphrase_provider))?;