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

New configurable settings: encryption for audited_changes & filtering encrypted attrs #694

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sriddbs
Copy link
Contributor

@sriddbs sriddbs commented Jan 15, 2024

Closes #690

  • Add new configurable vars:
    • encrypt_audited_changes default to false
    • filter_encrypted_attributes default to true

@sriddbs
Copy link
Contributor Author

sriddbs commented Jan 15, 2024

@danielmorrison please review and let me if the proposed config in the PR is good, also I wonder why some of the specs are failing 🤔

Audited.filter_encrypted_attributes = false
```

If you want to encrypt the changes that are audited, you can simply add this line to your config
Copy link
Member

Choose a reason for hiding this comment

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

Maybe another header here to show that these are separate features?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, because we use encrypts, this config is also available only from Rails 7 ... so I grouped it under the same header

should I add a sub-header?

Copy link
Member

@danielmorrison danielmorrison left a comment

Choose a reason for hiding this comment

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

Looking good to me. Test errors are something strange with coverage? Doesn't make sense offhand.

@sriddbs
Copy link
Contributor Author

sriddbs commented Jan 16, 2024

Looking good to me. Test errors are something strange with coverage? Doesn't make sense offhand.

I had the same errors with spec/audited/audit_spec, rspec clearly showed me the errors locally and I could fix it

for this it just runs fine

rspec spec/audited/auditor_spec.rb
Created database ':memory:'
............................................................................................................*.....*........................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Audited::Auditor without auditing should be thread safe using a #without_auditing block
     # No reason given
     # ./spec/audited/auditor_spec.rb:996

  2) Audited::Auditor with auditing should be thread safe using a #with_auditing block
     # No reason given
     # ./spec/audited/auditor_spec.rb:1077

@sriddbs
Copy link
Contributor Author

sriddbs commented Jan 30, 2024

@danielmorrison if this PR looks good, please merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encryption for audited_changes / disabling the FILTERED feature
2 participants