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
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions guides/source/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Below are the default values associated with each target version. In cases of co
- [`config.active_record.belongs_to_required_validates_foreign_key`](#config-active-record-belongs-to-required-validates-foreign-key): `false`
- [`config.active_record.commit_transaction_on_non_local_return`](#config-active-record-commit-transaction-on-non-local-return): `true`
- [`config.active_record.default_column_serializer`](#config-active-record-default-column-serializer): `nil`
- [`config.active_record.encryption.add_to_filter_parameters`](#config-active-record-encryption-add-to-filter-parameters): `true`
- [`config.active_record.encryption.hash_digest_class`](#config-active-record-encryption-hash-digest-class): `OpenSSL::Digest::SHA256`
- [`config.active_record.encryption.support_sha1_for_non_deterministic_encryption`](#config-active-record-encryption-support-sha1-for-non-deterministic-encryption): `false`
- [`config.active_record.generate_secure_token_on`](#config-active-record-generate-secure-token-on): `:initialize`
Expand Down Expand Up @@ -1604,6 +1605,17 @@ whether a foreign key's name should be dumped to db/schema.rb or not. By
default, foreign key names starting with `fk_rails_` are not exported to the
database schema dump. Defaults to `/^fk_rails_[0-9a-f]{10}$/`.

#### `config.active_record.encryption.add_to_filter_parameters`

Enables automatic filtering of encrypted attributes on `inspect`.

The default value depends on the `config.load_defaults` target version:

| Starting with version | The default value is |
|-----------------------|----------------------|
| (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.


#### `config.active_record.encryption.hash_digest_class`

Sets the digest algorithm used by Active Record Encryption.
Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/application/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.

active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256
active_record.encryption.support_sha1_for_non_deterministic_encryption = false
active_record.marshalling_format_version = 7.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
# as equal to an equivalent `Hash` by default.
# Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false

# Active Record now filters out the encrypted attributes when performing `inspect`.
# If you need to disable the behavior, set false to the following config:
# Rails.application.config.active_record.encryption.add_to_filter_parameters = true

# Active Record Encryption now uses SHA-256 as its hash digest algorithm. Important: If you have
# data encrypted with previous Rails versions, there are two scenarios to consider:
#
Expand Down