propertyList => {
type => { description => "Section type." },
section => {
- description => "Secion ID.",
+ description => "Section ID.",
type => 'string', format => 'pve-configid',
},
},
type => 'string',
},
clamav_heuristic_score => {
- description => "Score for ClamaAV heuristics (Google Safe Browsing database, PhishingScanURLs, ...).",
+ description => "Score for ClamAV heuristics (Google Safe Browsing database, PhishingScanURLs, ...).",
type => 'integer',
minimum => 0,
maximum => 1000,
default => 'database.clamav.net',
},
archiveblockencrypted => {
- description => "Wether to block encrypted archives. Mark encrypted archives as viruses.",
+ description => "Whether to block encrypted archives. Mark encrypted archives as viruses.",
type => 'boolean',
default => 0,
},
PVE::JSONSchema::register_format(
'tls-policy', \&pmg_verify_tls_policy);
+# TODO: extend to parse attributes of the policy
+my $VALID_TLS_POLICY_RE = qr/none|may|encrypt|dane|dane-only|fingerprint|verify|secure/;
sub pmg_verify_tls_policy {
my ($policy, $noerr) = @_;
- # TODO: extend to parse attributes of the policy
- my $valid_policy = qr/none|may|encrypt|dane|dane-only|fingerprint|verify|secure/;
-
- if ($policy !~ /^${valid_policy}$/) {
+ if ($policy !~ /^$VALID_TLS_POLICY_RE\b/) {
return undef if $noerr;
die "value '$policy' does not look like a valid tls policy\n";
}
return $policy;
}
+PVE::JSONSchema::register_format(
+ 'tls-policy-strict', \&pmg_verify_tls_policy_strict);
+
+sub pmg_verify_tls_policy_strict {
+ my ($policy, $noerr) = @_;
+
+ if ($policy !~ /^$VALID_TLS_POLICY_RE$/) {
+ return undef if $noerr;
+ die "value '$policy' does not look like a valid tls policy\n";
+ }
+ return $policy;
+}
+
sub read_tls_policy {
my ($filename, $fh) = @_;