From b8afba9440d8c1089e7299605f885c1144aa2bb1 Mon Sep 17 00:00:00 2001 From: Jeremy Woertink Date: Thu, 22 Jul 2021 09:13:55 -0700 Subject: [PATCH] Fix the secret_key validation to allow any string >= 32 bytes (#67) --- src/authentic.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/authentic.cr b/src/authentic.cr index 8b82ecd..a848466 100644 --- a/src/authentic.cr +++ b/src/authentic.cr @@ -38,10 +38,11 @@ module Authentic end def self.validate_length(value : String) - if value.bytesize != 32 + if value.bytesize < 32 Habitat.raise_validation_error <<-ERROR - Authentic secret_key setting must be 32 bytes long. + Authentic secret_key setting must be at least 32 bytes long, + but got #{value.bytesize} bytes '#{value}'. Try this...