Credentials in Hanami 2

Hi Yall :wave:

A while ago, I’ve created the lightweight and dependency-free dry-credentials gem which occupies a ground floor room in the Dry Hotel, my bow to this inspiring suite of gems.

With Hanami 2.1 fresh out of the oven, I finally started with a pet project of mine and thanks to @swilgosz, it’s coming along quite nicely. Just love how e.g. dry-configurable prevents so much headache down the line. However, I still prefer to commit db, mail, API credentials to git in order not having to juggle ENV variables.

So I gave integration of dry-credentials into the Hanami 2 app a shot and it was a ridiculously smooth ride – mostly thanks to the design of Hanami. All it took was a small provider and a Rake task for convenience as outlined here:

Since I’m still a greenhorn on Hanami, I’d love to get your feedback e.g. if there’s a better way to integrate it.

Cheers!

2 Likes