Skip to content

Commit b0cc1f4

Browse files
fix: add isinstance(decoded, dict) validation for secrets JSON
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
1 parent 01ddcd5 commit b0cc1f4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/profiles/generate_profiles.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ def main(
8787
raise click.ClickException(
8888
f"Failed to decode ${secrets_json_env}: {e}"
8989
) from e
90+
if not isinstance(decoded, dict):
91+
raise click.ClickException(
92+
f"Expected JSON object for ${secrets_json_env}, "
93+
f"got {type(decoded).__name__}"
94+
)
9095
for key, value in decoded.items():
9196
context[key.lower()] = value
9297
click.echo(

0 commit comments

Comments
 (0)