Gate enterprise-managed authorization behind a PostHog flag - #1758
Merged
Conversation
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 22ed12d | Aug 26 2026, 10:11 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 22ed12d | Commit Preview URL Branch Preview URL |
Aug 26 2026, 10:11 PM |
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.
Stacked on #1730. Puts the enterprise-managed authorization path behind a PostHog feature flag so it can be rolled out to real users gradually.
Shape
The SDK stays vendor-free: the gate is a host-owned seam injected alongside the existing
fetchand HTTP client dependencies, so local, desktop, CLI and self-hosted deployments keep working with no PostHog and no configuration. When no host injects a gate, the enterprise-managed path is attempted exactly as it is today.apps/cloudimplements the seam with a smallfetchagainst PostHog's flag endpoint using the already-deployed public project key, rather than adding an SDK to the worker bundle. That is deliberate: a dependency added to this bundle previously produced a large, never-explained page-load regression, so the cheap call is the conservative choice.Rollout is keyed on the user —
distinct_idis the acting user's id, matching theidentifycall the web app already makes — with the organization passed as group context so group targeting stays available without changing the user-level rollout. Flag key:mcp-enterprise-managed-auth.Behaviour
Analytics
Connect outcomes are captured as
ema_connect_attempted,ema_connect_connectedandema_connect_blocked_by_admin, each carrying the flag decision, and the blocked event carrying the identity provider's own error code. Capture is handed to the platform rather than awaited, so it cannot delay or fail a connect. A test asserts no token, assertion or other credential material can reach event properties.Tests
8 new tests in the SDK covering allow, withhold, evaluation failure, the no-gate default, the never-after-denial ordering, the no-re-evaluation-on-renewal property, credential exclusion from events, and an observer that throws. 17 new tests in the cloud implementation covering the user/group payload, each failure mode failing closed, event contents, and fire-and-forget capture.