-
Notifications
You must be signed in to change notification settings - Fork 682
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
CFINSPEC-246/CFINSPEC-247 Attestation changes for N/R outcomes #6222
Conversation
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
… the control - fix in streaming reporter Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
…iles Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
…tions file Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
…aming reporter Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
✅ Deploy Preview for chef-inspec canceled.
|
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
…station file Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
lib/inspec/attestations.rb
Outdated
# logic to find expiration date using frequency and updated date. | ||
updated_last = attestation_data["updated"] | ||
begin | ||
if updated_last.is_a?(Date) || (updated_last.is_a?(String) && Date.parse(updated_last).year != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can write this whole bunch of if and else in another method to make it cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, let me think about how I can logically separate those lines since I think they are part of the logic used for fetching the expiration date.
Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>
lib/inspec/attestations.rb
Outdated
ui.exit(:usage_error) | ||
end | ||
end | ||
end | ||
|
||
def self.fetch_expiry_using_frequency_and_updated_date(updated_date, frequency, control_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this method name can be reduced to fetch_expiry_date as its arguments are self-explanatory in that they need, updated_date
and frequency
. You can add code comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the method name should also explain its usage. So it seems fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem I felt it's too long :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and discussed in meetings - thanks for the good work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the long method name all looks good. Thanks!!
963e0e9
to
c5c49fb
Compare
…ation using frequency and updated date Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
c5c49fb
to
9c04848
Compare
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Description
Attestation feature which enables attesting N/R controls and marking them
pass
orfail
manually using a file option--attestation-file
Related Issue
Types of changes
Checklist: