Skip to content

feat(apps): offer protocol 1.2.0 and send the user's permission keys to app UIs - #620

Merged
RentnerKev merged 2 commits into
mainfrom
rentner/feat/ui-context-permissions
Nov 29, 2026
Merged

RentnerKev merged 2 commits into
mainfrom
rentner/feat/ui-context-permissions

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

The platform half of App SDK 1.5.0 (RentnerProxy/app-sdk#12): protocol 1.2.0, in which the UI bridge context message carries permissionKeys, the app's permission keys that the current user holds. An app UI in its sandboxed iframe can then show a read-only view instead of a form whose save fails with 403.

Offer 1.2.0

  • The SDK crates rentnerproxy-app-catalog, -app-contracts, -app-pipeline and -artifacts move to 1.5.0 (lockfile through cargo update -p). The platform does not use the npm package.
  • PROTOCOL_VERSION in core/src/app_install.rs and APP_RUNTIME_ENVIRONMENT in web/src/config/app-requirements.config.ts offer 1.2.0. app_ipc takes the version from the contracts crate.
  • Negotiation is unchanged: each app gets the lower bound of its requires range, at most the offer. Apps that require >=1.0.0 or >=1.1.0 keep exactly 1.0.0 or 1.1.0, including the app template and the appliance fixture, which stay as they are.

Send the keys

  • Where the bridge version comes from: AppUiSummary gains uiBridgeVersion. listAuthorizedAppUis reads it through readAppUiPrincipalInTransaction, from the generation row of exactly the summary's installationId and generation, in the same transaction that resolves the user's keys. A row without a stored version counts as 1.0.0 (effectiveUiBridgeVersion).
    • The frame session already takes its binding (installId, installationGeneration) and its route and dialog checks from this summary object, so the binding, the keys and the bridge version always describe one generation.
    • AppUiFrame remounts with a new open and a new binding whenever the summary's generation changes, and the open call refuses any other generation (staleGeneration). A generation's bridge version never changes, because a registration replay must match it.
    • Putting the version into the frame open result would give a second source that must agree with the summary's keys and binding. The native UI, which uses the open result, stays unchanged.
  • Who gets the member: bindAppUiFrame compares the version numerically (major.minor.patch; an invalid version never qualifies).
    • From 1.2.0 the context message always includes permissionKeys, an empty array when the user holds none.
    • Bridges 1.0.0 and 1.1.0 never receive it, because their strict validators reject unknown members.
    • bridgeVersion in runtime:bootstrap stays the literal 1.0.0.
  • The keys: the summary lists the manifest keys the user holds, without the app ID, unique and in ASCII order (toSorted(), not localeCompare). The session deduplicates and sorts once more when it builds the message.
  • Updates: an open frame sends the context again when the 30-second inventory poll returns other keys, compared by content. The same keys send nothing.
  • The keys are informational. x-rentnerproxy-access enforcement stays authoritative, and native mode (x-rentnerproxy-native-ui) is not affected.

No schema change: ui_bridge_version exists since #619.

Related issue

N/A: platform adoption of RentnerProxy/app-sdk#12 (App SDK 1.5.0).

Type of change

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • CI / tooling
  • Dependency update
  • Other

Testing

Web

  • web/src/tests/lib/AppUi/bridge.test.ts:
    • Bridges 1.2.0, 1.2.1 and 1.10.0 receive sorted, unique keys (a-b, a0, read, write) and an empty array. 1.10.0 is there because a string comparison would put it before 1.2.0.
    • Bridges 1.1.0, 1.0.0 (what a NULL row reports) and an invalid version never receive the member.
    • A key change re-sends the context. The bootstrap keeps bridgeVersion: '1.0.0'.
    • The existing session test now offers keys to a 1.0.0 app and still expects a context without them.
  • web/src/tests/features/AppUi/app-ui-frame.test.tsx: an inventory update with other keys re-sends the context into the same frame, the same keys in a new array send nothing, and an empty list is sent as [].
  • web/src/tests/server/AppRuntime/ui-summaries.test.ts (new): the summary reports each generation's bridge version and only the held keys, unqualified, deduplicated and in ASCII order.
  • web/src/tests/server/AppRuntime/authority.db.test.ts: the UI principal reports 1.0.0 for a registration without versions and for a NULL row, and 1.2.0 when stored.

Core

  • install_advertises_protocol_1_2_0_to_apps_that_require_it and apps_negotiate_the_lower_bound_of_each_manifest_range: >=1.2.0 gets 1.2.0, >=1.1.0 stays 1.1.0, >=1.3.0 is refused.
  • ui_apps_negotiate_the_lower_bound_of_their_bridge_range (new): the same for requires.uiBridge.
  • The app_ipc launch range, admission, readiness and provider tests use 1.2.0 as the offer. The values that stood for "above the offer" (1.2.0 in readiness, >=1.2.0 in the privileged launch test) are now 1.3.0.

Commands

  • bun --no-env-file run typecheck: passes.
  • bun --no-env-file run lint: passes, including type-aware rules.
  • bun --no-env-file run test:ts on Windows: every suite for the changed areas passes (AppUi, AppRuntime, AppCatalog, application shell, release requirements). Two kinds of failures are unrelated to this change, and CI runs these suites on Linux:
    • Five tooling suites fail only on Windows: tar cannot handle C: paths, and POSIX file modes differ. The suites are validate-backup.coverage, beta2-orchestration, dependency-image-scope, release-compatibility-probes and backup/app-state, and none of them imports changed code.
    • oidc-connections-ui failed once on timing and passes on reruns.
  • Database tests for the app runtime and legacy handoff against a disposable PostgreSQL 18.7 in Kiri after bun run db:migrate: pass. host-operations.db.test.ts was skipped locally because it requires the CI database name.
  • In a disposable rust:1.99.1-bookworm container on Kiri, as a non-root user:
    • cargo clippy --locked --manifest-path core/Cargo.toml --all-targets --all-features -- -D warnings: clean.
    • cargo test --locked --manifest-path core/Cargo.toml --all-features: 1152 passed.
    • cargo test --doc: passes.
  • As root in the same container: the privileged app_ipc::tests::privileged_ tests (2 passed) and the root UI and provider tests (12 passed).

Checklist

  • I tested the relevant functionality.
  • Existing tests pass.
  • I added or updated tests where appropriate.
  • This PR does not include secrets, credentials, production data, or private certificates/keys.
  • I updated documentation where necessary.
  • I linked the relevant issue for a feature or fix, or explained why no issue is needed.

Breaking changes

None. Apps on UI bridge 1.0.0 or 1.1.0 see exactly the previous context. The core and the web must ship together, as before.

Screenshots

None.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • App UI frames now receive the user’s authorized permission keys, with updates reflected as permissions change. Keys are deduplicated and sorted.
  • Compatibility
    • Updated the platform, app protocol, and UI bridge compatibility version to 1.2.0. Apps using older bridge versions continue to receive context without permission keys.

RentnerKev and others added 2 commits November 29, 2026 01:17
…to app UIs

Raise the SDK crates to 1.5.0 and offer protocol 1.2.0 in the core and the
release requirements. Apps negotiate the lower bound of each requires range,
so apps that require >=1.0.0 or >=1.1.0 keep exactly that version.

The UI bridge context now carries permissionKeys for apps whose negotiated
uiBridge is 1.2.0 or newer, and never for older bridges, whose strict
validators reject unknown members:

- The app UI summary reports the bridge version of its generation, read from
  the same generation row as the user's keys (NULL counts as 1.0.0), and its
  permission keys unqualified, unique and in ASCII order.
- The frame session compares versions numerically and always includes the
  keys for 1.2.0 bridges, an empty array when the user holds none.
- An open frame sends the context again when the inventory poll returns other
  keys. bridgeVersion in runtime:bootstrap stays 1.0.0, native UIs are
  unchanged and x-rentnerproxy-access stays authoritative.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The platform API, app protocol, and UI bridge versions are updated to 1.2.0. App UI summaries now include the generation’s bridge version and authorized permission keys. The bridge sends permission keys to compatible apps and updates them when the keys change.

Changes: UI Bridge Context

Layer / File(s) Summary
Protocol 1.2.0 compatibility
core/Cargo.toml, core/src/app_install.rs, web/src/config/app-requirements.config.ts, core/tests/private/*
Core and web runtime requirements now use version 1.2.0. Core compatibility tests cover installation negotiation, launch ranges, and readiness at that version.
Runtime summaries with bridge version and permissions
web/src/lib/AppUi/contract.ts, web/src/server/AppRuntime/authority.server.ts, web/src/server/AppRuntime/ui/access.server.ts, web/src/tests/server/AppRuntime/*, web/src/tests/features/AppCatalog/catalog-install-ui.test.tsx, web/src/tests/features/AppUi/native-app-ui.test.tsx, web/src/tests/layouts/AuthenticatedLayout/Components/ApplicationShell/application-shell.test.tsx
UI summaries include the generation’s effective bridge version and the user’s authorized permission keys, deduplicated and sorted in ASCII order. Tests and fixtures cover bridge-version defaults and summary contents.
Bridge context delivery and updates
web/src/lib/AppUi/session.ts, web/src/features/AppUi/AppUiFrame.tsx, web/src/tests/features/AppUi/app-ui-frame.test.tsx, web/src/tests/fixtures/app-runtime-reference/greeting-host.ts, web/src/tests/lib/AppUi/bridge.test.ts
The bridge sends deduplicated, sorted permission keys for versions at least 1.2.0. The app UI frame sends context updates when permission keys change, including an empty list.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant AppUiAuthority
  participant AppUiSummary
  participant AppUiFrame
  participant AppUiBridge
  participant UIApp
  AppUiAuthority->>AppUiSummary: provide bridge version and held permissions
  AppUiSummary->>AppUiFrame: provide UI summary
  AppUiFrame->>AppUiBridge: connect and update context
  AppUiBridge->>UIApp: send permission keys for bridge version 1.2.0 or newer
Loading

Possibly related PRs

  • RentnerProxy/platform#619: Adds per-installation protocol version negotiation and per-generation version storage used by this change.
Merge Risk: Minimal · up to 0119d · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(apps): offer protocol 1.2.0 and send the user's permission keys to app UIs" matches the main changes in the changeset. The diff raises the offered protocol and UI bridge version to 1.2…
Description check Passed The description follows the template. It has a Summary, a Related issue section with a reasoned N/A, a Type of change list with items checked, a detailed Testing section with commands and results, a c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(apps): offer protocol 1.2.0 and send the user's permission keys to app UIs" matches the main changes in the changeset. The diff raises the offered protocol and UI bridge version to 1.2.0 in core and web, and adds permissionKeys to the app UI context message. The title is specific and concise. It omits the SDK crate bumps and the negotiation tests, which is acceptable.

Full details: Description check

Explanation

The description follows the template. It has a Summary, a Related issue section with a reasoned N/A, a Type of change list with items checked, a detailed Testing section with commands and results, a completed Checklist, a Breaking changes section, and a Screenshots section marked None. The Summary explains what changed and why. The Testing section is thorough and documents the commands run, the results, and the reasons for any failures.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7f38695 and 0119d7a.

Files ignored due to path filters: 1

  • core/Cargo.lock is excluded by !**/*.lock, !**/*.lock
Files selected for processing: 18

  • core/Cargo.toml
  • core/src/app_install.rs
  • core/tests/private/app_install.rs
  • core/tests/private/app_ipc.rs
  • web/src/config/app-requirements.config.ts
  • web/src/features/AppUi/AppUiFrame.tsx
  • web/src/lib/AppUi/contract.ts
  • web/src/lib/AppUi/session.ts
  • web/src/server/AppRuntime/authority.server.ts
  • web/src/server/AppRuntime/ui/access.server.ts
  • web/src/tests/features/AppCatalog/catalog-install-ui.test.tsx
  • web/src/tests/features/AppUi/app-ui-frame.test.tsx
  • web/src/tests/features/AppUi/native-app-ui.test.tsx
  • web/src/tests/fixtures/app-runtime-reference/greeting-host.ts
  • web/src/tests/layouts/AuthenticatedLayout/Components/ApplicationShell/application-shell.test.tsx
  • web/src/tests/lib/AppUi/bridge.test.ts
  • web/src/tests/server/AppRuntime/authority.db.test.ts
  • web/src/tests/server/AppRuntime/ui-summaries.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcargo/​rentnerproxy-app-contracts@​1.4.1 ⏵ 1.5.091 +1100100100100
Addedcargo/​rentnerproxy-artifacts@​1.5.010010093100100
Updatedcargo/​rentnerproxy-app-catalog@​1.0.0 ⏵ 1.5.010010093100100
Updatedcargo/​rentnerproxy-app-pipeline@​1.0.0 ⏵ 1.5.09910093100100

View full report

@RentnerKev
RentnerKev merged commit 4599982 into main Nov 29, 2026
50 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/ui-context-permissions branch November 29, 2026 00:47
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