Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/cli/cli.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default defineConfig({
.desc("Use a Superset API key (sk_live_…) instead of OAuth login"),
},
audiences: () =>
process.env.SUPERSET_CLI_AUDIENCE === "internal"
process.env.SUPERSET_CLI_AUDIENCE === "internal" ||
process.env.SUPERSET_SANDBOX_WORKSPACE_ID
? ["internal", "public"]
: ["public"],
sandbox: () => Boolean(process.env.SUPERSET_SANDBOX_WORKSPACE_ID),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { command } from "../../../../lib/command";
import { resolveEnvironment } from "../../../../lib/environments";

export default command({
sandbox: false,
description: "Delete a variable from an environment",
args: [positional("name").required().desc("Variable name")],
options: {
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/commands/environments/secrets/meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export default {
sandbox: false,
description: "Manage the variables an environment gives its cloud workspaces",
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ async function readStdin(): Promise<string> {
}

export default command({
sandbox: false,
description:
"Set a variable on an environment, from --body, stdin, or a .env file",
args: [
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/src/environment-secrets.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { describe, expect, test } from "bun:test";
import { reservedKeyReason } from "./environment-secrets";

describe("reservedKeyReason", () => {
test("the provider's own credentials are reserved", () => {
expect(reservedKeyReason("VERCEL_SANDBOX_TOKEN")).toContain(
"VERCEL_SANDBOX_",
);
expect(reservedKeyReason("SUPERSET_WORKSPACE_ID")).toContain("SUPERSET_");
expect(reservedKeyReason("path")).toContain("PATH");
});

test("a deploy CLI's token is an ordinary variable", () => {
expect(reservedKeyReason("VERCEL_TOKEN")).toBeNull();
expect(reservedKeyReason("VERCEL_ORG_ID")).toBeNull();
expect(reservedKeyReason("EXPO_TOKEN")).toBeNull();
});
});
2 changes: 1 addition & 1 deletion packages/shared/src/environment-secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const RESERVED_PREFIXES: Array<{ prefix: string; reason: string }> = [
reason: "carries the workspace's identity into the sandbox",
},
{ prefix: "HOST_SERVICE_", reason: "configures the sandbox's own server" },
{ prefix: "VERCEL_", reason: "belongs to the sandbox provider" },
{ prefix: "VERCEL_SANDBOX_", reason: "provisions the box itself" },
];

const RESERVED_KEYS = new Set([
Expand Down
1 change: 1 addition & 0 deletions packages/trpc/src/lib/sandbox/api-credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const SANDBOX_ALLOWED_PROCEDURES: ReadonlySet<string> = new Set([
"cloudWorkspace.access",
"cloudWorkspace.hostTicket",
"environment.list",
"environment.secrets.list",
"page.assets.upload",
"page.create",
"page.get",
Expand Down
Loading