Commit e1ec453
committed
Filter decrypted attributes
e19445a introduced marking
attr_encrypted attributes as virtual attributes to avoid an ActiveRecord
deprecation warning in AR 5.1. This had the side effect of exposing
the decrypted versions of the attributes in
`ActiveRecord::Base#attributes`. This is problematic since the method
is leveraged for things like `#as_json` and `respond_with`, meaning a
user could inadvertely expose sensitive info with an action like:
```
def show
respond_with @user
end
```1 parent 3e5b7fa commit e1ec453
2 files changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
340 | 345 | | |
0 commit comments