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

Decrypt password for list operation #140

Closed
egze opened this issue Oct 28, 2024 · 8 comments
Closed

Decrypt password for list operation #140

egze opened this issue Oct 28, 2024 · 8 comments

Comments

@egze
Copy link
Contributor

egze commented Oct 28, 2024

Currently the list returns the cards without the password. This makes the CLI unusable for certain scripting tasks.

Thing that I am working on is a adapter for Kamal, a tool for deploying web application.

The way the secret adapters in Kamal work - the function receives a list of secrets to fetch, (example ["database-password", "cookie", "whatever"], then the cli fetches the list of secrets for these items, and creates a map of name => password.

So to create an adapter for Enpass, I would need to have the CLI list function to decrypt the cards and return also the password.

Reference implementation for LastPass: https://github.com/basecamp/kamal/blob/main/lib/kamal/secrets/adapters/last_pass.rb

@hazcod
Copy link
Owner

hazcod commented Oct 28, 2024

Hi! @egze, what kind of output format are you expecting?

@egze
Copy link
Contributor Author

egze commented Oct 29, 2024

There are 2 things that would make it better:

  1. When using the list function, it should also output decrypted password for each item. Maybe when using additional -password option? This is a must.
  2. Have json output. Then it will be easier to work with it in other scripts. -json option? This is optional, but really nice. It would then output an array for list, and an object for show.

what do you think?

@egze
Copy link
Contributor Author

egze commented Nov 2, 2024

I just realised that I can achieve my feature with existing functionality. I haven't noticed that the show command can also list many passwords at once. I'll try it out.

But JSON output would still be nice.

@egze
Copy link
Contributor Author

egze commented Nov 6, 2024

Made a PR for JSON support #142

@hazcod
Copy link
Owner

hazcod commented Nov 7, 2024

Fixed the release process, thank you for the PR @egze !

@hazcod hazcod closed this as completed Nov 7, 2024
@egze
Copy link
Contributor Author

egze commented Nov 7, 2024

Thanks. I wonder now how to update the package in brew.

https://github.com/Homebrew/homebrew-core/blob/master/Formula/e/enpass-cli.rb

Where do these checksums come from 🤔

bottle do
    sha256 cellar: :any_skip_relocation, arm64_sequoia:  "6e6da1fb226a63e84791e495b0db8921bd6dcc975bc34c6704153fd9769610a6"
    sha256 cellar: :any_skip_relocation, arm64_sonoma:   "50d816314d8d2c7ffd19e34af768d1d26b2b25f77c47d03701f1458a66c9c219"
    sha256 cellar: :any_skip_relocation, arm64_ventura:  "f020f03b420e9863eea1b148f0f283b7c2b94d5abfa75dbebf4b6796ce2ca732"
    sha256 cellar: :any_skip_relocation, arm64_monterey: "4b45086b51461ca2843f3fc86f7a3b2ba774ecbbbca3ea7af02433930752d598"
    sha256 cellar: :any_skip_relocation, sonoma:         "89d29dd4c46ed305ecb14a11e7584efa0f60d9a78a7d631d180d79e70056d00f"
    sha256 cellar: :any_skip_relocation, ventura:        "ec06930c8a76bfcc382ffe6872134bdc6ae7954135fa6ce839d5d4ef2c29dbd8"
    sha256 cellar: :any_skip_relocation, monterey:       "27a6addea1a89fc6cfc20d05d0dd5a88e64e83a4eae73a2b772e47b8687aa995"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "8b91a9dbca42279f92ee3180d2431b65dfc622585c4091a943f3088015b55b88"
  end

@hazcod
Copy link
Owner

hazcod commented Nov 7, 2024

Thanks. I wonder now how to update the package in brew.

https://github.com/Homebrew/homebrew-core/blob/master/Formula/e/enpass-cli.rb

Where do these checksums come from 🤔

bottle do
    sha256 cellar: :any_skip_relocation, arm64_sequoia:  "6e6da1fb226a63e84791e495b0db8921bd6dcc975bc34c6704153fd9769610a6"
    sha256 cellar: :any_skip_relocation, arm64_sonoma:   "50d816314d8d2c7ffd19e34af768d1d26b2b25f77c47d03701f1458a66c9c219"
    sha256 cellar: :any_skip_relocation, arm64_ventura:  "f020f03b420e9863eea1b148f0f283b7c2b94d5abfa75dbebf4b6796ce2ca732"
    sha256 cellar: :any_skip_relocation, arm64_monterey: "4b45086b51461ca2843f3fc86f7a3b2ba774ecbbbca3ea7af02433930752d598"
    sha256 cellar: :any_skip_relocation, sonoma:         "89d29dd4c46ed305ecb14a11e7584efa0f60d9a78a7d631d180d79e70056d00f"
    sha256 cellar: :any_skip_relocation, ventura:        "ec06930c8a76bfcc382ffe6872134bdc6ae7954135fa6ce839d5d4ef2c29dbd8"
    sha256 cellar: :any_skip_relocation, monterey:       "27a6addea1a89fc6cfc20d05d0dd5a88e64e83a4eae73a2b772e47b8687aa995"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "8b91a9dbca42279f92ee3180d2431b65dfc622585c4091a943f3088015b55b88"
  end

The homebrew bottles are nowadays automatically updated within 3 hours;

% brew bump-formula-pr --dry-run --version=1.6.3 enpass-cli 
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Error: Whoops, the enpass-cli formula has its version update
pull requests automatically opened by BrewTestBot every ~3 hours!
We'd still love your contributions, though, so try another one
that's not in the autobump list:
  https://github.com/Homebrew/homebrew-core/blob/master/.github/autobump.txt

@hazcod
Copy link
Owner

hazcod commented Nov 7, 2024

Here it is: Homebrew/homebrew-core#196954

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

No branches or pull requests

2 participants