(CONT-773) Rubocop Auto Fixes 1-5
[puppet-modules/puppetlabs-apt.git] / lib / puppet / type / apt_key.rb
index 8c5c84c886f83c3bc296b0e06e50ff73af3d1391..99be930e28b8e51ff47af87c2e568a33bb55f463 100644 (file)
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require 'pathname'
 require 'puppet/parameter/boolean'
 
@@ -29,6 +31,7 @@ Puppet::Type.newtype(:apt_key) do
     if self[:content] && self[:source]
       raise(_('The properties content and source are mutually exclusive.'))
     end
+
     if self[:id].length < 40
       warning(_('The id should be a full fingerprint (40 characters), see README.'))
     end
@@ -68,7 +71,7 @@ Puppet::Type.newtype(:apt_key) do
     desc 'The key server to fetch the key from based on the ID. It can either be a domain name or url.'
     defaultto :'keyserver.ubuntu.com'
 
-    newvalues(%r{\A((hkp|hkps|http|https)://)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$})
+    newvalues(%r{\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_.]+)*\/?$})
   end
 
   newparam(:options) do
@@ -81,7 +84,7 @@ Puppet::Type.newtype(:apt_key) do
   end
 
   newparam(:weak_ssl, boolean: true, parent: Puppet::Parameter::Boolean) do
-    desc 'When true and source uses https, accepts download of keys without SSL verfication'
+    desc 'When true and source uses https, accepts download of keys without SSL verification'
     defaultto false
   end