Add Device modal: per-link expiry picker #629
Replies: 2 comments
-
|
Green light — PR welcome. Real MSP pain and the server already supports it; only the modal needs work. A couple of preferences:
Mention the install-link generator route in the PR description if you wire it on that surface too — easy to forget there's a second entry point. |
Beta Was this translation helpful? Give feedback.
-
|
Shipped — the per-link expiry picker on the Add Device modal landed on Thanks @bdunncompany. Closing as resolved — please verify in your environment and reopen if needed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What's missing
The "Add New Device" modal lets the admin choose a Site, Platform, and Number of devices, but not the lifetime of the generated installer link.
Today the link's TTL is set globally by
CHILD_ENROLLMENT_KEY_TTL_MINUTES(and the parent byENROLLMENT_KEY_DEFAULT_TTL_MINUTES). Default 24h for child, 60min for parent. That's reasonable for an admin who's rolling out devices same-day. It's too short for an MSP who's onboarding a remote site where some endpoints are intermittently online — a kiosk that's powered on once a week, a satellite location with a roaming laptop fleet, a remote contractor who picks up the link a few days later.The current workaround is to bump those env vars globally on the server. That over-corrects: it gives every link, in every partner / org / site, the same long lifetime, including cases where a short-lived bootstrap token would actually be the right security posture.
Proposed change
Add a "Link expires in" picker to
apps/web/src/components/devices/AddDeviceModal.tsx(and matching surface on the install-link generator route). Options like:The server side already supports it.
enrollment_keys.expires_atis nullable on the schema, the create-endpoint zod accepts an explicitexpiresAt, and the read path already handlesnullas "never expires" (existing keys named "Thorne Deployment" on this MSP haveexpires_at = NULLand work fine). Only the modal lacks the input.Implementation could either:
expiresAt(absolute ISO timestamp) computed client-side from the picked option.Optional: partner-level cap
For partners that want to enforce shorter-lived install links as a security default — even when an individual admin tries to pick "Never" — the partner-settings layer could expose
partners.settings.maxEnrollmentLinkTtlMinutes. The Add Device modal would clamp the picker options to that ceiling. Not blocking; just worth flagging since the inheritable-settings shape is already in place from the launcher / org-reorder work.Why now
Real MSP scenario: rolling out to a remote office where machines come online sporadically. With the 24h default, the link expires before half the fleet has even checked in. Bumping the global env to 30 days fixes that customer, but breaks the principle of least privilege for every other link the same admin generates. Per-link override is the obvious lever.
Happy to PR if there's interest. Tiny diff, no DB or schema change — only UI + payload addition.
Beta Was this translation helpful? Give feedback.
All reactions