Skip to content

Commit

Permalink
Strip all env vars starting with DISPATCH_
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Apr 17, 2024
1 parent bdf673f commit 4a79a0b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ Run 'dispatch help run' to learn about Dispatch sessions.`, BridgeSession)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

// Pass on environment variables to the local application.
// Pass on the configured API key, and set a special endpoint
// URL for the session. Unset the verification key, so that
// it doesn't conflict with the session. A verification key
// is not required here, since function calls are retrieved
// from an authenticated API endpoint.
// Pass on environment variables to the local application. Pass on the
// configured API key, and set a special endpoint URL for the session.
// Unset all DISPATCH_* environment variables, which includes overrides for
// the CLI and also the verification key (DISPATCH_VERIFICATION_KEY), so
// that they don't conflict with the session. Note that a verification key
// is not required here, since function calls are retrieved from an
// authenticated API endpoint.
cmd.Env = append(
withoutEnv(os.Environ(), "DISPATCH_VERIFICATION_KEY="),
withoutEnv(os.Environ(), "DISPATCH_"),
"DISPATCH_API_KEY="+DispatchApiKey,
"DISPATCH_ENDPOINT_URL=bridge://"+BridgeSession,
)
Expand Down

0 comments on commit 4a79a0b

Please sign in to comment.