my photo

My personal bin to put stuff around, it will definitely change… or not? who knows


Introducing Faraday::Midddlewares::BuildService

📆: 2023-11-27 - 🏷: blog, ruby, http, rubygem


It’s been a journey since Multi-factor authentication on SUSE’s Build Service @ suse.com blog, but now there’s code to show! 🎉

A Faraday middleware for Build Service Authentication is now live!

Check it out at https://github.com/SUSE/faraday-middleware-bs-auth

So what’s the need for this?

Cuz… don’t repeat code? Yep, that pretty much sums it.

I don’t know whether it’s well known or technical-enough to be public information, but there’s a special authentication mechanism for the build service (see the blogpost) that we needed some workloads to support.

The majority of the workloads we maintain are written in Ruby, and after copypasting the original implementation once, we decided to make a gem out of it.

So, yep, DRY.

What’s special

Honestly? Nothing, it’s just a middleware that will retry requests with the requested authentication.

The blogpost @ suse.com really gets to the technical reference and the gem is just an implementation of it.