feat(features): let org admins enforce preemptive session refresh - #5066
Draft
speakeasyforgebot wants to merge 5 commits into
Draft
feat(features): let org admins enforce preemptive session refresh#5066speakeasyforgebot wants to merge 5 commits into
speakeasyforgebot wants to merge 5 commits into
Conversation
Introduce a new remote_session_auto_refresh_enforced product feature so
org admins can make preemptive session refresh the organization default
rather than relying only on per-user settings.
- productfeatures: new feature constant, Goa design attribute + enum, and
GetProductFeatures result field (regenerated Goa + TS SDK).
- consent flow: when enforced, the auto-refresh control renders locked
('On · Managed by your organization'), the value is pinned on, and the
posted form value is never trusted (connect/set_auto_refresh forced on).
- keepalive: ClaimDue/GetDue candidate queries treat every eligible
session as due when the org enforces refresh, regardless of the persisted
per-session preference (opt-in visibility feature stays UI-only).
- dashboard: admin panel toggle for the enforced feature.
- tests: consent template locked-state test + refresh sweep enforced-org test.
Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>
Contributor
|
Co-authored-by: Sagar Batchu <simplesagar@users.noreply.github.com>
Co-authored-by: Sagar Batchu <simplesagar@users.noreply.github.com>
Co-authored-by: Sagar Batchu <simplesagar@users.noreply.github.com>
Co-authored-by: Sagar Batchu <simplesagar@users.noreply.github.com>
Contributor
|
Found 1 test failure on Blacksmith runners: Failure
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light.png)
Summary
Adds an organization-wide policy for automatic remote-session refresh (AIS-493), managed by customer organization admins from the MCP Connections page, and makes that policy legible to end users on the OAuth consent screen.
The policy has three explicit states:
Changes
Organization policy (admin)
setRemoteSessionAutoRefreshPolicyendpoint authorized withorg:admin, so the two underlying product-feature flags cannot be left partially updated.Consent screen (end user)
Off · Managed by your organization/On · Managed by your organization) and editable only under User controlled. Off is styled neutrally rather than as a feedback color, since it is a policy choice and not a failure.Keepalive
auto_refresh = truekept renewing connections after an organization turned refresh off, which would have made the new "Off" label untrue.Testing
mise run test:server ./internal/productfeatures/... ./internal/mcp/... ./internal/remotesessions/...— passes, including new coverage for all three policies on the consent template, the required and disabled keepalive paths (and that a restored opt-in policy honors the stored preference again), andorg:adminenforcement on the new endpoint.mise run lint:server,mise run build:server,pnpm -F dashboard lint,pnpm -F dashboard type-check,pnpm -F dashboard build— pass.Admin policy on MCP Connections
Consent screen, one state per policy
Rendered from the production consent template (a live capture would require real upstream OAuth providers).
Disabled:
User controlled:
Required:
Linear Issue: AIS-493
Summary by cubic
Adds an org-level policy for preemptive remote session refresh with Disabled, User controlled, and Enforced states so admins can set and lock the default. This improves session reliability and aligns consent UX with org policy (AIS-493).
New Features
productFeatures.setRemoteSessionAutoRefreshPolicywith enum valuesdisabled,user_controlled,enforced; maps to visibility + enforced flags.connectandset_auto_refreshforce the managed value.GetProductFeaturesincludesremote_session_auto_refresh_enforced_enabled; new@gram/clientfunctionfeaturesSetRemoteSessionAutoRefreshPolicyand React Query hookuseSetRemoteSessionAutoRefreshPolicyMutation; OpenAPI and CLI updated.Bug Fixes
Written for commit 79c3926. Summary will update on new commits.