MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / grabAndRemoveEnvVars

Function grabAndRemoveEnvVars

cmd/server/main-server.go:399–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

397}
398
399func grabAndRemoveEnvVars() error {
400 err := authkey.SetAuthKeyFromEnv()
401 if err != nil {
402 return fmt.Errorf("setting auth key: %v", err)
403 }
404 err = wavebase.CacheAndRemoveEnvVars()
405 if err != nil {
406 return err
407 }
408 err = wcloud.CacheAndRemoveEnvVars()
409 if err != nil {
410 return err
411 }
412
413 // Remove WAVETERM env vars that leak from prod => dev
414 os.Unsetenv("WAVETERM_CLIENTID")
415 os.Unsetenv("WAVETERM_WORKSPACEID")
416 os.Unsetenv("WAVETERM_TABID")
417 os.Unsetenv("WAVETERM_BLOCKID")
418 os.Unsetenv("WAVETERM_CONN")
419 os.Unsetenv("WAVETERM_JWT")
420 os.Unsetenv("WAVETERM_VERSION")
421
422 return nil
423}
424
425func clearTempFiles() error {
426 ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)

Callers 1

mainFunction · 0.85

Calls 3

SetAuthKeyFromEnvFunction · 0.92
CacheAndRemoveEnvVarsFunction · 0.92
CacheAndRemoveEnvVarsFunction · 0.92

Tested by

no test coverage detected