package Confman::API;
use strict;
use IO::File;
use JSON;
use REST::Client;
use MIME::Base64;
use Digest::MD5 qw(md5_hex);
sub new {
my $class = shift;
my $self = bless({}, ref($class) || $clas
g_dir} ||= "/etc/confman";
$self->{json} = JSON->new->allow_nonref;
$self;
}
sub config_path {
my $self = shift;
return $self->{config_dir} . "/config.json"
}
sub api_key {
my $self = shif
g_path) {
my $fh = IO::File->new($config_path);
local $/ = undef;
my $config = $self->json->decode(<$fh>);
$fh->close();
while(my ($key, $value) = each(%$config)) {
$self->{