Skip to content

Commit

Permalink
Merge branch 'master' into support-azure-functions-resource
Browse files Browse the repository at this point in the history
  • Loading branch information
sathish-progress authored Jun 1, 2021
2 parents f1ea244 + 61ed3eb commit f089bc3
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 103 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Changelog
<!-- latest_release 1.44.0 -->
<!-- latest_release 1.44.2 -->
## [v1.44.2](https://github.com/inspec/inspec-azure/tree/v1.44.2) (2021-06-01)

#### Merged Pull Requests
- Update rubocop requirement from ~&gt; 1.14.0 to ~&gt; 1.15.0 [#383](https://github.com/inspec/inspec-azure/pull/383) ([dependabot[bot]](https://github.com/dependabot[bot]))
<!-- latest_release -->

## [v1.44.1](https://github.com/inspec/inspec-azure/tree/v1.44.1) (2021-06-01)

#### Merged Pull Requests
- fix style and alignment issues [#384](https://github.com/inspec/inspec-azure/pull/384) ([sathish-progress](https://github.com/sathish-progress))

## [v1.44.0](https://github.com/inspec/inspec-azure/tree/v1.44.0) (2021-05-19)

#### Merged Pull Requests
- Adding Azure Container Registry Resource [#382](https://github.com/inspec/inspec-azure/pull/382) ([Rohit1509](https://github.com/Rohit1509))
<!-- latest_release -->

## [v1.43.7](https://github.com/inspec/inspec-azure/tree/v1.43.7) (2021-05-06)

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ end

group :development, :test do
gem 'minitest'
gem 'rubocop', '~> 1.14.0'
gem 'rubocop', '~> 1.15.0'
end
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.44.0
1.44.2
2 changes: 1 addition & 1 deletion inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ copyright: Chef Software, Inc.
copyright_email: support@chef.io
license: Apache-2.0
summary: This resource pack provides compliance resources for Azure.
version: 1.44.0
version: 1.44.2
inspec_version: '>= 4.18.39'
supports:
- platform: azure
12 changes: 6 additions & 6 deletions libraries/azure_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def initialize(opts = {})
#
def resource_from_graph_api(opts)
Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(api_version query_parameters),
required: %i(resource), opts: opts)
required: %i(resource), opts: opts)
api_version = opts[:api_version] || @azure.graph_api_endpoint_api_version
if api_version.size > 10 || api_version.include?('/')
raise ArgumentError, 'api version can not be longer than 10 characters and contain `/`.'
Expand Down Expand Up @@ -243,9 +243,9 @@ def construct_resource_id
#
def get_resource(opts = {})
Validators.validate_parameters(resource_name: @__resource_name__,
required: %i(resource_uri),
allow: %i(query_parameters headers method req_body is_uri_a_url audience),
opts: opts)
required: %i(resource_uri),
allow: %i(query_parameters headers method req_body is_uri_a_url audience),
opts: opts)
params = opts[:query_parameters] || {}
api_version = params['api-version'] || 'latest'
if opts[:resource_uri].scan('providers').size == 1
Expand Down Expand Up @@ -487,8 +487,8 @@ def validate_parameters(allow: [], required: nil, require_any_of: nil)
allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor
endpoint api_version required_parameters allowed_parameters display_name)
Validators.validate_parameters(resource_name: @__resource_name__,
allow: allow, required: required,
require_any_of: require_any_of, opts: opts)
allow: allow, required: required,
require_any_of: require_any_of, opts: opts)
true
end

Expand Down
8 changes: 4 additions & 4 deletions libraries/azure_generic_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ def failed_resource?
# api_version [string] The api version of the endpoint (default - latest).
def additional_resource_properties(opts = {})
Validators.validate_parameters(resource_name: @__resource_name__,
required: %i(property_name property_endpoint),
allow: %i(api_version filter_free_text add_subscription_id method req_body headers),
opts: opts)
required: %i(property_name property_endpoint),
allow: %i(api_version filter_free_text add_subscription_id method req_body headers),
opts: opts)
unless opts[:add_subscription_id].nil?
opts[:property_endpoint] = validate_resource_uri(
{
resource_uri: opts[:property_endpoint],
add_subscription_id: opts[:add_subscription_id],
add_subscription_id: opts[:add_subscription_id],
},
)
end
Expand Down
6 changes: 3 additions & 3 deletions libraries/azure_key_vault_keys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def populate_table
# dm.create_methods(resource_instance, resource[:attributes])
@table << {
kid: resource_instance&.kid,
attributes: resource_instance&.attributes,
tags: resource_instance&.tags,
managed: resource_instance.managed,
attributes: resource_instance&.attributes,
tags: resource_instance&.tags,
managed: resource_instance.managed,
}
end
end
Expand Down
8 changes: 4 additions & 4 deletions libraries/azure_key_vault_secrets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def populate_table
# dm.create_methods(resource_instance, resource[:attributes])
@table << {
id: resource_instance&.id,
attributes: resource_instance&.attributes,
tags: resource_instance&.tags,
contentType: resource_instance&.contentType,
managed: resource_instance.managed,
attributes: resource_instance&.attributes,
tags: resource_instance&.tags,
contentType: resource_instance&.contentType,
managed: resource_instance.managed,
}
end
end
Expand Down
6 changes: 3 additions & 3 deletions libraries/azure_management_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def populate_table
dm.create_methods(resource_instance, resource[:properties])
@table << {
id: resource_instance&.id,
name: resource_instance&.name,
properties: resource_instance&.properties,
type: resource_instance&.type,
name: resource_instance&.name,
properties: resource_instance&.properties,
type: resource_instance&.type,
}
end
end
Expand Down
4 changes: 2 additions & 2 deletions libraries/azure_network_watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def flow_logs
{
resource_uri:
"/resourceGroups/#{@opts[:resource_group]}/providers/Microsoft.Network/networkSecurityGroups/#{nsg}",
add_subscription_id: true,
add_subscription_id: true,
},
)
elsif @opts[:nsg_resource_group] && @opts[:nsg_name]
Expand All @@ -56,7 +56,7 @@ def flow_logs
resource_uri:
"/resourceGroups/#{@opts[:nsg_resource_group]}/providers/Microsoft.Network/networkSecurityGroups/"\
"#{@opts[:nsg_name]}",
add_subscription_id: true,
add_subscription_id: true,
},
)
elsif @opts[:nsg_resource_id]
Expand Down
8 changes: 4 additions & 4 deletions libraries/azure_storage_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ def activity_log_alert_filter(filter)
additional_resource_properties(
{
property_name: 'activity_log_alert_filtered',
property_endpoint: '/providers/microsoft.insights/eventtypes/management/values',
add_subscription_id: true,
api_version: @opts[:activity_log_alert_api_version],
filter_free_text: filter,
property_endpoint: '/providers/microsoft.insights/eventtypes/management/values',
add_subscription_id: true,
api_version: @opts[:activity_log_alert_api_version],
filter_free_text: filter,
},
)
end
Expand Down
6 changes: 3 additions & 3 deletions libraries/backend/azure_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def provider_details
#
def rest_api_call(opts)
Validators.validate_parameters(resource_name: @__resource_name__,
required: %i(url),
allow: %i(params headers method req_body audience),
opts: opts, skip_length: true)
required: %i(url),
allow: %i(params headers method req_body audience),
opts: opts, skip_length: true)
uri = URI(opts[:url])
# If the authentication audience is provided, use it.
if opts[:audience]
Expand Down
Loading

0 comments on commit f089bc3

Please sign in to comment.