Skip to content

Commit 74d9ed2

Browse files
ashrafclaude
authored andcommitted
fix(gateway): correct field order in workload_challenge to match ZOS
The previous arms used (name → backends → tls_passthrough → network), which produced a different challenge byte sequence than the ZOS node expected. The on-chain RMB deploy then failed with `failed to verify signature`. ZOS canonical order (pkg/gridtypes/zos/gw_name.go and gw_fqdn.go in threefoldtech/zos v0.5.5): Name → TLSPassthrough → Backends, with no `network` field. Updated both arms to match exactly, including the `%t` boolean formatting used by Go's fmt.Fprintf. Verified end-to-end on dev grid against gent02.dev.grid.tf — a gateway-name-proxy now deploys to ready state and the assigned FQDN is returned from the workload result. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent be9e52c commit 74d9ed2

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/grid_client/deployment.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -705,26 +705,30 @@ fn workload_challenge(out: &mut String, workload: &DeployWorkload) -> Result<(),
705705
}
706706
}
707707
zos::GATEWAY_NAME_PROXY_TYPE => {
708+
// Matches the canonical Go ZOS implementation in
709+
// pkg/gridtypes/zos/gw_name.go: Name → TLSPassthrough → Backends.
710+
// `network` is NOT included in the challenge — ZOS rejects the
711+
// signature otherwise.
708712
let data: GatewayNameProxyData =
709713
serde_json::from_value(workload.data.clone()).map_err(GridError::from)?;
710714
out.push_str(&data.name);
715+
write!(out, "{}", data.tls_passthrough)
716+
.map_err(|err| GridError::backend(err.to_string()))?;
711717
for backend in &data.backends {
712718
out.push_str(backend);
713719
}
714-
write!(out, "{}", data.tls_passthrough)
715-
.map_err(|err| GridError::backend(err.to_string()))?;
716-
out.push_str(&data.network);
717720
}
718721
zos::GATEWAY_FQDN_PROXY_TYPE => {
722+
// Matches the canonical Go ZOS implementation in
723+
// pkg/gridtypes/zos/gw_fqdn.go: FQDN → TLSPassthrough → Backends.
719724
let data: GatewayFqdnProxyData =
720725
serde_json::from_value(workload.data.clone()).map_err(GridError::from)?;
721726
out.push_str(&data.fqdn);
727+
write!(out, "{}", data.tls_passthrough)
728+
.map_err(|err| GridError::backend(err.to_string()))?;
722729
for backend in &data.backends {
723730
out.push_str(backend);
724731
}
725-
write!(out, "{}", data.tls_passthrough)
726-
.map_err(|err| GridError::backend(err.to_string()))?;
727-
out.push_str(&data.network);
728732
}
729733
other => {
730734
return Err(GridError::validation(format!(

0 commit comments

Comments
 (0)