bitw
bitw copied to clipboard
Serve does not detect changes coming from sync
Hi there,
I'm checking out your project after reading through this thread. I'm happy to see it's still being maintained and worked on, this is definitely something the Bitwarden ecosystem needs in my humble opinion!
After building the application as per your instructions, I:
- Logged in
- Ran
sync
- Started
serve
- In a different terminal, I verified that I could retrieve a decrypted password using
secret-tool
- Changed a password in Bitwarden's Firefox extension
- Ran
secret-tool
again, and it produced the same password - Ran
sync
again, and itsecret-tool
produced the same password - Restarted
serve
and ransecret-tool
once again, and the new password shows up
It seems like serve
is not currently detecting when sync
is invalidating cached passwords :)
That sounds like a bug :) want to send a PR?
There are plenty of tests, but I'm not sure how to cover this well, given that the tests currently use static bitwarden data. Adding a TODO in the tests to cover this scenario would be good enough for now.
All my free coding time is being spent on building an app for a job I'm interviewing for /right now/, but after I will give this a go, as I'd like to use bitw.
I'd also like to see about having a gui interface for inserting passwords, like with gnome-keyring & pinentry. Have you had any thoughts on how you might like that implemented?
I'd still welcome a patch here, for what it's worth.
Sorry that I missed your question about password prompts. That's https://github.com/mvdan/bitw/issues/4.
The simplest fix here would likely be to teach serve
to watch data.json
for changes, and re-load it if so. There should be portable Go packages to support watching for file changes in multiple OSs. If the system does not support it, we could always fall back to reloading the file every five minutes or so.