-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: backup vault k8s secrets to s3 encrypted. #142
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for this! The non-standard formatting is a blocker. I have some questions about the layout of the code and your cli opts as well.
3886d27
to
dcf298c
Compare
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 hold this PR pending this ticket. |
def symmetric_encrypt(key, iv, message): | ||
"""AES256 encrypt message and return ciphertext | ||
params are all str | ||
ciphertext returned is in bytes | ||
""" |
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.
def symmetric_encrypt(key, iv, message): | |
"""AES256 encrypt message and return ciphertext | |
params are all str | |
ciphertext returned is in bytes | |
""" | |
def symmetric_encrypt(key: str, iv: str, message: str) -> bytes: | |
"""AES256 encrypt a message. | |
Returns | |
------- | |
ciphertext: bytes | |
""" |
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.
Switches to using a typed function signature and use a standard docstring format (numpydoc in this case, which is commonly used in python and IDEs support).
def validate(artsy_env, vault_host, vault_port, s3, s3_bucket): | ||
"""validate config obtained from env and command line""" | ||
if not (vault_host and vault_port): | ||
raise Exception( |
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.
This and the following exceptions could use the built-in ValueError
instead. Use of generic Exception
is generally to be avoided in favour of more specific errors.
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.
A couple of non-blocking suggestions, otherwise looks good from a python coding conventions perspective.
This repo is public.
The type of this PR is: Feat
This PR solves PHIRE-1618
Description
Shared env has been updated, with instruction on how to decrypt.
Before-merging tasks: