DannyDainton / newman-reporter-htmlextra

A HTML reporter for Postman's Command Line Runner, Newman. Includes Non Aggregated Runs broken down by Iterations, Skipped Tests, Console Logs and the handlebars helpers module for better custom templates.
Apache License 2.0
356 stars 137 forks source link

[Feature Request] Having the ability to mask any value in a response body #224

Closed DannyDainton closed 2 years ago

DannyDainton commented 4 years ago

Being able to specify a certain key, by a CLI flag that you give you the ability to mask its value in the final report.

Something like this example in the App but from within the reporter:

https://github.com/DannyDainton/newman-reporter-htmlextra/pull/222#issuecomment-629758343

let maskValue = '*******',
    ld = require('lodash');

let masker = ld.cloneDeepWith(pm.response.json(), (value, key) => {
    if (ld.some(['url', 'test', 'cookie'], item => ld.toLower(key) === ld.toLower(item))) {
        return maskValue;
    }
    if (ld.isObject(value)) {
        return;
    }
    return value;
})

console.log(masker)
82138888-be273180-981b-11ea-90ae-6bc7904aa7af

Must be able to work for both JSON and XML responses and fall back to the default response if the conditions are not met. The code above will only work with JSON with a very simplified structure.

DannyDainton commented 3 years ago

Hey @adityaofficial10

If you're ever looking for projects to contribute too that have a Newman flavour to them, I have a few features and issues here that could do with some love from the community. 😁

adityaofficial10 commented 3 years ago

Hey @DannyDainton ! Sure, I had a look at the project and I'll start taking up issues which I feel I can work on. Thanks for this.. Btw can I ask you if Postman is looking forward to GSoC 2021?😅