Skip to content

Commit

Permalink
Merge pull request #1115 from Kuermel/master
Browse files Browse the repository at this point in the history
Increase of the role-name length to 40
  • Loading branch information
ghoneycutt authored Dec 1, 2021
2 parents 243abb5 + 61ddce4 commit b1ab9c2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
newparam(:name, :namevar => true) do
desc 'Role name.'

newvalues(/^[a-zA-Z_]{1}[-\w@.$]{0,29}$/)
newvalues(/^[a-zA-Z_]{1}[-\w@.$]{0,39}$/)
end

newproperty(:privileges) do
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_role_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
newparam(:name, :namevar => true) do
desc 'Role name.'

newvalues(/^[a-zA-Z_]{1}[-\w@.$]{0,29}$/)
newvalues(/^[a-zA-Z_]{1}[-\w@.$]{0,39}$/)
end

newproperty(:mappings, :array_matching => :all) do
Expand Down
2 changes: 1 addition & 1 deletion manifests/role.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Array $mappings = [],
Hash $privileges = {},
) {
validate_slength($name, 30, 1)
validate_slength($name, 40, 1)

if empty($privileges) or $ensure == 'absent' {
$_role_ensure = 'absent'
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/008_elasticsearch_role_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class { 'elasticsearch': }

context 'with an invalid role name' do
context 'too long' do
let(:title) { 'A' * 31 }
let(:title) { 'A' * 41 }
it { should raise_error(Puppet::Error, /expected length/i) }
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/type/elasticsearch_role_mapping_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
describe 'name' do
it 'should reject long role names' do
expect { described_class.new(
:name => 'a' * 31
:name => 'a' * 41
) }.to raise_error(
Puppet::ResourceError,
/valid values/i
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/type/elasticsearch_role_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
describe 'name' do
it 'should reject long role names' do
expect { described_class.new(
:name => 'a' * 31
:name => 'a' * 41
) }.to raise_error(
Puppet::ResourceError,
/valid values/i
Expand Down

0 comments on commit b1ab9c2

Please sign in to comment.