Closed saraid closed 3 years ago
Hi Michael,
Thanks for the pull request. I'll take a look as soon as I can. Most likely today or tomorrow. I would like to try it out myself and then I'll merge it, if it works well. Could explain in one or two sentences how to create a test case for your feature? Where do I have to click to create a note you meant to parse? Thanks.
On Mon, Oct 26, 2020, 23:25 Michael Chui notifications@github.com wrote:
Hello,
I store some files as Secure Notes and would like to be able to access them using Ruby. This seemed like the best way to do that. I tried to follow your style and design choices, but if there's anything you'd like done differently, please let me know.
You can view, comment on, or merge this pull request online at:
https://github.com/detunized/lastpass-ruby/pull/16 Commit Summary
- interpet and expose Secure Notes
File Changes
- M lib/lastpass.rb https://github.com/detunized/lastpass-ruby/pull/16/files#diff-18044481610a2a1471e5dce5d65cd53614fd135b5a737ab882cdbdad2d0b6dff (1)
- A lib/lastpass/note.rb https://github.com/detunized/lastpass-ruby/pull/16/files#diff-d8bb30cc9642a8311336dfd9db4bec5d436b48520760e72f5a83f8e507381435 (15)
- M lib/lastpass/parser.rb https://github.com/detunized/lastpass-ruby/pull/16/files#diff-a0f3219e52de600ef1a9f45cb1ec427e45110c7d3f671d6392953d5823c5fb5d (6)
- M lib/lastpass/vault.rb https://github.com/detunized/lastpass-ruby/pull/16/files#diff-4fa4e9c708e9b59b5a5d8bd3369ab94aaba8784d44af08f7bde842a271ad41f6 (16)
Patch Links:
- https://github.com/detunized/lastpass-ruby/pull/16.patch
- https://github.com/detunized/lastpass-ruby/pull/16.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/detunized/lastpass-ruby/pull/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB35EL5SQAEIYXIP3JXAHDSMXZL7ANCNFSM4S77ZQ5A .
Sure.
From the Vault,
This lets me give my note an arbitrary name and folder, as shown here:
(Tue 11:38:21):~/Developer/github/lastpass-ruby [saraid/add-secure-notes] % bundle exec irb
irb(main):001:0> load 'lib/lastpass.rb'
=> true
irb(main):002:0> vault = LastPass::Vault.open_remote ENV['LASTPASS_USER'], ENV['LASTPASS_PASS']; nil
=> nil
irb(main):003:0> vault.notes.find { |n| n.name == 'test test' }.notes
=> "just a note"
As an aside, all accounts have a "Notes" field; this is something already parsed by Parser.parse_ACCT
: but it's dropped when you build the Account object. I chose not to change this, since I wasn't sure about your design decision, but you could pretty easily change that if you wanted.
As an aside, all accounts have a "Notes" field; this is something already parsed by
Parser.parse_ACCT
: but it's dropped when you build the Account object. I chose not to change this, since I wasn't sure about your design decision, but you could pretty easily change that if you wanted.
This is an oversight. For a while I have not been looking into this library. I'm mainly busy with a grand-grand-son of this library https://github.com/detunized/password-manager-access. I just realized there I'm also discarding them. Thanks for the tip. I can fix that.
Merged. Thanks for the PR! I'll release this soon and will let you know.
Thank you very much!
@saraid, version 1.7.0 pushed to RubyGems. I also added the @notes
property to the Account
class.
Hello,
I store some files as Secure Notes and would like to be able to access them using Ruby. This seemed like the best way to do that. I tried to follow your style and design choices, but if there's anything you'd like done differently, please let me know.
I'm not confident in my ability to modify the test data to include Secure Notes, so I haven't touched the tests.