pub(crate) fn verified_block_id(
state: &AppState,
caller: Option<&Caller>,
auth: &UiAutomationAuth,
) -> Result<String, String>Expand description
Verify auth proves the caller genuinely is auth.agent_id (via that
agent’s own jekt key — an attacker without agent_id’s key cannot
produce a valid signature no matter what it claims), then derive that
agent’s ACTUAL current block_id server-side. Never trusts a block_id
from the client — there isn’t one to trust. See this module’s own doc
comment for the full rationale.
pub(crate): also reused by app_api::pane::handle_close_pane (and any
future own-pane-resolving handler) — the identity-verification mechanism
isn’t UI-automation-specific, just first built for it. See
docs/specs/SPEC_AGENT_PANE_LIFECYCLE_CONTROL_2026_09_10.md §5.0.
Identity M4a-2: caller is the request’s Caller;
auth.agent_id is counted against it (m4.actor_*.ui_auth), never refused
on it — M4d moves this check onto Caller (spec §6.5.4).