No commit activity in last 3 years
No release in over 3 years
Obscures all sensitive attributes from showing up in the errors objects for Active Records/Resources
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 2.6

Runtime

 Project Readme

Obscurify Attribute

Obscures all sensitive attributes from showing up in the errors object for Active Records/Resources

Install

Add the following line to your Gemfile

gem 'obscurify_attribute'

Usage

Add the following line into your ActiveRecord (or ActiveResource) model:

class Payment < ActiveRecord::Base
    include ObscurifyAttribute::Validations

    # if credit_card is one of the sensitive attributes, but it should not be shown to the user...
    obscurify :credit_card, :payment_information, :message => "foo bar"
end

:message is optional. It defaults to the same messages that were reported for the original attribute. If specified, the new message will overwrite the reported array. All messages are uniqued to avoid duplicates (since you can specify the same target attribute name for multiple source attributes)!

ObscurifyAttribute will iterate over the errors object and mask sensitive fields with a different (user-specified) name so that they dont show up in the UI.

Known issues

Contribute & Dev environment

Usual fork & pull request.