Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding secrets cat command and removing secrets get command #282

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

aryanjassal
Copy link
Contributor

@aryanjassal aryanjassal commented Sep 16, 2024

Description

This PR tracks the status of implementing secrets cat command, which can be used to concatenate multiple secrets together.

Issues Fixed

Tasks

  • 1. Add secrets cat command
  • 2. Remove secrets get command
  • 3. Add support for concatenating multiple files from multiple vaults together
  • 4. Redirect stdin to stdout if no arguments are provided
  • 5. Add tests for new functionality

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

Copy link

linear bot commented Sep 16, 2024

[ci skip]

feat: removed Secrets/CommandGet and added tests
[ci skip]

chore: working on stdin test
[ci skip]

bug: working on adding test for stdin to stdout
[ci skip

bug: still working on that error
[ci skip]

chore: fixed stdin test
[ci skip]

feat: updated secrets edit with new secrets get RPC
[ci skip]

fix: build
[ci skip]
@aryanjassal aryanjassal marked this pull request as ready for review September 20, 2024 02:07
Comment on lines +74 to +76
if (!(await response.output).success) {
throw new errors.ErrorPolykeyCLIFileRead('Failed to delete file');
}
Copy link
Contributor Author

@aryanjassal aryanjassal Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need feedback on this. How do I handle a non-zero success code?

In Polykey, the RPC will either return a true success code, or throw an error. It will never return a non-zero success code. To ignore the return code (which, in this case, is what we can do) and simply await the output, we can do this:

await response.output

Or do I need to properly handle it? I guess handling it properly would be future-proof, but I would need to make proper error throwing and handling. I'm not sure if an error already exists which can be thrown at a non-zero return code.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant