Overall, should this be factored into the existing cm library files? There's a reused CM connection in there which might be better to use than reimplementing this here.

It also supports the other methods of providing auth (like encrypted data bags), which I know are used at least by one of my repositories to configure the cookbook.