Skip to content

feat(core): re-vendor /v2 with sync and key operations, and RFC 9470 step-up in the account client - #4616

Merged
datlechin merged 9 commits into
mainfrom
feat/core-cloud-api-v2-step-up
Nov 26, 2026
Merged

datlechin merged 9 commits into
mainfrom
feat/core-cloud-api-v2-step-up

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Re-vendors the /v2 document from tablepro-cloud integ/server at 9b86ad9d with core/scripts/update-cloud-api.sh: the /v2/sync scopes, pull, push, key-device and stop operations, and the DPoP header on DELETE /v2/devices/{id}.
  • cloud-api: poll_sync_scopes sends If-None-Match and reads a 304 as NotModified; a 304 to a poll that named no ETag is refused.
  • cloud-api: a 401 with RFC 9470's insufficient_user_authentication challenge is ApiError::StepUpRequired { acr_values, max_age_secs }, and one with RFC 9449's use_dpop_nonce is ApiError::UseDpopNonce { nonce }.
  • cloud-api: the WWW-Authenticate parser follows RFC 9110's challenge grammar; a repeated parameter or a max_age that is not whole seconds asks for nothing.
  • account: Account::step_up opens the authorization endpoint as sign-in does (ADR 0047's browser or web authenticator) with acr_values, max_age and PKCE.
  • account: the step-up's tokens are taken only for the same account (sub), API (aud, company servers) and sign-in session; otherwise they are revoked.
  • account: taken tokens replace the old family, which is revoked; the device registers again (200 for its machine) and the token is refreshed before the retry (ADR 0051, Step-up; api.md, OAuth).
  • account: Account::stepped_up runs a call, steps up once on its challenge and runs it again; a second challenge goes back to the caller.
  • account: new codes account.step_up_required and account.step_up_other_account.
  • account: a device registration keeps the held entitlement in account.json.
  • account: a refused revocation keeps only a standard OAuth error code, never the response body, which callers log.
  • FFI, additive: StepUpChallengeInfo, AccountService::step_up(challenge, cancel), and ErrorInfo.step_up on account.step_up_required. A host passes SyncFailureInfo::StepUp from sync.step_up_required the same way.
  • Windows bindings regenerated. The Linux app words the two new errors.

Test plan

  • cloud-api: challenge parsing, the 401 mappings, and a fake server for the scopes poll (304 on the current ETag, the body otherwise, a 304 without If-None-Match refused).
  • account, against a fake tablepro-cloud: each challenge form; the Mac web authenticator and the Linux loopback browser; a second challenge; another account; a closed browser; a sign-out or an earlier sign-in committing during the step-up; signed out; a company server's issuer found again and its tokens for another API refused; a refused revocation that echoes the token.
  • ffi: the step-up error carries its challenge into ErrorInfo.
  • Local PASS on the merged head: verify.sh --platform windows --jobs 4 bindings, build, test (2507 tests); core (tablepro-ffi, 385 tests) before the merge of main.
  • Local PASS: cargo test and clippy for tablepro-cloud-api and tablepro-account.
  • Local PASS on the merged head: verify.sh --jobs 4 package TableProFFI (9 tests).
  • Local PASS: verify.sh --platform linux lint (rustfmt, clippy with and without default features), and test tablepro error_text::account (16 tests) on the merged head, in the dev container.
  • Codex: two review rounds and a security pass, each finding fixed here; a third review found nothing.

@datlechin
datlechin merged commit 971456a into main Nov 26, 2026
32 of 34 checks passed
@datlechin
datlechin deleted the feat/core-cloud-api-v2-step-up branch November 27, 2026 16:36
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.

1 participant