netlify / netlify/cli

[Feature] Allow setting custom JWT secret through a flag or environment variable

Open
#3,745 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: identity area: redirects good first issue type: feature
Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Description

Is your feature request related to a problem? Please describe:

Based on this PR, users can now set custom JWT secret to get RBAC working locally. The problem is that, if users wish to keep the same JWT secret in their production and CLI environment, they don't have a good way to do this safely. If they add the secret to their netlify.toml, there's a good chance that this will go to their remote repository and be exposed.

Describe the solution you'd like:

Allowing users to set the JWT secret as a flag in the command would be one option. Another option would be to let users save this secret as an environment variable in their .env file or something similar. In most cases, that file is not pushed to a remote repository. Additionally, since CLI is able to pull variables set it the UI, users could simply set it in their UI to avoid leaking it to their repository.

Describe alternatives you've considered:

None

Additional context:

N/A

Can you submit a pull request?

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading PR #1545 and tracing how the CLI currently receives and uses the custom JWT secret. Decide how a flag, environment variable, or UI-provided value should be selected without exposing secrets, then add coverage for the chosen configuration path and verify that the secret is not written to netlify.toml or displayed unintentionally.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, cli, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.