garnaat / placebo

Make boto3 calls that look real but have no effect.
Apache License 2.0
394 stars 28 forks source link

Feature request - Masking ARN #58

Open jamesdehart opened 7 years ago

jamesdehart commented 7 years ago

When recording AWS API's for unit tests. I would love to be able to mask the account number in the ARN with a fake number provided by AWS. 123456789012

It would be as simple as re.sub(':(\d{12}:)', ':123456789012:', response_data) somewhere here https://github.com/garnaat/placebo/blob/develop/placebo/pill.py#L242-L243.

It would be good to have a flag if someone wanted to mask or not mask the account number of the arn.

Thoughts? @garnaat

mcrowson commented 7 years ago

I would love this as well.

jamesdehart commented 7 years ago

I'm going to post a PR that will fix this.

jamesdehart commented 7 years ago

PR has been posted ==> #59

JohnPreston commented 3 years ago

Solved that with pre-commit https://github.com/compose-x/ecs_composex/blob/main/.pre-commit-config.yaml#L11 https://github.com/compose-x/ecs_composex/blob/main/.scripts/cleanup_placebo.sh It is not the cleanest way but saves me from having to worry about it before commit