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

Add option for preventing rails credentials editing without environment #9

Open
marcqualie opened this issue Jul 17, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@marcqualie
Copy link
Collaborator

The rails default is to use master.key for development, then require -e for all other environments. This is odd default behaviour, but likely for backwards compatibility.

Prevent just doing rails credentials:edit and required the -e development to explicitness.

@marcqualie marcqualie added the enhancement New feature or request label Jul 17, 2020
@marcqualie marcqualie added this to the v1.0.0 milestone Oct 1, 2020
@marcqualie
Copy link
Collaborator Author

It seems this will be pretty difficult to do without PR'ing against rails core, or overriding the rake commands that are defined

There are a couple of hard coded issues:

default_environment: nil

https://github.com/rails/rails/blob/master/railties/lib/rails/commands/credentials/credentials_command.rb#L28

This prevents diffcrypt from manually sending in the environment.

options[:environment]

https://github.com/rails/rails/blob/master/railties/lib/rails/commands/credentials/credentials_command.rb#L82

Rails assumes that if options[:environment] is not set, then the user should work with the config/credentials.yml.enc file and config/master.key

@marcqualie marcqualie self-assigned this Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant