-
Notifications
You must be signed in to change notification settings - Fork 12
feat: backup_cli store secrets in json file #1301
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_cli store secrets in json file #1301
Conversation
netrome
left a comment
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.
As this is greenfield work I'd like us to prioritize adding tests alongside any new functionality. While the code looks correct (-ish, since we do sync I/O from an async function), I would like to see tests. Ideally the tests do not require filesystem interactions either, which requires a design update.
Ideally I'd picture LocalSecretsStorage to be a generic type that holds some type of handle we could read and write to. In production this would be an tokio::fs::File object for the secrets.json file. but in tests a plain Vec should do.
|
I added an example for how to make the storage implementation testable without touching the file system in #1304 |
…kup-services-secret-key-after-running-the-generate-keys-subcommand
netrome
left a comment
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.
Thank you for bearing with me. Just some nits but otherwise looks great. Ideally we'd use dedicated error types but I'm okay with skipping that for now.
netrome
left a comment
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.
Nice stuff!
Closes #1293