Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Use Data::Censor ?

Open bigpresh opened this issue 10 years ago • 6 comments

At work, we were using the censoring code from Dancer1's Dancer::Error - but I needed to be able to customise the fields a bit, and felt dirty calling a private method from another package - and so, the censoring code was gently lifted from Dancer::Error, polished up a bit, and Data::Censor was born:

https://metacpan.org/release/Data-Censor

I think it would make sense to make use of that code from within Dancer2, as it's improved from the original version and more flexible, and updates can be pushed to CPAN trivially, etc.

Thoughts?

bigpresh avatar Mar 12 '14 13:03 bigpresh

I wrote something similar at work last year, but shortly before it went live I discovered this:

https://metacpan.org/pod/Data::Rmap

I swallowed my pride and replaced my code with a single line :)

On Wed, Mar 12, 2014 at 1:30 PM, David Precious [email protected]:

At work, we were using the censoring code from Dancer1's Dancer::Error - but I needed to be able to customise the fields a bit, and felt dirty calling a private method from another package - and so, the censoring code was gently lifted from Dancer::Error, polished up a bit, and Data::Censorwas born:

https://metacpan.org/release/Data-Censor

I think it would make sense to make use of that code from within Dancer2, as it's improved from the original version and more flexible, and updates can be pushed to CPAN trivially, etc.

Thoughts?

Reply to this email directly or view it on GitHubhttps://github.com/PerlDancer/Dancer2/issues/530 .

andrewsolomon avatar Mar 12 '14 14:03 andrewsolomon

What if we just made it hookable?

Each person could write their own "cleanup" method.

xsawyerx avatar Apr 24 '14 15:04 xsawyerx

Perhaps. A default implementation which helps save people from not having considered the possibility of accidentally giving away sensitive information seems a worthwhile feature to me still - but being able to override it with your own solution could also be sensible.

bigpresh avatar Apr 24 '14 15:04 bigpresh

I'm still not sure how to make it pluggable.

xsawyerx avatar Apr 24 '14 20:04 xsawyerx

@bigpresh Pull request on this? I wouldn't mind merging it.

xsawyerx avatar Sep 12 '14 22:09 xsawyerx

Will see what I can do :)

bigpresh avatar Sep 12 '14 22:09 bigpresh