Closed aneilbaboo closed 6 years ago
I like this idea a lot. Trying to understand the code. Does it have limits to how many secrets you can set up? Or limits on how many secrets can be in a single response?
@jimmyeisenhauer No limits. Just call sepia.substitute(...)
with a new key and function.
Updated the PR body to make that clearer.
thanks for the info! I got your PR working. I think it will be really helpful for my needs and my guess others as well. Not just secrets but any kind of replacement you want to do. I am working on DateTime values to be relative instead of hard coded.
I did notice it is only 1 replacement per secret per response. For example if you had actual_value multiple times in the api response that you wanted to sub you would need to create two secret_values with the same actual_value.
I was looking at maybe looping the substituteWithRealValues but curious if you tried this and if performance takes too big of a hit?
Thanks for catching that, @jimmyeisenhauer. I pushed a fix which uses text.split(key).replace(value) to do the substitution in a single pass per substituteWith* call.
Is anyone still maintaining this repo? There are a couple of other PRs that would be nice to get merged.
Ping @vslosh @egoldblum @ethankao @deepankgupta @salvipriyanka @ashimaatul
@aneilbaboo I'm not at LinkedIn anymore, but I'm trying to track down someone there to get the ball rolling. Thanks for your patience.
Awesome. Thanks.
@egoldblum - any luck finding the maintainers?
@aneilbaboo I'll try to find you a maintainer
@egoldblum This seems like a nice fix. It would be really good to get this and other PR's (like my bug fix for Windows) merged. Collecting too many good fixes spread across forks for now.
Note: This replaces the previous PR #20 (which was from my master branch).
Adds substitution capability suggested in #13.
Now you can do:
And the fixtures will contain
<MYSECRET>
and<MYSECRET2>
, while the requests will contain the value of MY_ACCESS_TOKEN and MY_ACCESS_TOKEN2.I added tests, but couldn't quite figure out how to test the fixture files themselves. I did check that they look right, though.
@avik-das - Could you take a look?