Skip to content

feat(apps): review requested access before installing or updating - #600

Merged
RentnerKev merged 2 commits into
mainfrom
rentner/feat/review-app-grants
Nov 27, 2026
Merged

RentnerKev merged 2 commits into
mainfrom
rentner/feat/review-app-grants

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

PR 3 of 3 for #590. Owners can now review and approve the access a release requests in the app catalog, see the access each installed app holds, and revoke it. PR 1 (#596) added the decision path in the Rust core; this PR adds the UI and the distinct receipt for a revocation that stopped the app.

Approval dialog (GrantApprovalDialog, useGrantApprovalLogic, pure builder lib/AppCatalog/grantApproval.ts)

  • Opens before an install of a release with grants, before an update whose requested grants the current approval does not cover, and before a reinstall of a release with grants.
  • Lists capabilities and platform support grants separately, each with its scope.
    • Selectable scopes (proxy hosts) need at least one host (GrantHostPicker, searchable multi-select).
    • Background access (allowService) can only be narrowed.
    • A permission key can be required when the release declares keys.
  • Updates and reinstalls preselect the installation's current or retained approval, so only new items need a decision. A preselected host that no longer exists is neither shown nor approved.
  • The request carries exactly the approved grants. Declining sends nothing.

Installed apps

  • An update that needs approval shows a notice and a "Review update to X" button instead of being hidden.
  • "Approved access" lists each recorded grant with the host name, and offers Revoke with a confirmation.
  • The temporary UI lock from PR 1 is gone: grantsRequired now only means access this appliance cannot grant, and its texts say so.

Proxy hosts for the picker

  • New Owner-only server function getAppCatalogProxyHostsHandler, backed by server/AppRuntime/catalog/hosts.server.ts: at most 1,000 hosts with at least one domain, named by their first domain, with their enabled state. Admins and viewers get forbidden.

Distinct revoke receipt (Rust)

  • When the live generation cannot apply a revocation and the manager fenced it completely, the receipt now reads revokedAppStopped instead of unavailable. The UI explains that access was revoked, the app was stopped, and activation can be retried with the remaining access.
  • If a fence step fails too, the receipt keeps reporting the underlying error, as before.

Locales

  • appCatalog.grants.* and the new management texts in all eight locales.

Related issue

Closes #590 (PR 3 of 3, after #596 and #599).
Refs RentnerProxy/app-monitoring#1

Type of change

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

Testing

  • Web:
    • bun run typecheck and bun run lint are clean; the changed files are formatted.
    • Catalog lib, catalog UI and i18n tests: 38 passed. New tests:
      • grant-approval.test.ts: the builder needs a selected host, builds exactly the requested approval, only narrows background access, names declared keys only, preselects a previous approval, caps at 128 grants, and builds the revoke request.
      • catalog-install-ui.test.tsx: Install opens the dialog, Approve stays disabled until a host is picked, Decline sends nothing, and the body carries exactly the approval. An update that needs approval shows the notice and "Review update", preselects the approved host and posts the approval. Approved access lists host names, Revoke asks for confirmation and posts one grant, and revokedAppStopped shows its explanation.
    • catalog-hosts.db.test.ts on PostgreSQL 18.7 in Kiri: hosts are named by their first domain, keep their enabled state, and a host without a domain is not offered.
    • Full test:ts on Windows: 2265 passed, 52 failed, all in eight tests/tooling files (Docker, release and backup scripts). Run on their own, those files fail the same 41 tests on main and on this branch; the other 11 timed out under the load of the full run. CI runs them on Linux.
  • Rust, in Kiri (Rust 1.99.1):
    • cargo fmt --check and cargo clippy --locked --all-targets --all-features -- -D warnings are clean; cargo test --all-features: 1123 passed, 26 ignored. The fail_closed unit test checks that only a complete fence yields revokedAppStopped.
    • Privileged privileged_signed_lifecycle passed; its fail-closed revoke now expects revokedAppStopped.

Checklist

  • I tested the relevant functionality.
  • Existing tests pass. (CI pending)
  • 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. Not needed.
  • I linked the relevant issue for a feature or fix, or explained why no issue is needed.

Breaking changes

None. A fail-closed revocation reports revokedAppStopped instead of unavailable; the web contract accepts the new code.

🤖 Generated with Claude Code

Owners now approve exactly the grants a release requests in the app
catalog before it installs, updates or reinstalls. The dialog lists
capabilities and support grants with their scope, requires at least one
proxy host for host-scoped capabilities, only narrows background access
and can require a declared app permission. Updates and reinstalls
preselect the current approval.

Installed apps show an update that needs approval, list their approved
access with host names, and revoke single grants after a confirmation.
An Owner-only server function lists the proxy hosts for the picker.

A revocation the live generation cannot apply, which the manager fenced
completely, now reports revokedAppStopped instead of unavailable.

Closes #590

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b250842 and 498783c.

Files selected for processing: 31

  • core/src/app_manager/catalog.rs
  • core/src/app_manager/lifecycle.rs
  • core/tests/private/app_manager/catalog_lifecycle.rs
  • core/tests/private/app_manager/lifecycle.rs
  • web/src/features/AppCatalog/Components/ApprovedGrantList.tsx
  • web/src/features/AppCatalog/Components/GrantApprovalDialog.tsx
  • web/src/features/AppCatalog/Components/GrantHostPicker.tsx
  • web/src/features/AppCatalog/Components/InstalledAppCard.tsx
  • web/src/features/AppCatalog/Hooks/useAppCatalogLogic.ts
  • web/src/features/AppCatalog/Hooks/useCatalogProxyHosts.ts
  • web/src/features/AppCatalog/Hooks/useGrantApprovalLogic.ts
  • web/src/features/AppCatalog/Types/app-catalog.types.ts
  • web/src/features/AppCatalog/index.tsx
  • web/src/features/AppCatalog/middleware.ts
  • web/src/lib/AppCatalog/contract.ts
  • web/src/lib/AppCatalog/grantApproval.ts
  • web/src/lib/AppCatalog/installationActions.ts
  • web/src/lib/AppCatalog/requests.ts
  • web/src/lib/Language/Locales/de.json
  • web/src/lib/Language/Locales/en.json
  • web/src/lib/Language/Locales/es.json
  • web/src/lib/Language/Locales/fr.json
  • web/src/lib/Language/Locales/it.json
  • web/src/lib/Language/Locales/nl.json
  • web/src/lib/Language/Locales/pl.json
  • web/src/lib/Language/Locales/pt.json
  • web/src/server/AppRuntime/catalog/hosts.server.ts
  • web/src/tests/features/AppCatalog/catalog-install-ui.test.tsx
  • web/src/tests/lib/AppCatalog/grant-approval.test.ts
  • web/src/tests/lib/AppCatalog/installation-actions.test.ts
  • web/src/tests/server/AppRuntime/catalog-hosts.db.test.ts
  • 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

@RentnerKev
RentnerKev merged commit 9e172b9 into main Nov 27, 2026
48 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/review-app-grants branch November 27, 2026 16:09
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.

feat(apps): approve requested app capabilities when installing or updating

1 participant