-
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-269 Adds resource_id group 8 #6107
Conversation
✅ Deploy Preview for chef-inspec canceled.
|
720a5e5
to
ca7b5cf
Compare
lib/inspec/resources/opa_api.rb
Outdated
@@ -18,6 +24,10 @@ def allow | |||
@content["result"] | |||
end | |||
|
|||
def resource_id | |||
@url |
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.
This might lead to nil error since in line 16 @url is initialized as @url = opts[:url] || nil
.
Suggested fix: `@nil || "OPA api"
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.
Yes but there is validation also below that which does not allow URL as nil.
lib/inspec/resources/opa_cli.rb
Outdated
@@ -22,6 +28,10 @@ def allow | |||
@content["result"][0]["expressions"][0]["value"] if @content["result"][0]["expressions"][0]["text"].include?("allow") | |||
end | |||
|
|||
def resource_id | |||
"#{@policy}:#{@query}" |
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.
This might lead to nil error too, since in line 17 @policy = opts[:policy] || nil
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.
Same here there is validation.
d1a2dc7
to
e02932b
Compare
…_cli resource and unit test for the same Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
e02932b
to
5d47334
Compare
Signed-off-by: Vasu1105 vasundhara.jagdale@chef.io
Description
This adds resource_id for the following resources.
Related Issue
Types of changes
Checklist: