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

[Docs]Add missing entry for encryption.add_to_filter_paramters #49364

Closed
wants to merge 4 commits into from
Closed

[Docs]Add missing entry for encryption.add_to_filter_paramters #49364

wants to merge 4 commits into from

Conversation

hachi8833
Copy link
Contributor

Motivation / Background

This Pull Request has been created because the new config entry for #46453 is missing in configuring.md guide.

Detail

This Pull Request adds config.active_record.encryption.add_to_filter_parameters to configuring.md.

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]

@rails-bot rails-bot bot added the docs label Sep 24, 2023
@rails-bot rails-bot bot added the railties label Sep 24, 2023
@hachi8833 hachi8833 changed the title [ci-skip][Docs]Add missing entry for encryption.add_to_filter_paramters [Docs]Add missing entry for encryption.add_to_filter_paramters Sep 24, 2023
@hachi8833
Copy link
Contributor Author

The lint system detected the missing entries in railties/lib/rails/application/configuration.rb and railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt.
I added the entries to them and removed ci-skip from the PR title.

Copy link
Member

@skipkayhil skipkayhil left a comment

Choose a reason for hiding this comment

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

I'm a bit confused about this one. Is the goal just to document how it is already or to change what the value will be with load_defaults 7.1?

Comment on lines 1616 to 1617
| (original) | `true` |
| 7.1 | `false` |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| (original) | `true` |
| 7.1 | `false` |
| (original) | `false` |
| 7.1 | `true` |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad. Fixed the inverted values.

@@ -287,6 +287,7 @@ def load_defaults(target_version)
active_record.belongs_to_required_validates_foreign_key = false
active_record.before_committed_on_all_records = true
active_record.default_column_serializer = nil
active_record.encryption.add_to_filter_parameters = true
Copy link
Member

Choose a reason for hiding this comment

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

Is the intention to make this the default in new apps? This isn't really a doc change anymore is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the doc and I think we can now leave it as the new 7.1 default value.

@hachi8833 hachi8833 closed this by deleting the head repository Sep 27, 2023
@hachi8833
Copy link
Contributor Author

@skipkayhil Sorry, I found that I unintentionally closed the PR...

Unfortunately, after that the situation has been changed that new_framework_defaults_7_1.rb.tt has been renamed to new_framework_defaults_7_2.rb.tt in main branch, thus I guess the PR should not be merged into the current main branch.

I'm afraid I should recreate the PR and send to 7-1-stable branch, as well as send another PR to main branch just for updating configuring.md.
Should I do that? Or should I leave this as it is?

@skipkayhil
Copy link
Member

I'm afraid I should recreate the PR and send to 7-1-stable branch, as well as send another PR to main branch just for updating configuring.md.

Hmm, the documentation for main will kind of end up depending on whether the frame default ends up accepted. I'd start with a PR to 7-1-stable I think? I'll admit this is a weird edge case of the usual workflow 😅

cc @rafaelfranca do you think we should add this new framework default in 7.1?

@rafaelfranca
Copy link
Member

rafaelfranca commented Sep 29, 2023

I personally didn't understand the need. Isn't active_record.encryption.add_to_filter_parameters already true? Which value are we trying to make the new framework default?

@rafaelfranca
Copy link
Member

I actually don't think this should be a config at all. We should never to add encrypted value to the logs. Even on inspect. We don't do for password hashes.

@hachi8833
Copy link
Contributor Author

I got it and leave this closed as it is.

@skipkayhil
Copy link
Member

skipkayhil commented Sep 29, 2023

We don't do for password hashes.

If I understand correctly, I think this is because of the configuration we put in new apps:

:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn

When add_to_filer_parameters is set to true, all encrypted model attributes are added to this list automatically.

@skipkayhil
Copy link
Member

skipkayhil commented Sep 29, 2023

Oh, yes I understand now. The configuration is true by default as you say. Apps can set it to false to opt out if they want.

@hachi8833 so what we can do is a new documentation PR that just adds the
#### config.active_record.encryption.add_to_filter_parameters section if you are still interested.

@hachi8833
Copy link
Contributor Author

Thank you for the explanation! I'll try the new PR perhaps today evening.

hachi8833 added a commit to hachi8833/rails that referenced this pull request Oct 1, 2023
encryption.add_to_filter_paramters has been merged by rails#46453.

(This PR is a second try of rails#49364 )
rafaelfranca added a commit that referenced this pull request Oct 2, 2023
….md (#49443)

* Add encryption.add_to_filter_parameters to configuring.md

encryption.add_to_filter_paramters has been merged by #46453.

(This PR is a second try of #49364 )

* Update entry for encryption.add_to_filter_parameters

Co-authored-by: Rafael Mendonça França <rafael@rubyonrails.org>
rafaelfranca added a commit that referenced this pull request Oct 2, 2023
….md (#49443)

* Add encryption.add_to_filter_parameters to configuring.md

encryption.add_to_filter_paramters has been merged by #46453.

(This PR is a second try of #49364 )

* Update entry for encryption.add_to_filter_parameters

Co-authored-by: Rafael Mendonça França <rafael@rubyonrails.org>
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.

None yet

3 participants