mirror of
https://github.com/inspec/inspec
synced 2025-02-18 15:08:44 +00:00
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> |
||
---|---|---|
.. | ||
resources | ||
shared | ||
.gitignore | ||
dsl_inspec.md | ||
dsl_resource.md | ||
glossary.md | ||
habitat.md | ||
inspec_and_friends.md | ||
matchers.md | ||
migration.md | ||
platforms.md | ||
plugin_kitchen_inspec.md | ||
profiles.md | ||
README.md | ||
reporters.md | ||
ruby_usage.md | ||
shell.md |
InSpec documentation
This is the home of the InSpec documentation. This documentation provides an introduction to this mechanism and shows how to write custom tests.
The goal of this folder is for any community member to clone these docs, make the changes, check if they are valid, and contribute to the project.
How to build docs
We build docs by:
- Auto-generating docs from code
- Transforming markdown+snippets in this folder into pure markdown in
www/source/docs
- Rendering them to the website via instructions in
www/
For development, you only need step 1!
1 Generate docs
To generate all docs run:
bundle exec rake docs
You can run tasks individually. For a list of tasks run:
bundle exec rake --tasks docs
Stability Index
Every available InSpec resource will indicate its stability. As InSpec matures, certain parts are more reliable than others. Brand new features are likely to be redesigned and marked as such.
The stability indices are as follows:
Stability: Deprecated
- This features will be removed in future versions, because its known for being problematic. Do not rely on it.Stability: Experimental
- New features may change or are removed in future versionsStability: Stable
- API is well established and proofed. Maintaining compatibility is a high priorityStability: Locked
- Only security and performance fixes are allowed