Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Add potential to use other verbs than GET for inspec IAM fetches #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/gcp_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def initialize(link, cred, request_type)
end

def builder
Net::HTTP.const_get(request_type)
Net::HTTP.const_get(@request_type)
end

def send
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_bigquery_dataset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Dataset < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_bigquery_datasets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_bigquery_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Table < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_bigquery_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_cloudbuild_trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Trigger < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_cloudbuild_triggers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_cloudfunctions_cloud_function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CloudFunction < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_cloudfunctions_cloud_functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_autoscaler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Autoscaler < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_autoscalers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_backend_bucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BackendBucket < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_backend_buckets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_backend_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BackendService < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_backend_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Disk < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_global_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GlobalAddress < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_global_addresses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_global_forwarding_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GlobalForwardingRule < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_global_forwarding_rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_health_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HealthCheck < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_health_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_http_health_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HttpHealthCheck < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_http_health_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_https_health_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HttpsHealthCheck < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_https_health_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_instance_group_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InstanceGroupManager < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_instance_group_managers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_instance_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class InstanceTemplate < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_instance_templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Region < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_region_backend_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RegionBackendService < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_region_backend_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_regions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Route < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Router < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_routers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Snapshot < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_snapshots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_ssl_certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SslCertificate < GcpResourceBase
def initialize(params)
super(params.merge({ use_http_transport: true }))
@params = params
@fetched = @connection.fetch(product_url, resource_base_url, params)
@fetched = @connection.fetch(product_url, resource_base_url, params, 'Get')
parse unless @fetched.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_ssl_certificates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_compute_ssl_policies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize(params = {})

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(product_url, resource_base_url, @params)
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get')
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
Expand Down
Loading