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

improve compliance refresh token handling #85

Merged
merged 3 commits into from
Aug 25, 2016

Conversation

chris-rock
Copy link
Contributor

@chris-rock chris-rock commented Aug 23, 2016

Description

This PR is doing the following:

  • extract inspec gem installation
  • ensures the refresh token is only exchanged once

Issues Resolved

Customers reported that refresh_token handling was not working as expected and lead to authentication errors for some requests.

Check List

action :install do
converge_by 'install/update inspec' do
chef_gem 'inspec' do
version version if version != 'latest'
Copy link
Contributor

@jeremymv2 jeremymv2 Aug 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-rock I get an WARN on line 15 version

Recipe: audit::_inspec

 * inspec[inspec] action install[2016-08-25T13:28:53+00:00] WARN: /var/chef/cache/cookbooks/audit/libraries/inspec.rb:15:in `block (3 levels) in <class:ChefInspec>': property version is declared in both chef_gem[inspec] and inspec[inspec] action :install. Use new_resource.version instead. At /var/chef/cache/cookbooks/audit/libraries/inspec.rb:15:in `block (3 levels) in <class:ChefInspec>'
[2016-08-25T13:28:53+00:00] WARN: /var/chef/cache/cookbooks/audit/libraries/inspec.rb:15:in `block (3 levels) in <class:ChefInspec>': property version is declared in both chef_gem[inspec] and inspec[inspec] action :install. Use new_resource.version instead. At /var/chef/cache/cookbooks/audit/libraries/inspec.rb:15:in `block (3 levels) in <class:ChefInspec>'

This doc seems to support the WARN message above:
https://docs.chef.io/custom_resources.html#new-resource-property

When I test changing line 15 to the following I no longer get the WARNing, and the gem is installed correctly at the expected version.
version new_resource.version if new_resource.version != 'latest'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jeremymv2
Copy link
Contributor

jeremymv2 commented Aug 25, 2016

Added a few comments above. Otherwise this PR looks awesome and will be super helpful. Tested the PR itself and works like charm! Very nice @chris-rock!

👍

@chris-rock chris-rock force-pushed the chris-rock/compliance_refresh_token branch from 35f3ab5 to b231d30 Compare August 25, 2016 21:48
@chris-rock chris-rock merged commit 5dd214f into master Aug 25, 2016
@chris-rock chris-rock deleted the chris-rock/compliance_refresh_token branch August 25, 2016 22:02
@chris-rock chris-rock added the Type: Enhancement Adds new functionality. label Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Development

Successfully merging this pull request may close these issues.

4 participants