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

πŸ§‘β€πŸ’» Launch manifest on dev mode without token secret key #241

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

brunobuddy
Copy link
Contributor

Description

This PR allows to run Manifest on development and contribution mode without specifying a TOKEN_SECRET_KEY in the .env file.

Why is this important ?

Stackblitz removes the .env files in embed editors (like Manifest playground page). To prevent asking the user to add it manually, I had to change the behavior and set a default secret key if there is no .env file.

However this is a security issue on production. To prevent that we throw an error if the environment is production and the key is not specified

How can it be tested?

  • Go to packages/core/manifest
  • Run with or without TOKEN_SECRET_KEY in packages/core/manifest/.env.contribution. It should work the same
  • Switch the NODE_ENV to production and remove the key. The npm run dev task should throw an error saying that it can't run without a secret key

Impacted packages

Check the NPM packages that require a new publication or release:

Check list before submitting

  • I have performed a self-review of my code (no debugs, no commented code, good naming, etc.)
  • I wrote the relative tests
  • I created a PR for the documentation if necessary and attached the link to this PR
  • This PR is wrote in a clear language and correctly labeled

@brunobuddy brunobuddy added the enhancement New feature or request label Dec 6, 2024
@brunobuddy brunobuddy requested a review from SebConejo December 6, 2024 09:55
@brunobuddy brunobuddy self-assigned this Dec 6, 2024
Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
manifest-schema βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Dec 6, 2024 9:55am

@brunobuddy brunobuddy marked this pull request as ready for review December 6, 2024 09:59
@brunobuddy brunobuddy merged commit 6e9e191 into develop Dec 6, 2024
4 checks passed
@brunobuddy brunobuddy deleted the feature/default-jwt-key branch December 6, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants