feat(exec): add --privileged and --data-env flags#570
Open
davidsu wants to merge 1 commit into
Open
Conversation
Faithful port of #435 (Netanel Gilad) with the renamed flags: - --privileged sends the X-Bypass-RLS header (bypass RLS) - --data-env <environment> sends the X-Data-Env header Both flow exec.ts -> run-script.ts (BASE44_PRIVILEGED / BASE44_DATA_ENV env vars) -> the Deno wrapper, which builds the SDK request headers. Open backend questions surfaced during review (RLS-bypass exposure and prod-edge survival, data-env value validation, and data-env scope for backend-function invocations) are flagged inline as QUESTION(@netanelgilad) comments for Netanel to resolve at review. Refs #435 Co-Authored-By: Netanel Gilad <netanelg@wix.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.5-pr.570.f3b8004Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.5-pr.570.f3b8004"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.5-pr.570.f3b8004"
}
}
Preview published to npm registry — try new features instantly! |
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.
Note
Description
Adds two new flags to the
base44 execcommand:--privilegedand--data-env.--privilegedruns a script with admin privileges by sending theX-Bypass-RLSheader (bypassing row-level security), while--data-envtargets a specific data environment via theX-Data-Envheader. This lets users run maintenance/seed scripts and target dev vs. prod data directly from the CLI.Related Issue
Ported from #435. Closes none explicitly.
Type of Change
Changes Made
--privilegedflag tobase44 execthat sets theX-Bypass-RLSheader (requires app owner/editor role).--data-env <environment>flag tobase44 execthat sets theX-Data-Envheader (e.g.dev,prod).privilegedanddataEnvoptions throughexecAction→runScript(), passing them to the Deno subprocess asBASE44_PRIVILEGEDandBASE44_DATA_ENVenv vars.deno-runtime/exec.ts) to read the new env vars and attach the corresponding custom headers to the SDK client.QUESTION(@netanelgilad)comments flagging open backend-scoping questions (data-env validation, RLS-bypass gating at the edge).Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
--data-envvalue is passed through raw; the backend only honorsdev/prodand silently falls through to prod for unknown values. InlineQUESTION(@netanelgilad)comments track open questions about backend scoping and whether the CLI should validate the value — these should be resolved before/after merge.🤖 Generated by Claude | 2026-07-20 12:34 UTC | f3b8004