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

Store secret_key_base in Rails.config for local environments. #48470

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

p8
Copy link
Member

@p8 p8 commented Jun 14, 2023

Rails secrets have been deprecated in favor of credentials.
However, for the local environments Rails.application.secrets is still used to store secret_key_base.

We can store secret_key_base in Rails.config.secret_key_base instead.

This change allows us to deprecate calling Rails.application.secrets. See #48472.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Jun 14, 2023
@p8 p8 force-pushed the railties/use-secret-key-base-accessor branch from 81f7f6e to 9aba812 Compare June 14, 2023 11:30
@p8 p8 changed the title * Store secret_key_base in Rails.config for local environments. Store secret_key_base in Rails.config for local environments. Jun 14, 2023
@p8 p8 force-pushed the railties/use-secret-key-base-accessor branch 3 times, most recently from 0631668 to fdb3f33 Compare June 14, 2023 12:54
@p8 p8 force-pushed the railties/use-secret-key-base-accessor branch from fdb3f33 to a87e5e3 Compare June 14, 2023 13:09
Rails `secrets` have been deprecated in favor of `credentials`.
For the local environment the `secret_key_base` is now be stored in
`Rails.config.secret_key_base` instead of the deprecated
`Rails.application.secrets.secret_key_base`.
@p8 p8 force-pushed the railties/use-secret-key-base-accessor branch from a87e5e3 to 21c3455 Compare June 14, 2023 14:37
@guilleiguaran guilleiguaran merged commit 23ccb33 into rails:main Jun 14, 2023
9 checks passed
@p8 p8 deleted the railties/use-secret-key-base-accessor branch June 15, 2023 04:31
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.

None yet

2 participants