Integrate independent signed Windows clocks with native Linux lease guards
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -312,6 +312,12 @@ struct WorkerConfig {
|
||||
job_binding_file: PathBuf,
|
||||
enable_jobs: bool,
|
||||
}
|
||||
/// This is a separate child process, not the SCM agent's clock context. Until
|
||||
/// it has its own independently qualified signed adapter, deny rather than
|
||||
/// accepting parent timestamps or falling back to the unqualified RPC clock.
|
||||
fn worker_clock_now() -> Result<DateTime<Utc>> {
|
||||
anyhow::bail!("EVENT_LOG_SIGNED_CHILD_CLOCK_NOT_CONFIGURED")
|
||||
}
|
||||
fn ticket_name(permit: &ExecutionPermitPayload) -> String {
|
||||
format!("eventlog-{}.json", hash(permit.grant_id.as_bytes()))
|
||||
}
|
||||
@@ -527,8 +533,7 @@ pub fn worker(path: &Path) -> Result<()> {
|
||||
"EVENT_LOG_PARENT_INSTANCE"
|
||||
);
|
||||
let binding = crate::job_binding::readonly_binding(&config.job_binding_file)?;
|
||||
let clock = crate::clock::NativeClock::new();
|
||||
let now = clock.now()?;
|
||||
let now = worker_clock_now()?;
|
||||
let (job, permit) = binding.verify(&ticket.request, now - chrono::Duration::seconds(2))?;
|
||||
binding.verify(&ticket.request, now + chrono::Duration::seconds(2))?;
|
||||
let query = event_log::for_job(&job)?;
|
||||
@@ -579,7 +584,7 @@ pub fn worker(path: &Path) -> Result<()> {
|
||||
once.sync_all()?;
|
||||
native::private_path(&marker, false)?;
|
||||
// File I/O, CIM and child scheduling cannot extend the signed start window.
|
||||
let now = clock.now()?;
|
||||
let now = worker_clock_now()?;
|
||||
binding.verify(&ticket.request, now - chrono::Duration::seconds(2))?;
|
||||
binding.verify(&ticket.request, now + chrono::Duration::seconds(2))?;
|
||||
ensure!(
|
||||
|
||||
Reference in New Issue
Block a user