Skip to content

refactor(apps): move the app UI asset gate, frame tokens and call authorization into the Rust core #668

Backlog

Description

@RentnerKev

Context

Security-critical code belongs in the Rust core. Today the app UI boundary is split: the Rust app manager validates app requests and responses against the UI package (core/src/app_manager/ui/package.rs) and serves assets, while the Bun web process seals frame and asset tokens (web/src/server/AppRuntime/ui/assets.server.ts), authorizes every asset and call (ui/access.server.ts), filters results (filterAppUiResult) and answers the lease hairpin. Each request crosses between both several times.

Proposal

Move the boundary into the core in steps, each shippable on its own:

  1. Lease cache in the app manager (perf(apps): cache generation leases in the app manager #657) and key handling with purpose keys (perf(auth): load the encryption key once and derive purpose keys #658).
  2. Frame and asset token sealing and opening in Rust.
  3. Asset serving answered by the core without a web round trip per file.
  4. Call authorization (pre and post checks), result filtering and idempotency key scoping in Rust, next to the existing schema validation.
  5. Install-time validation of the x-rentnerproxy-extensions document in core/src/app_install/package.rs with the shared Rust validator from the SDK, so the web layer no longer drops invalid entries silently.

What stays in TypeScript: the remote tree, forms, frame pool and all rendering. They run in the browser, and remote mutations never reach the server.

Decision (2026-12-01)

The core reads sessions and grants directly from the database on each request, without a cache. A cache follows only if measurements call for it; the lease cache (#657) already removes most of the load.


Found in the app platform audit of 2026-11-30.

Activity

  1. added
    enhancement
    rust
    area: runtime
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: runtimeenhancementrust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions