Repository navigation
feat(policy): apply the ADR 0055 managed policy keys on the Mac and in the core - #4497
Merged
Merged
Conversation
datlechin
enabled auto-merge (squash)
November 25, 2026 10:27
datlechin
added a commit
that referenced
this pull request
Nov 25, 2026
iOS passes its managed values to the core as AccountConfig.policy, hands later ones to apply_policy, and takes iCloud's standing from the core's provider rule, as the Mac does.
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
Core:
tablepro-accountgainsManagedPolicy(read values, or a refused source) with the ADR 0055 rules:PersonalSyncProviderchoices andsettle(one entry forces, several allow, a server'spersonalSyncnever starts another provider), the boolean keys, and the held-to-company-server case.ServerPolicycarries the launch values.Account::apply_policytakes later readings at once; when they no longer allow the server in use, every call to it stops until the next launch, rechecked after each wait (discovery, browser callback, token refresh, device pages, the session lock) and before an upload.report_stopputsaccount.server_managedin the status.fetch_sharedis refused withaccount.server_managedbefore any request whileAllowOtherAccountServers=falseholds the app to a company server.ModelCatalog::allow_refreshskips the AI catalog refresh; the kept or bundled copy serves. The FFI keeps the core's catalog in step before it touches the account.AccountConfig.policyreplacesmanaged_server_urlandallow_other_servers; addsapply_policy,allows_tablepro_requests,personal_sync_choices,settled_sync_provider. Windows bindings regenerated; Windows still passes no values.Mac:
ManagedPolicyreadsPersonalSyncProvider(plist array),UsageDataAllowed,PluginCatalogAllowedandICloudSyncAllowed, forced values only. A value of another type, a non-string list entry and an unknown Safe Mode floor are ignored and logged once.ManagedPolicyCenterreads again when macOS writes/Library/Managed Preferences, andAccountServicespasses every reading to the core in order.CloudKitSyncEnginechecks cancellation before each batch and retry. The switch shows "Managed by your organization".UsageDataAllowed=falseturns usage data off and locks the switch.PluginCatalogAllowed=falsefetches no manifest, drops a kept one, refuses every registry download (retries and update passes included), and a registry driver not installed says the organization manages plugins.SyncCoordinatorextension files, keeping the coordinator under SwiftLint's type length.Test plan
policy::tests, includinga_server_without_personal_sync_never_moves_a_device_to_icloudanda_refused_source_withholds_everything_a_key_can;values_that_stop_allowing_the_server_stop_every_call_until_the_next_launch;values_that_arrive_during_a_token_refresh_keep_its_token_from_any_request;a_held_company_server_stops_share_reads_and_uploads_before_any_request;a_refresh_that_is_not_allowed_asks_nothing_and_the_kept_copy_serves; FFI tests.cargo test -p tablepro-account -p tablepro-ai -p tablepro-ffiand clippy pass.ManagedPolicyReaderTests(a value a person writes for a managed key is not policy, wrong types),SyncProviderPolicyTests,SyncCoordinatorPolicyTests,AppSettingsSyncSideEffectsTests,SyncPaneLayoutTests,AccountServicesTests,SharedLinkOpenerTests,AIModelReferenceTests,DriverUnavailabilityTests,PluginInstallerHelpersTests,KeychainItemScopeTests,TelemetryTests,TableProFFITests.