You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have added a draft PR (#316) to track this. Still digging into the details of what it would look like, but was easier than I thought it would be to get working (judging on the little time I spent on this)
Ok, so I've done a bit more digging into the go-sdk.
I much prefer it than executing the CLI from within ToolHive. The requirement for users that want to take advantage of the 1Password feature would have to have a service account created already that ToolHive to use (recommendation is probably to have a dedicated one for ToolHive to avoid sharing an existing token) that would be set via the OP_SERVICE_ACCOUNT_TOKEN environment variable and the token creation itself in 1Password is really quick and easy.
I have pushed up the code in the above PR (#316) for a simple secret retrieval. It works really nicely, and doesn't even ask the user to login or authorise your terminal to access 1Password, so it makes it more seamless.
The only slight issue is how the 1Password secrets are represented in our code and how it plays in with the Provider interface. Currently it looks like this:
With the encrypted secrets type that already exists inside of ToolHive, the interface methods make sense because each secret is basically a key-value pairing. This makes it easy to get, set, delete and list. 1Password however, doesn't have the key-value structure. Instead, it follows the op://<vault-name>/<item-name>/[section-name/]<field-name> structure.
This means getting/setting/deleting a secret would be done by path - not by name as the Provider method suggests. This is a trivial detail name/value, the larger issue is the ListSecrets endpoint. You wouldn't be listing the secrets, but instead you'd be listing the "Items" that exist in the vault. This would encompass "Passwords", "API Keys", you name it. This then makes the "Secret" nomenclature slightly misleading.
The above is assuming that we'd want to allow for all of the methods to be implemented. If we at the moment are happy with users being able to Delete, Set and List secrets by going into 1Password directly and only allowing ToolHive to read them, then we can just make them noop methods.
Activity
JAORMX commentedon Apr 30, 2025
Love it! This sounds like a great feature
ChrisJBurns commentedon May 1, 2025
Have added a draft PR (#316) to track this. Still digging into the details of what it would look like, but was easier than I thought it would be to get working (judging on the little time I spent on this)
ChrisJBurns commentedon May 2, 2025
Ok, so I've done a bit more digging into the
go-sdk.I much prefer it than executing the CLI from within ToolHive. The requirement for users that want to take advantage of the 1Password feature would have to have a service account created already that ToolHive to use (recommendation is probably to have a dedicated one for ToolHive to avoid sharing an existing token) that would be set via the
OP_SERVICE_ACCOUNT_TOKENenvironment variable and the token creation itself in 1Password is really quick and easy.I have pushed up the code in the above PR (#316) for a simple secret retrieval. It works really nicely, and doesn't even ask the user to login or authorise your terminal to access 1Password, so it makes it more seamless.
The only slight issue is how the 1Password secrets are represented in our code and how it plays in with the
Providerinterface. Currently it looks like this:With the
encryptedsecrets type that already exists inside of ToolHive, the interface methods make sense because each secret is basically a key-value pairing. This makes it easy to get, set, delete and list. 1Password however, doesn't have the key-value structure. Instead, it follows theop://<vault-name>/<item-name>/[section-name/]<field-name>structure.This means getting/setting/deleting a secret would be done by path - not by name as the
Providermethod suggests. This is a trivial detail name/value, the larger issue is theListSecretsendpoint. You wouldn't be listing the secrets, but instead you'd be listing the "Items" that exist in the vault. This would encompass "Passwords", "API Keys", you name it. This then makes the "Secret" nomenclature slightly misleading.The above is assuming that we'd want to allow for all of the methods to be implemented. If we at the moment are happy with users being able to
Delete,SetandListsecrets by going into 1Password directly and only allowing ToolHive to read them, then we can just make them noop methods.Welcome others thoughts
ChrisJBurns commentedon May 6, 2025
This has been implemented in release 0.0.31