refactor: extract basic_auth_header helper, add plaintext credential warnings

- basic_auth_header() in config.rs replaces 6 inline STANDARD.encode calls
- warn_plaintext_credentials() logs warning at startup if auth is in config.toml
- All protocol handlers use shared helper instead of duplicating base64 logic
This commit is contained in:
2026-03-15 21:37:51 +00:00
parent fa962b2d6e
commit 0eb26f24f7
7 changed files with 54 additions and 21 deletions

View File

@@ -289,6 +289,9 @@ async fn run_server(config: Config, storage: Storage) {
let storage_path = config.storage.path.clone();
let rate_limit_enabled = config.rate_limit.enabled;
// Warn about plaintext credentials in config.toml
config.warn_plaintext_credentials();
// Initialize Docker auth with proxy timeout
let docker_auth = registry::DockerAuth::new(config.docker.proxy_timeout);