Skip to content

fix(api): save the charging schedule without a second passkey - #1228

Open
frahlg wants to merge 1 commit into
masterfrom
71-schedule-no-stepup
Open

frahlg wants to merge 1 commit into
masterfrom
71-schedule-no-stepup

Conversation

@frahlg

@frahlg frahlg commented Sep 13, 2026

Copy link
Copy Markdown
Member

Why

srcfl/ftw-webapp#71: a signed-in owner changing the car's ready time was asked for Face ID again. Login already proved who is asking. That extra ceremony is the wrong cost for a household setting.

The box is the authority. The app cannot skip the prompt until this route accepts the write without a fresh step-up.

What

Schedule PUT and DELETE stay Configure (a late save is the same instruction). They are marked NoStepUp: owner is enough, no ceremony.

A write accepted this way does not open the step-up window. Saving a ready time must not let a later pairing or config write through.

Minting access, replacing the whole config, and moving energy still need a ceremony or a cmd.

Pair

App change: srcfl/ftw-webapp#72

Tests

  • Owner saves and clears a schedule through the passthrough with no stepUp; the box stores and clears it.
  • Viewer is still E_SCOPE_DENIED.
  • Unmarked configure is still refused without a ceremony.
  • A NoStepUp write does not open the step-up window for a later unmarked configure.

go test ./internal/appproto/ ./internal/api/ -count=1

A signed-in owner can change the car's ready time without Face ID.
Login still uses a passkey. Configure routes stay owner-gated; this
one is marked NoStepUp so the ceremony is skipped and the step-up
window is not opened.

Pairs with srcfl/ftw-webapp#71.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T10:42:14.470759Z abc0b0a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Box-side half of the pair with ftw-webapp#72: adds a NoStepUp route mark, applies it to the two charging-schedule routes (PUT/DELETE .../schedule), and skips the step-up ceremony for them while keeping the owner role check.

Security screen (authz change — same note as on the webapp PR, not blocking): this is the careful version of that change. TestANoStepUpWriteDoesNotOpenTheWindow specifically proves the thing I'd have flagged if it were missing — a NoStepUp write does not open the step-up grace window for a later, still-ceremony-required configure call on the same session (e.g. app-link pairing). Role enforcement is unchanged and covered (TestAViewerCannotSaveASchedule, TestANoStepUpConfigureStillNeedsTheOwner). TestEveryMarkedRouteIsReachable extended to assert NoStepUp resolves correctly per route, so the mark can't silently drift from the routing table.

  • Scope is narrow and explicit — only the two schedule routes, not a tier-wide default.
  • Rationale is documented in docs/architecture.md next to the existing step-up threat model, not just in the changeset.

No correctness issues, and the one security-relevant behavior change is both deliberate and defended by a test built specifically to catch the failure mode that would matter. Safe to merge from my read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants