buchhalter-ai / buchhalter-ai-cli

The buchhalter open-source command line tool to automate invoice downloads from suppliers. Free, customizable, and designed for seamless financial workflow integration.
https://buchhalter.ai
Other
4 stars 1 forks source link

Vault: Remove global usage of Vault and introduce a Vault Provider type #11

Closed andygrunwald closed 5 months ago

andygrunwald commented 5 months ago

Why this change?

The vault package was a single, globally used package. Several other packages had dependencies on the global variables of the vault package. Access (read/write) was hard to track.

We introduce a type of "Provider" object. This way, we can instantiate multiple Vaults of different Vault providers if needed.

What is this PR doing?

What is still TODO?

brgmn commented 5 months ago

Nice work! Thanks! The changes seem to work and make sense! Only the error message when not connected to a vault is a bit cryptic now. Can we make this more user-friendly again? (e.g. just "Could not connect to 1Password vault. Open 1Password vault with "eval $(op signin)", first.").

Bildschirmfoto 2024-04-01 um 11 05 38
andygrunwald commented 5 months ago

@brgmn Done in https://github.com/buchhalter-ai/buchhalter-ai-cli/pull/11/commits/5ce216b1dfe634f154ea8f50be21dc35baa13035

The idea with these "error codes" was that if we get error messages, we know where it fails and can also offer a FAQ if necessary. Just a thought, but not needed at the moment.