-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add secret manager in weather-dl. #374
base: main
Are you sure you want to change the base?
Conversation
api_url=UUUUU1 | ||
secret_key=projects/PROJECT_NAME/secrets/SECRET_NAME/versions/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a separate section that demos secrets mgr. Users should see examples of both ways of adding keys.
@@ -460,6 +461,23 @@ def prepare_target_name(config: Config) -> str: | |||
return target | |||
|
|||
|
|||
def get_secret(secret_key: str) -> t.Dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: please return a t.TypedDict
so we know what keys to look for.
secret_key=projects/PROJECT_NAME/secrets/SECRET_NAME/versions/1 | ||
[parameters.bob] | ||
api_key=KKKKK2 | ||
api_url=UUUUU2 | ||
secret_key=projects/PROJECT_NAME/secrets/SECRET_NAME/versions/1 | ||
[parameters.eve] | ||
api_key=KKKKK3 | ||
api_url=UUUUU3 | ||
secret_key=projects/PROJECT_NAME/secrets/SECRET_NAME/versions/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep these examples.
``` | ||
""" | ||
return [(name, params) for name, params in config.kwargs.items() | ||
return [(name, get_secret(params.get('secret_key'))) for name, params in config.kwargs.items() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should support both API keys and secrets manager.
Fixed #368.