Monday 22 May 2023

Using 1Password to store API keys ...

 Following on from my earlier post: -

Wow, why have I not been using 1Password for my SSH keys before today ? 

I've got a little further, with various API keys now stored in my 1Password vault

This is far simpler, in that the vault entry, of type API Credential, only needs to have a name/title e.g. IBM Cloud API Key and a credential, the actual API key itself.

With that in place, I've then setup an alias to retrieve/display the API key: -

apikey='export APIKEY=$(op item get "IBM Cloud" --field credential) && echo $APIKEY'

in ~/.zprofile, meaning that I just need to run the "command" apikey to ... see my API key.

I will, of course, be leveraging the same API keys in various other scripts/aliases, including things that login to IBM Cloud etc.


No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...