Go SSH with Host Key Verification

Hi folks. Following a long search and reading lots of debates and possibilities of doing SSH within Go, I was shocked to see that not a great many tools and people use SSH with host key verification. What I usually see is this: HostKeyCallback: ssh.InsecureIgnoreHostKey() This is terrible. Now, I realise that doing HostKeyVerification can be tedious, but don’t fear. It’s actually easy now that the Go team provided the knownhosts subpackage in their crypto SSH package located here: KnownHosts. ...

February 17, 2019 · 2 min · hannibal

Extensive tutorial on go-plugin.

Intro If you don’t know what go-plugin is, don’t worry, here is a small introduction on the subject matter: Back in the old days when Go didn’t have the plugin package, HashiCorp was desperately looking for a way to use plugins. In the old days, Lua plus Go wasn’t really a thing yet, and to be honest, nobody wants to write Lua ( joking!). And thus Mitchell had this brilliant idea of using RPC over the local network to serve a local interface as something that could easily be implemented with any other language that supported RPC. This sounds convoluted but has many benefits! For example, your code will never crash because of a plugin and the ability to use any language to implement a plugin. Not just Go. ...

October 29, 2018 · 17 min · hannibal

Furnace with a new Plugin System

Hi. A quick update, but a very important and interesting one hopefully. Furnace just got a massive boost to its plugin system. I’m using HashiCorp’s Go-Plugins system now to handle plugins. This means one of two things that are interesting to the plugin author. One, plugins can be written in any language which is supported by Furnace and supports GRPC. Currently this means that plugins can be written in the following languages: ...

September 17, 2018 · 1 min · hannibal

Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 4

Intro Hi folks. Previously on this blog: Part 1. Part 2. Part 3. In this part we are going to talk about Unit Testing Furnace and how to work some magic with AWS and Go. Mock Stub Fake Dummy Canned Unit testing in Go usually follows the Dependency Injection model of dealing with Mocks and Stubs. ## DI Dependency Inject in short is one object supplying the dependencies of another object. In a longer description, it’s ideal to be used for removing the lock on a third party library, like the AWS client. Imaging having code which solely depends on the AWS client. How would you unit test that code without having to ACTUALLY connect to AWS? You couldn’t. Every time you try to test the code it would run the live code and it would try and connect to AWS and perform the operations it’s design to do. The Ruby library with it’s metaprogramming allows you to set the client globally to stub responses, but, alas, this is not the world of Ruby. ...

April 16, 2017 · 6 min · hannibal

Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 3

Intro Hi folks. Previously on this blog: Part 1. Part 2. Part 4. In this part, I’m going to talk about the experimental plugin system of Furnace. Go Experimental Plugins Since Go 1.8 was released, an exciting and new feature was introduced called a Plug-in system. This system works with dynamic libraries built with a special switch to go build. These libraries, .so or .dylib (later), are than loaded and once that succeeds, specific functions can be called from them (symbol resolution). ...

March 22, 2017 · 3 min · hannibal

Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 2

Intro Hi folks. Previously on this blog: Part 1, Part 3, Part 4 In this part, I’m going to talk about the AWS Go SDK and begin do dissect the intricacies of Furnace. AWS SDK Fortunately, the Go SDK for AWS is quiet verbose and littered with examples of all sorts. But that doesn’t make it less complex and less cryptic at times. I’m here to lift some of the early confusions, in hopes that I can help someone to avoid wasting time. ...

March 19, 2017 · 9 min · hannibal

Furnace - The building of an AWS CLI Tool for CloudFormation and CodeDeploy - Part 1

Other posts: Part 2, Part 3, Part 4. Building Furnace: Part 1 Intro Hi folks. This is the first part of a 4 part series which talks about the process of building a middlish sized project in Go, with AWS. Including Unit testing and a experimental plugin feature. The first part will talk about the AWS services used in brief and will contain a basic description for those who are not familiar with them. The second part will talk about the Go SDK and the project structure itself, how it can be used, improved, and how it can help in everyday life. The third part will talk about the experimental plugin system, and finally, we will tackle unit testing AWS in Go. ...

March 16, 2017 · 7 min · hannibal

How to do Google Sign-In with Go - Part 2

Intro Hi Folks. This is a follow up on my previous post about Google Sign-In. In this post we will discover what to do with the information retrieved in the first encounter, which you can find here: Google Sign-In Part 1. Forewords The Project Everything I did in the first post, and that I’m going to do in this example, can be found in this project: Google-OAuth-Go-Sample. Just to recap, we left off previously on the point where we successfully obtained information about the user, with a secure token and a session initiated with them. Google nicely enough provided us with some details which we can use. This information was in JSON format and looked something like this: ...

November 2, 2016 · 6 min · hannibal

How to do Google sign-in with Go

Hi folks. Today, I would like to write up a step - by - step guide with a sample web app on how to do Google Sign-In and authorization. ...

June 12, 2016 · 6 min · hannibal