damccorm commented on code in PR #36321:
URL: https://github.com/apache/beam/pull/36321#discussion_r2402818771
##########
sdks/python/apache_beam/transforms/util.py:
##########
@@ -341,6 +341,44 @@ def generate_secret_bytes() -> bytes:
"""Generates a new secret key."""
return Fernet.generate_key()
+ @staticmethod
+ def parse_secret_option(secret) -> 'Secret':
+ """Parses a secret string and returns the appropriate secret type.
+
+ The secret string should be formatted like:
+ 'type:<secret_type>;<secret_param>:<value>'
+
+ For example, 'type:GcpSecret;version_name:my_secret/versions/latest'
+ would return a GcpSecret initialized with 'my_secret/versions/latest'.
+ """
+ param_map = {}
+ for param in secret.split(';'):
+ parts = param.split(':')
+ param_map[parts[0]] = parts[1]
Review Comment:
This should be ok, there will not be urls for now, and we can escape them if
needed down the line
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]