Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhanced security by default #4344

Open
Vandivier opened this issue Jun 1, 2024 · 3 comments · May be fixed by #4347
Open

enhanced security by default #4344

Vandivier opened this issue Jun 1, 2024 · 3 comments · May be fixed by #4347

Comments

@Vandivier
Copy link
Contributor

What do you want and why?

for streamers, blitz logs expose sensitive data by default on the terminal

Possible implementation(s)

// Note: This stays in the /pages folder for the time being

import { rpcHandler } from "@blitzjs/rpc"
import { api } from "src/app/blitz-server"

const getBlitzLogLevel = (): "info" | "debug" | undefined => {
  const requestedLevel = process.env.BLITZ_LOG_DISABLE_LEVEL
  if (requestedLevel === "info" || requestedLevel === "debug") {
    return requestedLevel
  }
  return undefined
}

export default api(
  rpcHandler({
    onError: (error, ctx) => console.log(error),
    logging: {
      disablelevel: getBlitzLogLevel(),
    },
  })
)

@Vandivier
Copy link
Contributor Author

related Vandivier/ladderly-3#182

@siddhsuresh
Copy link
Member

@Vandivier this sounds like a good default, will you be willing to send a PR?

@Vandivier
Copy link
Contributor Author

@siddhsuresh yes, thanks! i'll get a PR up in the next 1-3 days

@Vandivier Vandivier linked a pull request Jun 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants