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 gitignores for rails credentials #23263

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

jrafanie
Copy link
Member

We're switching to rails credentials to keep current with rails 7.1 and the future. Note, we're assuming we won't want to commit and share encrypted credentials. If we want to share them, such as for recording cassettes, the comments describe how to switch to only ignoring the plain text encryption key files.

Followup to: #23254
Required for: ManageIQ/manageiq-providers-autosde#253

@jrafanie
Copy link
Member Author

Adding radjabov since #23254 was included on that branch.

@jrafanie jrafanie mentioned this pull request Nov 13, 2024
39 tasks
We're switching to rails credentials to keep current with rails 7.1 and the future.
Note, we're assuming we won't want to commit and share encrypted credentials. If we want
to share them, such as for recording cassettes, the comments describe how to switch to only
ignoring the plain text encryption key files.

Followup to:  ManageIQ#23254
Required for: ManageIQ/manageiq-providers-autosde#253
Comment on lines +48 to +60
# See: EDITOR=vi be rails credentials:edit --help for more information
# Rails credentials follow the following pattern:
# If ENV['RAILS_MASTER_KEY'] isn't specified:
# Global is used:
# * config/master.key (plain text encryption key)
# * config/credentials.yml.enc (encrypted credentials file)
# If --environment test, the overrides for that environment is used:
# * config/credentials/test.key
# * test.yml.enc
# If we want to commit and share encrypted credentials, we can change the two lines below to:
# config/*.key
# config/credentials/*.key
config/credentials*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the Rails boilerplate or is this something you wrote up? I'll merge regardless, I'm just curious.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the comments.

Rails assumes you'll want to commit the yml.enc encrypted files and share your .key file so only the .key is .gitignored. When you do rails credentials:edit with environment or without, it only adds the .gitignore for that particular .key file. I think it's safer to ignore both key and encrypted file for now and if we ever want to use a shared encrypted credentials file by sharing the key, we can remove the encrypted credentials file from the .gitignore.

@Fryguy Fryguy merged commit 0cc2f47 into ManageIQ:master Nov 15, 2024
12 checks passed
@Fryguy Fryguy self-assigned this Nov 15, 2024
@jrafanie jrafanie deleted the rails-credentials-gitignores branch November 15, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants