- $key = $title,
- $ensure = present,
- $key_content = undef,
- $key_source = undef,
- $key_server = undef,
- $key_options = undef,
-) {
-
- validate_re($key, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z'])
- validate_re($ensure, ['\Aabsent|present\Z',])
-
- if $key_content {
- validate_string($key_content)
- }
-
- if $key_source {
- validate_re($key_source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+'])
- }
-
- if $key_server {
- validate_re($key_server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,4})?$'])
- }
-
- if $key_options {
- validate_string($key_options)
- }
+ Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/] $id = $title,
+ Enum['present', 'absent', 'refreshed'] $ensure = present,
+ Optional[String] $content = undef,
+ Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source = undef,
+ Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_.]+)*\/?$/] $server = $::apt::keyserver,
+ Boolean $weak_ssl = false,
+ Optional[String] $options = $::apt::key_options,
+ ) {