Securing CLI Auth: Crafting a Shell Plugin for 1Password

Parthiv MakwanaParthiv Makwana
5 min read

Chapter 1: Password Pains and Forgotten Frustrations

Passwords have long been a source of frustration in the digital realm. Many of us have fallen victim to reusing passwords or selecting weak and easily guessable ones like "qwerty" or "123456." However, there is good news! 1Password, the leading password management solution, has teamed up with Hashnode, the popular developer platform, to provide developers with an opportunity to unleash their creativity and expertise in creating a security-enhancing tool that is both convenient and robust. This collaboration invites developers to contribute to the development of a new feature using 1Password or to contribute to the enhancement of the existing shell plugin.

Chapter 2: Let's Know about 1Password 🔒🔒

1Password is the ultimate password guardian, making your passwords unforgettable and safer than a vault guarded by dragons. It stores your precious passwords with the utmost security, so hackers can only dream of getting their hands on them. And forget about those old-school passwords! 1Password lets you authenticate with your fingerprints, because let's face it, your fingerprints are as unique as your funky dance moves. And if you're feeling extra fancy, you can even enjoy passwordless authentication with a mere wave of your magical passage. Sorry, hackers, you'll need more than a black hat and a bad attitude to crack 1Password's fortress of protection!

Chapter 3: Enter the World of Shell Plugins🔌🔌

🌟 Embracing the spirit of Open Source, 1Password has conjured a magical shell plugin repository on GitHub, beckoning developers like you to request new plugins or contribute your enchanting creations. Don't worry, crafting these plugins is no herculean task. 🧙‍♂️ With comprehensive documentation, it's as easy as waving a wand (well, almost). ✨ With 1Password Shell Plugins, you can securely authenticate third-party command-line interfaces using your fingerprint, Apple Watch, or system authentication. Say goodbye to the hassle of manual credential entry or storing them in risky plaintext. "Goodbye to boredom!" Let the shell plugins sprinkle a touch of security on your CLI experience! 🚀✨

Get Started

Chapter 4: My Journey Begins🧙‍♂️🧙‍♂️

While browsing the Hashnode website, I stumbled upon information about 1Password. Despite working on it just 7 days before its conclusion, I remained determined to contribute to the project. 🔍 To actively participate, I decided to learn GoLang, the programming language used for developing the shell plugin. Initially, I had reservations, much like Nobita when faced with Gian and Suneo. 😅 However, as I persisted and followed various learning resources and tutorials, I realized that teamwork, just like with Nobita and his friends, can yield the best results.🤝This parallel motivated me, and I found the GoLang documentation and tutorials to be surprisingly comprehensible. 📖Empowered by this newfound knowledge, I enthusiastically began making significant contributions to the project.🌟

Chapter 5: MY Contribution🥳🥳

🔍 I began my journey by stumbling upon an open issue requesting shell plugins for Scaleway. This discovery served as my starting point, and with the help of existing plugins' code, documentation, and the advice of the maintainer, I gained confidence in my abilities. 📚✨

Once I became more comfortable, I thought, "Why not contribute more?" Since I had some familiarity with certain databases from my work on MindsDB's Database Handlers, I decided to write shell plugins for databases like CrateDB, YugabyteDB, and Vertica. Additionally, I even contributed a shell plugin for Cohere!

Now, armed with my trusty shell plugins and a sprinkle of humour, I'm ready to take on new challenges and continue my journey as a contributor. 🚀😄

Chapter 6: Provisioners and Importers: The Dynamic Duo🧐🧐

Provisioner helps to get things ready needed by CLI while execution

Provision: Think of provision as the handyman of your shell plugin. It takes care of all the setup and preparation work before your CLI tool starts running. It's like having a personal assistant who sets the stage for your CLI tool to authenticate and do its thing. Provisioners can create files, set environment variables, add command-line arguments, and even generate temporary credentials. They work behind the scenes, ensuring everything is in place for a smooth authentication process. So, provision is like the unsung hero who makes sure your CLI tool is ready to rock!

Importer scans the system to find something which looks like credentials which can help it.

Importer: Now, let's talk about the importer, the Sherlock Holmes🧐 of your shell plugin. Its mission is to search high and low, through the user's environment and file system, in search of the precious credentials your CLI tool needs. The importer is like a detective on a treasure hunt, examining every nook and cranny for those elusive pieces of information. It scans your system, sniffs out any occurrences of the required credentials, and prompts the user to import them one by one into 1Password. So, the importer is like the secret agent who tracks down the credentials and ensures they find their way to the right place.

In short, provision sets up the stage for your CLI tool to authenticate, while the importer plays the detective, finding and importing the necessary credentials. They work together behind the scenes, making your shell plugin a powerful tool that saves you time and effort.

Remember, even if the CLI you're working on is complex, you can always refer to other shell plugin codes as your trusty guide. Happy coding and may your provisioners be efficient and your importers be successful in their detective work!

Chapter 7: Conclusion😋😋

Hey there! So, creating a plugin is like embarking on a marvellous adventure. But guess what? The best guide for this epic quest is the super-duper documentation! It's like a treasure trove of knowledge, filled with easy-to-understand language, step-by-step guides, and all the prerequisites you need.

Now, don't worry if you're not a coding wizard yet. Even if you're a newbie to Go, the documentation has got your back. It's like having a friendly mentor by your side. Just spend a couple of hours going through the basics of Go, of course, you won't become a master in that time. But hey, it will introduce you to the magical world of Go syntax and rules.

So, let the adventure begin! Dive into that documentation and unleash your inner plugin-crafting hero. Happy coding!

Resources

1
Subscribe to my newsletter

Read articles from Parthiv Makwana directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Parthiv Makwana
Parthiv Makwana