-
-
Notifications
You must be signed in to change notification settings - Fork 495
[lexik/jwt-authentication-bundle] gitignore JWT keys #89
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoudn't it be
%PROJECT_DIR%/secrets/jwt/...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, unless we want to support storing the key pair outside of the project directory? (Out of scope for this PR anyway...)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if we go ahead with this, we should probably add a
secrets-dir
option in Flex?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Fabien. This looks really strange. It should be
%CONFIG_DIR%/secrets/jwt/...
or%PROJECT_DIR%/secrets/jwt/...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%CONFIG_DIR%
resolves toconfig
.%PROJECT_DIR%
resolves to the full path of the project directory.What we might want to add is a
%SECRETS_DIR%
which resolves tosecrets
.But I still find it weird to see aoh wait it already does...%SECRETS_DIR%
in an environment variable... I think the resolving should happen when Flex updates the.env
(and.env.dist
) files.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
symfony/symfony#23901 introduced the
file
prefix for%env(...)%
processing.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz managing secret's encryption at this level looks like a bad idea to me. There are already plenty dedicated tools to do it like Docker and Kubernetes. IMO the best thing to to is to make it easy to use them in Symfony (and it's achieved with symfony/symfony#23901), not to reinvent the wheel.
I'm 👍 to introduce a new
secrets
directory and store things like JWT keys and Doctrine passwords in it (and retrieve them with symfony/symfony#23901).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The risk of the
secrets
directory is that people would be tempted to directly commit their credentials in the code repository... You use the example of Docker/Kubernetes and the secrets management is exactly meant to prevent people to add their secrets within the Docker image directly. As long as we give a very clear documentation that these secrets have to be development secrets and overwritten by production secrets while deploying production, then I'm 👍 with suchsecrets
directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding an empty directory with a
.gitignore
which ignores everything else should help.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add this directory to the .gitignore file.