Added : to allowed host names for IPv6 addresses
This commit is contained in:
parent
0c07e42427
commit
ef3ccd1b8b
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ Puppet::Type.newtype(:database_user) do
|
|||
validate do |value|
|
||||
# https://dev.mysql.com/doc/refman/5.1/en/account-names.html
|
||||
# Regex should problably be more like this: /^[`'"]?[^`'"]*[`'"]?@[`'"]?[\w%\.]+[`'"]?$/
|
||||
raise(ArgumentError, "Invalid database user #{value}") unless value =~ /[\w-]*@[\w%\.]+/
|
||||
raise(ArgumentError, "Invalid database user #{value}") unless value =~ /[\w-]*@[\w%\.:]+/
|
||||
username = value.split('@')[0]
|
||||
if username.size > 16
|
||||
raise ArgumentError, "MySQL usernames are limited to a maximum of 16 characters"
|
||||
|
|
Loading…
Reference in a new issue