Skip to content

Commit

Permalink
sanitize / in secret names (#1470)
Browse files Browse the repository at this point in the history
* sanitize / in secret names

Its not uncommon and even seems to be recommended by AWS to use `/` in AWS Secret Manager secret names. If used in conjunction with non-JSON secrets, it leads to issues here since we use secret name as environment variable name, and that can't contain `/`

* fix formatting
  • Loading branch information
oavdeev authored Jun 30, 2023
1 parent e11a7c3 commit 9a39bb9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _sanitize_key_as_env_var(key):
Also, it's TBD whether all possible providers will share the same sanitization logic.
Therefore we will keep this function private for now
"""
return key.replace("-", "_").replace(".", "_")
return key.replace("-", "_").replace(".", "_").replace("/", "_")


class AwsSecretsManagerSecretsProvider(SecretsProvider):
Expand Down

0 comments on commit 9a39bb9

Please sign in to comment.