Prevent Autosecret migration if old secret is > 22 chars (fixes #157)

Change-Id: Ib089a0424bf5ce7984a27e99b3cac46e01abdcec
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index b6a5db0..b850be0 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -8,7 +8,7 @@
 use List::Util 'none';
 
 # Minor version - may be patched from package.json
-our $VERSION = '0.43';
+our $VERSION = '0.44';
 
 # Supported version of Backend API
 our $API_VERSION = '1.0';
@@ -46,8 +46,18 @@
 
     # Load file and split lines for multiple secrets
     my $secrets = [b($old_secret->slurp)->split("\n")];
+
     $self->secrets($secrets);
 
+    for (@$secrets) {
+      if (length($secrets) > 22) {
+        $self->log->warn(
+          'Unable to automatically switch to Autosecrets, as secret is too long (> 22 chars)'
+        );
+        goto CONF;
+      };
+    }
+
     eval {
       $secret_file->spurt(encode_json(@$secrets));
       $secret_file->chmod(0600);
@@ -72,6 +82,7 @@
     });
   };
 
+ CONF:
 
   # Configuration framework
   $self->plugin('Config');