Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing validation of attribute names containing upper case characters #243

Open
DavidS opened this issue Nov 6, 2019 · 0 comments
Open
Labels

Comments

@DavidS
Copy link
Contributor

DavidS commented Nov 6, 2019

Describe the Bug

register_type accepts attribute names containing upper case characters. Puppet will happily downcase those for internal processing, without RSAPI noticing. this in turn leads to random-looking failures later in processing.

Expected Behavior

RSAPI register_type and register_transport refuse to accept attribute/connection_info keys that do not conform to all-lower-case snake casing rules (all lowercase, numbers, underscores, starts with letter).

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a new type called some with a mandatory attribute called someThing
  2. Run puppet apply -e 'some { foo: }

Will fail with:

david@davids:~/tmp/foo$ pdk bundle exec puppet apply -e 'some { test: }' --verbose --trace --modulepath spec/fixtures/modules
pdk (INFO): Using Ruby 2.5.7
pdk (INFO): Using Puppet 6.10.1
Notice: Compiled catalog for localhost in environment production in 0.11 seconds
Info: Applying configuration version '1573033174'
Error: /Stage[main]/Some[test]: Could not evaluate: The following mandatory attributes were not provided:
    *  SomeThing
/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/gems/puppet-resource_api-1.8.7/lib/puppet/resource_api.rb:342:in `raise_missing_attrs'
/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/gems/puppet-resource_api-1.8.7/lib/puppet/resource_api.rb:289:in `retrieve'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/puppet-6.10.1/lib/puppet/type.rb:1133:in `retrieve_resource'
[...]

Additional Context

This problem was originally reported and diagnosed by Brian Dinga on the community slack.

@DavidS DavidS added the bug label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant