mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
75f39e74f2
shadow file. After much thought the deprecations from #2642 were for the wrong methods. Plural method names feel much more natural when working with this resource because you can have more than a single result. Consider a match like `shadow.user(/^www/)`, this could return multiple users, so `shadow.users` feels more natural here. The problem is that the fields we're matching in the shadow file itself are singular. Each entry is for a user, which has a password, and some other fields. A user never has `passwords` in the shadow file, only a `password`. This is made more obvious when you use the `filter` method. When we use this filter: `shadow.filter(min_days: 20, max_days: 30)` we are matching fields in the shadow file and not using our matcher methods. This means that if there is a discrepancy between our matcher methods, and the shadow fields the user could end up confused. Like I did =) This PR changes: Changed matchers to match shadow fields. Updated documentation to reflect changes. Updated tests to reflect changes. Re-add `filter` method, and add a test for it. Renamed variable for FilterTable to be less confusing. Renamed query argument for methods to be consistent. Cleanup docs based on comments from @jerryaldrichiii Make Rubocop happy <3 Signed-off-by: Miah Johnson <miah@chia-pet.org> |
||
---|---|---|
.. | ||
cookbooks/os_prepare | ||
functional | ||
integration | ||
unit | ||
docker_run.rb | ||
docker_test.rb | ||
helper.rb |