From 44b7a56573fe1c60372656d13501790af2013557 Mon Sep 17 00:00:00 2001 From: Dennis Nemec Date: Thu, 3 Sep 2026 20:28:17 +0200 Subject: [PATCH] Actually use the tested token parser for the registry challenge The call site still deserialized into a struct whose serde alias breaks on Docker Hub, which sends token and access_token; every Hub image therefore reported that no token was returned. The integration test now answers with both fields so the call site is covered. Co-Authored-By: Claude Opus 5 --- backend/crates/infrastructure/src/registry.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/backend/crates/infrastructure/src/registry.rs b/backend/crates/infrastructure/src/registry.rs index daa2744..4b8df39 100644 --- a/backend/crates/infrastructure/src/registry.rs +++ b/backend/crates/infrastructure/src/registry.rs @@ -152,14 +152,7 @@ impl ImageRegistry for CurlImageRegistry { DomainError::Unavailable(format!("{host}: authentication required")) })?; let (_, _, token_body) = self.get(&challenge, None).await?; - #[derive(serde::Deserialize)] - struct Token { - #[serde(alias = "access_token")] - token: Option, - } - token = serde_json::from_str::(&token_body) - .ok() - .and_then(|t| t.token); + token = parse_token(&token_body); if token.is_none() { return Err(DomainError::Unavailable(format!( "{host}: no token in the auth response"