|
|
@ -45,10 +45,18 @@ describe(Carto::Common::Logger, type: :request) do
|
|
|
|
|
|
|
|
|
|
|
|
it 'obfuscates sensitive parameters' do
|
|
|
|
it 'obfuscates sensitive parameters' do
|
|
|
|
output = LogDeviceMock.capture_output do
|
|
|
|
output = LogDeviceMock.capture_output do
|
|
|
|
get(root_path, password: 'password', nested: { token: 'token', auth_stuff: 'auth_stuff' })
|
|
|
|
get(
|
|
|
|
|
|
|
|
root_path,
|
|
|
|
|
|
|
|
password: 'password',
|
|
|
|
|
|
|
|
nested: { token: 'token', auth_stuff: 'auth_stuff' },
|
|
|
|
|
|
|
|
nested_array: %w[auth sensible_stuff]
|
|
|
|
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
expect(output).to match(/"password":"********".*"token":"*****".*"auth_stuff":"**********"/)
|
|
|
|
expect(output).to match(/password=(\*{8})/)
|
|
|
|
|
|
|
|
expect(output).to match(/nested\[token\]=(\*{5})/)
|
|
|
|
|
|
|
|
expect(output).to match(/nested\[auth_stuff\]=(\*{10})/)
|
|
|
|
|
|
|
|
expect(output).to match(/nested_array=(\*{4})(.*)(\*{14})/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'logs request processing' do
|
|
|
|
it 'logs request processing' do
|
|
|
|