Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dabhicusp
Copy link
Collaborator

Fixed #368.

Configuration.md Outdated Show resolved Hide resolved
@dabhicusp dabhicusp requested a review from alxmrs July 31, 2023 13:02
Comment on lines -202 to +201
api_url=UUUUU1
secret_key=projects/PROJECT_NAME/secrets/SECRET_NAME/versions/1
Copy link
Collaborator

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:
Copy link
Collaborator

@alxmrs alxmrs Aug 1, 2023

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.

Comment on lines +492 to +496
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
Copy link
Collaborator

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()
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make use of secret-manager while using weather-dl for license keys.
3 participants