Deploy reviewed Windows sync alignment with schema 20 server
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
Bind the administrative connection-205 review to original signed history and preserve closed readiness. Include the qualified server dependency closure, UI review, native ARM64 build provenance, and guarded deployment evidence. Migration, API/gateway replacement and TLS checks passed with unchanged job authority, protected mounts and time/database services; native Windows receipt application remains separate.
This commit is contained in:
@@ -242,11 +242,14 @@ async fn issue(
|
||||
let health_key_id = hash(&health_public);
|
||||
let (header, journal) =
|
||||
update::verify_inflight_proof(&input.proof, health_public).map_err(|_| denied())?;
|
||||
require(journal.phase() == Phase::ServicesStarted)?;
|
||||
let rollback = journal.phase() == Phase::RollbackServicesStarted;
|
||||
require(journal.phase() == Phase::ServicesStarted || rollback)?;
|
||||
let decoded = input.proof.decode().map_err(|_| denied())?;
|
||||
let last: Event = serde_json::from_slice(decoded.events.last().ok_or_else(denied)?)?;
|
||||
let Evidence::ServicesStarted { services, .. } = &last.evidence else {
|
||||
return Err(denied());
|
||||
let services = match &last.evidence {
|
||||
Evidence::ServicesStarted { services, .. } if !rollback => services,
|
||||
Evidence::RollbackServicesStarted { services, .. } if rollback => services,
|
||||
_ => return Err(denied()),
|
||||
};
|
||||
let started_at = last.observed_at;
|
||||
let (applied_request, applied_raw) =
|
||||
@@ -485,8 +488,9 @@ async fn issue(
|
||||
hash(&confirming_raw),
|
||||
inventory_hash,
|
||||
))?);
|
||||
let cached: Option<Value> = sqlx::query_scalar("SELECT data FROM audit_events WHERE event_type='agent_update_health' AND data->>'grant_id'=$1 ORDER BY created_at LIMIT 1")
|
||||
.bind(header.attempt.grant_id.to_string()).fetch_optional(&mut *tx).await?;
|
||||
let code_generation = if rollback { "predecessor" } else { "candidate" };
|
||||
let cached: Option<Value> = sqlx::query_scalar("SELECT data FROM audit_events WHERE event_type='agent_update_health' AND data->>'grant_id'=$1 AND COALESCE(data->>'code_generation','candidate')=$2 ORDER BY created_at LIMIT 1")
|
||||
.bind(header.attempt.grant_id.to_string()).bind(code_generation).fetch_optional(&mut *tx).await?;
|
||||
if let Some(cached) = cached {
|
||||
require(
|
||||
cached["witness_sha256"] == witness_hash && cached["health_key_id"] == health_key_id,
|
||||
@@ -495,8 +499,14 @@ async fn issue(
|
||||
journal
|
||||
.prepare(
|
||||
issued_at,
|
||||
Evidence::HealthVerified {
|
||||
receipt: original.clone(),
|
||||
if rollback {
|
||||
Evidence::RollbackHealthVerified {
|
||||
receipt: original.clone(),
|
||||
}
|
||||
} else {
|
||||
Evidence::HealthVerified {
|
||||
receipt: original.clone(),
|
||||
}
|
||||
},
|
||||
)
|
||||
.map_err(|_| denied())?;
|
||||
@@ -517,8 +527,14 @@ async fn issue(
|
||||
journal
|
||||
.prepare(
|
||||
issued_at,
|
||||
Evidence::HealthVerified {
|
||||
receipt: signed.clone(),
|
||||
if rollback {
|
||||
Evidence::RollbackHealthVerified {
|
||||
receipt: signed.clone(),
|
||||
}
|
||||
} else {
|
||||
Evidence::HealthVerified {
|
||||
receipt: signed.clone(),
|
||||
}
|
||||
},
|
||||
)
|
||||
.map_err(|_| denied())?;
|
||||
@@ -526,7 +542,7 @@ async fn issue(
|
||||
.bind(tenant).bind(Uuid::new_v4()).bind(format!("agent:{agent}"))
|
||||
.bind(json!({"grant_id":header.attempt.grant_id,"job_id":header.attempt.job_id,"attempt_id":header.attempt.attempt_id,
|
||||
"handoff_sha256":input.proof.delegation.handoff_sha256,"head_sha256":input.proof.head_sha256,"event_count":decoded.events.len(),
|
||||
"health_key_id":health_key_id,"witness_sha256":witness_hash,"receipt":signed,"evidence_only":true,"ready":false}))
|
||||
"health_key_id":health_key_id,"witness_sha256":witness_hash,"receipt":signed,"evidence_only":true,"ready":false,"code_generation":code_generation}))
|
||||
.execute(&mut *tx).await?;
|
||||
tx.commit().await?;
|
||||
Ok(Json(signed))
|
||||
|
||||
Reference in New Issue
Block a user