Repository navigation
feat(web): managed-mode connection policy foundation (#1273) - #1278
Asymtode712 wants to merge 8 commits into
Conversation
|
@debba please check this implemention plan, also: Open questions for review
|
|
My thoughts on the open questions:
|
|
@debba can you please share your thoughts on this, so that I can start with the implementation |
|
@Asymtode712 @NewtTheWolf thanks for laying this out. I agree with Newt's suggestions. For groups, tags and appearance, I'd keep branding controls separate from connection organization. Editing shared settings should be disabled by default in managed mode and configurable by the operator. If groups and tags are personal preferences visible only to the current user, I'm happy to allow those. Let's make their scope and storage explicit. I also agree with using both an instance-level policy and a per-connection A dedicated error code for policy denials makes sense too, so the frontend can show a translated message reliably. One more thing I'd like us to clarify before implementation: who can see and use each managed connection? Preventing edits and hiding credentials doesn't by itself define which users can access which databases. If the initial scope is that all authorized browser users can use all managed connections, let's state that explicitly; otherwise, we need to define the access rules. With those points clarified, I'm happy with this direction. |
|
@debba Thanks, this is useful. I've updated the plan for each point. 1. Branding vs. organization (appearance, groups, tags)
2. Policy modes
3. Denial error code
4. Who can use which connection
Updated rollout
If this matches what you had in mind, I'll start on step 1. |
|
Thanks for spelling out the access scope and shared settings. This matches the direction I had in mind. Please go ahead with step 1: standalone by default, managed-only as the opt-in mode, separate branding and organization switches defaulting to denied, and the persisted managed marker. In managed-only mode, the instance policy must protect every connection even if its marker is missing or false. Please make that case explicit in the policy tests. The marker can support a later mixed mode; we can review that mode separately when it is implemented. All authenticated users sharing the instance's managed connections, with separate instances for separate groups, is clear for this first scope. Please keep that limitation prominent in the docs. No need to wait for another design round before starting step 1. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Notes
Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit f49c99f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f49c99f)Status: 1 Issue Found | Recommendation: Merge (optional cleanup) Overview
Issue Details (click to expand)SUGGESTION
Notes
Fix these issues in Kilo Cloud Files Reviewed (8 files)
Previous review (commit 7f00f11)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
SUGGESTION
Notes
Fix these issues in Kilo Cloud Files Reviewed (33 files)
Reviewed by claude-sonnet-5.5 · Input: 246 · Output: 1.5K · Cached: 173.2K Review guidance: REVIEW.md from base branch |
|
@NewtTheWolf @debba Step 1 of #1273: the policy type, instance config, persisted marker and default-off tests. Nothing is enforced yet; later steps add backend denials, redaction, session capabilities and the frontend.
Tests cover the standalone default, managed-only with marker false and with no stored marker, the independent switches, the denial code, marker serialization and the CLI defaults. Not in this step: backend denials, credential redaction, capabilities in session negotiation, frontend handling, the provisioning API (#1274) and mixed mode. Three steps remain.
|
NewtTheWolf
left a comment
There was a problem hiding this comment.
Reviewed c548b1a76cb7582f413b3b31529cb035270fe7d5 as the agreed step-1 foundation. The standalone default, marker-independent managed-only policy, independent branding/organization switches, stable denial code and persisted marker match that limited scope. The production build, server-only check, documentation checks, typecheck and lint pass. The full Rust library suite passes serially (2,531 passed, 19 ignored); the default parallel run failed when registry reconciliation encountered readonly-export-* fixtures, so I am not calling that run green.
Non-blocking follow-ups for the manual check:
- Update the PR title and opening summary to describe the policy foundation now implemented. The current title still says this is only a planning document.
- Make
--connection-modehelp explicitly say that enforcement is not active yet, as the new guide already does. That limitation should be visible where an operator discovers the flag. - The ordinary Tabularis JSON import path currently preserves an incoming
managed: truethroughtabularis::apply/apply_export_payload. Foreign-app conversion defaults it to false. Please correct the blanket "import writes false" claim; the planned step-2 forgery/provenance checks must cover both native import paths as well.
This approval covers the foundation only. Backend denials, credential redaction, session capabilities and frontend restrictions are deliberately absent and have not been verified as implemented. Leaving this open for the manual CLI/documentation check before merge.
Goal
An opt-in managed mode for Tabularis Web where administrators supply the connections. Browser users can query within the database account's privileges, but cannot change destinations, create or remove connections, or obtain credentials. The mode is off by default and leaves standalone Web and desktop behaviour unchanged.
Where this builds on existing code
AuthorizationLeveland the checks intransport/web/rpc_connection_policy.rsalready limit what a remote session can do. Managed mode extends that approach rather than adding a parallel mechanism.ConnectionCommandandConnectionFilesCommandinapplication/.SessionNegotiationintransport/web/contract.rsalready tells the frontend what the session can do.Policy modes
standalone(default): today's behaviour. Every check passes.managed-only: every connection on the instance is managed.managedmarker (provisioned connections carry it), so mixed mode later only changes how the instance default is applied. It needs no new storage or checks.Shared policy boundary with #1274
ManagedConnectionPolicylives insrc-tauri/src/application/. It is built once at web startup, and instandalonemode every check passes.Who can use which connection
What browser sessions can do in managed mode
Allowed: open managed connections, browse metadata, run queries within the account's privileges, and per-session state such as selected databases.
Denied (enforced in the backend, never only in the UI):
save_connection,update_connection,delete_connection,duplicate_connection.test_connectionandlist_databaseswith caller-supplied params.apply_connection_import,apply_prepared_tabularis_import,export_connections_file.connectionId.Branding and organization:
Credential exposure
Denial error code
Policy denials return a stable machine-readable code (for example
managed_connection_denied). The frontend maps it to a translated message in every locale, and tests assert the code, not the text.Frontend
Session negotiation gains a managed flag and the effective connection-management permissions. The UI hides unavailable actions and explains that the connections are externally managed. It only presents. The backend enforces. New strings go into every locale under
packages/web-ui/src/i18n/locales/.Test plan
standaloneandmanaged-onlymodes, and with the branding and organization switches on and off. A guard test fails if a new connection command has no policy entry.connectionId, import payloads that smuggle in a connection, and a client-forged managed flag.cargo check --no-default-featuresand the repository checks stay clean.Rollout
standalone/managed-only), per-connectionmanagedmarker, the branding and organization switches (default denied), confirmation of where groups, tags and appearance are stored, and default-off tests.Out of scope
Per-user grants, multi-tenant isolation, personal (per-user) groups and tags, mixed mode, network restrictions and database privileges. The last two remain deployment responsibilities.