Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- def encrypt_me(value):
- return 'foobar'
- def secret_filter(config):
- for key, value in config.items():
- if isinstance(value, dict):
- secret_filter(value)
- if isinstance(value, list):
- secret_filter(value)
- print(f'{key} {value}')
- if input() == 'y':
- config[key] = encrypt_me(value)
- if __name__ == '__main__':
- with open('package-lock.json', 'r+') as f:
- check = json.load(f)
- secret_filter(check)
- json.dump(check, f)
Add Comment
Please, Sign In to add comment