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

Raise meaningful error messages when secret adapter CLIs are not installed #1121

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

kylerippey
Copy link
Contributor

While configuring the 1Password secrets adapter I kept running into a confusing error ("Failed to login to 1Password") despite having followed the documentation and read through some issues threads. I ultimately had to dive into the code to discover that it relies on a CLI that I didn't have installed.

I figured surfacing a meaningful error message when the CLI is missing might save a lot of folks time in the future.

To achieve this I added a check_dependencies! method to all adapters that gets called as the first line in the fetch method. For now each one just checks that the CLI is installed, but it's behavior could be expanded in the future. (For example, after installing the 1Password CLI you also need to configure it. In the future, the 1Password adapter's check_dependencies! method could be expanded to also check that the CLI is configured.)

I'm open to any and all feedback on this. Thanks!

@djmb djmb merged commit 53dad5f into basecamp:main Oct 23, 2024
8 checks passed
@kylerippey kylerippey deleted the adapter-cli-installation-checks branch October 25, 2024 22:48
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

Successfully merging this pull request may close these issues.

2 participants