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

Raise exception if no token is set when using the chef-automate fetcher #249

Merged
merged 1 commit into from Jun 22, 2017

Conversation

Projects
None yet
2 participants
@adamleff
Collaborator

adamleff commented Jun 21, 2017

The chef-automate fetcher uses the data_collector token settings but does not check to ensure it's set before passing it to InSpec for Fetcher purposes. This causes InSpec to create a data-collector-token header with a nil value, and then Net::HTTP will toss an ugly error when trying to call #strip on nil.

InSpec should validate inputs too, but this will help catch this issue in the audit cookbook and provide a better error message. This was found in the Chef sales demo environments.

Raise exception if no token is set when using the chef-automate fetcher
The chef-automate fetcher uses the data_collector token settings but
does not check to ensure it's set before passing it to InSpec for
Fetcher purposes. This causes InSpec to create a data-collector-token
header with a nil value, and then Net::HTTP will toss an ugly error
when trying to call `#strip` on nil.

InSpec should validate inputs too, but this will help catch this issue
in the audit cookbook and provide a better error message. This was
found in the Chef sales demo environments.

Signed-off-by: Adam Leff <adam@leff.co>
@chris-rock

Thank you @adamleff

@adamleff adamleff merged commit c822a05 into master Jun 22, 2017

2 checks passed

DCO This commit has a DCO Signed-off-by
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@adamleff adamleff deleted the adamleff/raise-on-nil-token branch Jun 22, 2017

@adamleff adamleff removed the in progress label Jun 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment