Python: Extend SensitiveDataSource tests

Now it contains all the sort of things we actually support 👍
This commit is contained in:
Rasmus Wriedt Larsen
2021-04-15 11:47:43 +02:00
parent 794a86a6b0
commit 499adc26a3

View File

@@ -19,3 +19,15 @@ get_secret() # $ SensitiveDataSource=secret
fetch_certificate() # $ SensitiveDataSource=certificate
account_id() # $ SensitiveDataSource=id
safe_to_store = encrypt_password(pwd)
# attributes
foo = ObjectFromDatabase()
foo.secret # $ SensitiveDataSource=secret
foo.username # $ SensitiveDataSource=id
# Special handling of lookups of sensitive properties
request.args["password"], # $ MISSING: SensitiveDataSource=password
request.args.get("password") # $ SensitiveDataSource=password
# I don't think handling `getlist` is super important, just included it to show what we don't handle
request.args.getlist("password")[0] # $ MISSING: SensitiveDataSource=password