Conversation
| @@ -125,6 +125,8 @@ class ResponseRedacter | |||
|
|
|||
| # @param [Hash] body | |||
There was a problem hiding this comment.
Should we update the parameter type if we're expecting nil or other non-hash values?
There was a problem hiding this comment.
I'm only expecting those values in error situations; they are not the way that the method is intended to be used. So, I would say no, non-hash values should not be documented because they're not supposed to be used. But, I could see the argument the other way, too.
There was a problem hiding this comment.
I think an array would be a not-expected value, but I do think nil is sort of expected, so I'd at least document that
There was a problem hiding this comment.
I think if we're handling those other value types in this method, they are supported types for the method. And if we don't want them to be supported types, we shouldn't call the method with those values.
spec/services/proofing/lexis_nexis/ddp/response_redacter_spec.rb
Outdated
Show resolved
Hide resolved
| it 'redacts unknown keys' do | ||
| expect(json.values).to eq(['safe value']*3) | ||
| end |
There was a problem hiding this comment.
same, I think the whole body would be easier to see
| it 'redacts unknown keys' do | |
| expect(json.values).to eq(['safe value']*3) | |
| end | |
| it 'allows known keys' do | |
| expect(json).to eq( | |
| 'review_status' => 'safe value', | |
| 'summary_risk_score' => 'safe value', | |
| 'fraudpoint.score' => 'safe value' | |
| ) | |
| end |
and maybe even combining this spec with the above? One body that has both known + unknown keys?
spec/services/proofing/lexis_nexis/ddp/response_redacter_spec.rb
Outdated
Show resolved
Hide resolved
spec/services/proofing/lexis_nexis/ddp/response_redacter_spec.rb
Outdated
Show resolved
Hide resolved
* Add regression spec for redaction in ResolutionProofingJob * Add constructor to clarify nil response_body
| end | ||
| end | ||
|
|
||
| context 'empty hash agrument' do |
There was a problem hiding this comment.
I am unsuccessful in reopening this PR
addressing
undefined method 'slice' for nil:NilClasserror in log redacterError observed in NewRelic
changelog: Internal, ThreatMetrix API, redacted logging tests