Repository navigation
Apps contract 1: consent asked exactly as graphql asks it, under the device's or product's account - #1346
Conversation
…ount the device or product was read for graphql asks consentRoot of any release that runs as root or declares capabilities (app-catalog.ts consentAsked/asksConsent), unless a consent kept covers it (coversRootAmong). The portal asked only for root releases, so a restricted app declaring person-certificates or ssh-exec was enabled, added, pinned or moved without the yes, and graphql refused it. One rule now, in helpers/appsHelper: consentAsked/asksConsent, and consentCovers (coversRootAmong, over the catalogue's releases, newest first). Every place the portal decides uses it: - useAppSwitch (Apps section, app page, connect panel, device catalogue): asks where graphql names a release awaiting consent (awaitingRoot, enabled or not), or for an app not on the device yet whose release asks. - The app page's channel, pin and Unpin: the releases the change gives (addAsks), asked first where one asks and the kept consent does not cover it, while the app is enabled. - Add an app (devices, tag, product) and the fleet's Pin and Update. - Product policy: needsConsent, or, turning one on, the release the product names (productRelease) read from the catalogue and weighed against the product's consent. The words say what is asked: root's full control where the release runs as root, else what it asks of remote.it, with its capabilities either way. Lines that said "needs to run as root" for any consent say so only where graphql's words or the catalogue say root. The release-consent lookup names the account the device or product was read under: RootConsent, useReleaseAsks and useAppSwitch take accountId as a required argument, and the product policy page passes the account useProductPolicy read the product under, which it omitted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46aaae1055
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const named = asking.find(r => r.root) ?? asking[0] | ||
| if (named) return setMoving({ key, values, release: named.version }) |
There was a problem hiding this comment.
Match channel-change consent to the device's actual release
When a channel has a partially rolled-out candidate, addAsks returns both its candidate and current versions, but this code selects just one for the consent dialog, preferring whichever runs as root. For example, if current runs as root without capabilities and candidate runs restricted with ssh-exec, a device in the candidate cohort sees consent for current, with no mention of ssh-exec. Confirming then sends the channel change with consentRoot: true, authorizing the candidate's capability without showing it. Resolve the release this device will actually receive, or disclose all permissions the change can authorize rather than choosing one release's permissions.
Useful? React with 👍 / 👎.
…give A channel rolling out a candidate gives a device its candidate or its current, by the device's bucket, which is graphql's to compute. The app page's channel change asked for one of them (the root one, where one was), so a candidate declaring a capability the current does not was consented to without being named. RootConsent and useReleaseAsks now take several releases and say what they ask together; the channel, pin and Unpin changes name every release they may give that asks for a consent the kept one does not cover. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0f9237f4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // catalogue lists them (their pin's, else their channel's). | ||
| const updateRoot = waiting.some(d => heldConsentRoot(d.heldBack!)) | ||
| const updateAsks = [ | ||
| ...new Set(waiting.flatMap(d => app.releases.find(r => r.version === (d.pinned || d.latest))?.capabilities ?? [])), |
There was a problem hiding this comment.
Disclose the channel release's permissions when unpinning
When a selected device is pinned and held for consent, this lookup displays the pinned release's capabilities rather than those of the channel release. However, confirming Update selected calls many({ version: '', consentRoot: true }), which clears the pin and authorizes the channel release. If those releases declare different capabilities, the dialog can therefore authorize permissions it never disclosed. Resolve the permissions of the release the update actually targets (latest after unpinning), including its root requirement, instead of preferring d.pinned.
Useful? React with 👍 / 👎.
…ves to asks Update selected unpins the devices (version ""), moving each to the release its channel gives it (latest). Its consent named the pinned release's capabilities, and asked only for devices held for consent: a device pinned elsewhere was moved to a release asking more without the yes, and graphql refused it. It now asks where a device is held for consent or would move off a pin to a release that asks, and names what those latest releases ask together (root as graphql's held-back words say where the catalogue does not list one). The tests no longer change the shared catalogue fixture's releases in place. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d626dfc8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const entry = listed.find(r => r.version === version) | ||
| return entry ? { root: entry.root, capabilities: entry.capabilities } : own |
There was a problem hiding this comment.
Keep consent blocked when target permissions cannot be read
When a restricted app is held for a newer root release and the catalogue lookup fails or omits that release, this fallback substitutes the currently offered app's root: false and capabilities. RootConsent then enables confirmation and explicitly says the app runs restricted, but confirming through useAppSwitch still sends { consentRoot: true }, authorizing the root release without disclosing its full control. Previously the dialog always disclosed root access. Keep confirmation blocked when a named target's permissions are unknown, rather than treating the current release's permissions as the target's.
Useful? React with 👍 / 👎.
…and no yes is taken for it
Where the catalogue did not answer for the release a consent was for (an API
without one, an error, a release older than those read), the portal showed the
app's own fields instead: the release it runs, not the one the yes moves it to.
A restricted app held for a root release was then asked as restricted, and the
yes still authorized root.
What a named release asks is now known or not: useReleaseAsks answers null for
one the catalogue does not list, and RootConsent says so ("What this version
asks could not be read …"), words for root, and keeps the yes. addAsks says
known: false for a release not read and the Add dialog waits; the fleet's
Update waits likewise; the app page's channel and pin ask for a release not
read rather than skipping it. The app's own fields are used only where they are
the release in question: an app offered to the device, whose fields are what
its release asks there. useAppSwitch names awaitingRoot alone, as graphql's
DeviceApp capabilities describe the release given, not the one awaited.
The device app page and the Add dialog read the newest 100 releases, as the
consent lookup does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes the open Codex finding on #1344 (product policy's consent lookup had no account) and the follow-up noted in #1345 (the portal asked for consent only for root releases).
One consent rule, graphql's
graphql on
device-trustasks forconsentRooton any release that runs as root or declares capabilities (app-catalog.tsconsentAsked/asksConsent), unless a consent already kept covers it (coversRootAmong). The portal asked only for root releases. So a restricted app declaringperson-certificatesorssh-execcould be enabled, added, pinned or moved without the person's yes, and graphql then refused the change.helpers/appsHelpernow has the rule once:consentAsked/asksConsent: root, plus each declared capability.consentCovers:coversRootAmongover the catalogue's releases, newest first. If the consent's release or the target release isn't among those read, a consent counts only for its own release, so the portal asks again. That is safe: graphql keeps the newer yes.productRelease: graphql'sproductRelease, i.e. the pin, else the channel's current, else stable's.Every place the portal decides uses it:
useAppSwitch(Apps section, app page, connect panel, device catalogue)awaitingRoot, set for disabled apps too), or the app isn't on the device yet and its release asksaddAsks) asks and isn't covered by the kept consent. A disabled app is given no release, so nothing is asked, as in graphql'sturnAppneedsConsent; or, when turning an app on, the release the product names (read from the catalogue under the product's account) asks and the product's consent doesn't cover itWhat a consent discloses
latest). It also asks for consent for a pinned device whose channel release asks for one.Wording
The consent dialog (
RootConsent) reads whether the release it's for runs as root:Status lines:
needsConsentOf) or the catalogue say root. Otherwise they say "A new version asks more of remote.it".New keys are in en, de, es and ja. The two product keys this replaces are removed.
The account the lookup names
RootConsent,useReleaseAsksanduseAppSwitchnow requireaccountId(typedstring | undefined, no longer optional), so a caller can't leave it out silently. Product policy now passes the accountuseProductPolicyread the product under. Every other caller already passed the device's account. ThegraphQLCatalogAppcallers inAppPageandAppAddDialogread the active account's own catalogue, as before.Note on graphql
ProductApp.needsConsent/awaitingRootare only set while the app is enabled. For a product app that isn't enabled, the portal works out coverage itself from the catalogue.DeviceApp.awaitingRootis set whether or not the app is enabled.Tests
appsHelper.test:asksConsent,consentCovers(root/restricted/root, a newly declared capability, a release that wasn't read),productRelease, and the held-for-consent wording.DeviceApps.test: a restricted app with capabilities asks; a covering consent turns the app on without asking; anawaitingRootasks again.DeviceAppPage.test: a channel whose release runs as root asks; a capability release asks on pin; a covering consent doesn't ask; a disabled app doesn't ask.AppAddDialog.test: restricted with capabilities asks, for devices and for a product; a release asking nothing doesn't.AppPage.test: fleet Update and Pin for a capability release.ProductPolicyApps.test: the catalogue is read withaccountId; a covering consent turns the app on directly; a consent that doesn't cover a newer release asks again; a restricted app with capabilities asks.DeviceAppPage.test/AppAddDialog.test/ProductPolicyApps.test: a rolling-out candidate disclosed with the current; a release that can't be read blocks the yes.AppPage.test: Update off a pin names the channel release's asks.tsc --noEmit,npm run i18n:extract(no diff after the commit) andnpm run i18n:checkall pass.🤖 Generated with Claude Code