TylerLeonhardt / SecretManagement.LastPass

A PowerShell SecretManagement extension for LastPass
MIT License
46 stars 9 forks source link

Test-Vault fails. #29

Open jdhitsolutions opened 3 years ago

jdhitsolutions commented 3 years ago

Not sure why this fails.

test-vault

The vault and extension work fine otherwise.

TylerLeonhardt commented 3 years ago

Here's the logic for it:

https://github.com/TylerLeonhardt/SecretManagement.LastPass/blob/main/SecretManagement.LastPass.Extension/SecretManagement.LastPass.Extension.psm1#L398-L409

what does lpass status return for you.

jdhitsolutions commented 3 years ago

I have to run wsl lpass status in Windows and I get a "not logged in" message. Even though I can run Get-Secret and Get-SecretInfo from my lastpass vault.

jdhitsolutions commented 3 years ago

I went into WSL and logged in to Lastpass. Then back in Windows Test-SecretVault works. Your test code is odd because even though the test technically fails, I can still extract secrets from the vault. Or it would be helpful to have more verbose detail about what Test-SecretVault is actually doing.

TylerLeonhardt commented 3 years ago

Yeah I'm not 100% sure what Test-SecretVault should really be doing. I'm tempted to always return true but I want it to provide some value.

jdhitsolutions commented 3 years ago

From what I can infer, the test can be anything you want. I would assume it is to ensure "integrity" which in this case I'd have to think means being able to read from the vault, or somehow verifying that the vault isn't corrupt. lpass status doesn't seem to offer much value. Maybe verifying that lpass ls doesn't throw an error?

TylerLeonhardt commented 3 years ago

Yeah that's probably the best bet. Would you like to contribute that? I'm going to need to find a new maintainer eventually for this repo as I don't use LastPass anymore :(

jdhitsolutions commented 3 years ago

I can try to give this a go. I'll have to get set up to submit PRs to the repo.