Repository navigation
feat(core): sign in to a company server and verify its license - #4470
Merged
Merged
Conversation
…pany-server # Conflicts: # core/docs/decisions/README.md
…r's 429 to itself
…e key exchange's 429
…ck origin before claims
datlechin
enabled auto-merge (squash)
November 24, 2026 06:12
This was referenced Nov 24, 2026
datlechin
disabled auto-merge
November 24, 2026 08:45
…pany-server # Conflicts: # core/docs/decisions/README.md
…ile the Linux packages test with
…sign-ins in process (#4473)
datlechin
enabled auto-merge (squash)
November 24, 2026 19:19
…pany-server # Conflicts: # core/crates/ffi/src/core_handle.rs # scripts/ci/detect-changed-paths.sh # scripts/ci/test_detect_changed_paths.py # windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tablepro-accountresolves the server: an OS-managed URL that allows no other, else the person's choice, else the managed default, else tablepro.app. Https only; http to a loopback host in development builds. The choice lives inaccount-server.jsonbesideaccount.json.resourcemust be the origin) and OIDC discovery (issuermust match, never tablepro.app's) when a run first needs it and at each sign-in; never kept on disk. OAuth endpoints on the issuer's origin,jwks_urion the API's; no redirects; every answer read before the license verifies is capped.GET /v2/licenseverified offline against the compiled release license keys (currentYo4CIBJnxzUMSLPnsLId8ngVVe5xuZgHkOU9Z-Hgo04, nextJ5yCP_8iTKHyXvyYQ9y4-D2-Z_U4hbtGDvwkfzv57R0) in tablepro-cloud's check order, withgrace_until(ADR 0046). Entitlements verify only with the JWKS the license admits,issthe API origin, features cut to the license; pastgrace_untilonlyteam_libraryworks. Nothing else of a company server's API is read before its license verifies.account.json, bound to the sign-in by an HMAC keyed with the refresh token; a new license applies to the held entitlement at once.audis not the company API are refused.issis checked, tablepro.app's too.issin the authorization response is compared when present (not yet required: tablepro-cloud does not send it).AppClient::MACOSsigns in through a newHostWebAuthenticator(custom scheme, state check, cancel, superseded attempts revoked;cancel()closes the host's session when the core stops waiting); the host passes its own 64-hex machine ID; one refresh token item per server (SecretItemTag::AccountRefreshTokenFor, tablepro.app keepsAccountRefreshToken); RFC 8693 license-key exchange (never sent to a company server); the Mac's Keychain sign-in andAccount/entitlement.jwtare adopted whileaccount.jsonis missing, an offline file imported without sign-in stays an offline file.AccountConfiggainsclient,machine_id,managed_server_url,allow_other_servers,legacy_entitlement_file,license_keys;account_url,api_url,entitlement_keysandlicense_keysare refused in release builds. Newserver(),choose_server,access_token,access_token_rejected,use_license_key,import_offline_file,license(), andAccountListener::signed_out(cause).ServerSettings::Fixedis one server for good (Linux's tablepro.app, a development stack);Account::new, with one refresh token item, takes only a fixed server.SecretItembecomes a record with the sign-in key. Linux passesServerSettingsand words the new errors./v2document and license vectors copied from tablepro-cloud main (after TableProApp/cloud#30);update-cloud-api.shnow copies the license vectors too.Tests changed on purpose:
core/crates/ffi/tests/account.rs: a development stack's entitlements name its API origin asiss, and its refresh token is kept underAccountRefreshTokenFor.windows/tests/TablePro.Interop.Tests/AccountTests.cs:AKeptSignInAsksTheHostForTheRefreshTokenItembecomesAKeptSignInAsksTheHostForItsServersRefreshTokenItem, and the share test stores the token under the stack's keyed item.core/crates/ffi/src/host.rs,the_account_s_refresh_token_is_an_item_of_its_own: goes through the per-server vault.core/crates/ffi/tests/account.rs: builds only with debug assertions, since a release core refuses the local stack every test signs in to.Test plan
tablepro-account(167, debug and--releaseas the Linux packages run it): resolution precedence, origin parsing, discovery mismatches, every license vector and grace boundary, JWKS cut andissmismatch, company sign-in and restore, substituted keys and kept discovery ignored, license downgrades, issuer and audience binding, 429 and lifetime caps, cancel during discovery, web-authenticator sign-in, license-key exchange, legacy adoption, server change.tablepro-ffi: release build refuses the overrides, Mac config, per-server items, web session round trip.TableProFFISwift tests on a release core; WindowsTablePro.Interop.Tests; Linux account and FFI tests and lint in the Linux container.