Class: AwsIamAccessKeys
Defined Under Namespace
Classes: Backend
Instance Attribute Summary
#table
Instance Method Summary
collapse
included
#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner
Instance Method Details
#fetch_from_api ⇒ Object
36
37
38
39
40
41
|
# File 'lib/resources/aws/aws_iam_access_keys.rb', line 36
def fetch_from_api
criteria = {}
criteria[:username] = @username if defined? @username
@table = BackendFactory.create(inspec_runner).fetch(criteria)
end
|
#to_s ⇒ Object
62
63
64
|
# File 'lib/resources/aws/aws_iam_access_keys.rb', line 62
def to_s
"IAM Access Keys"
end
|
#validate_params(raw_params) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/resources/aws/aws_iam_access_keys.rb', line 17
def validate_params(raw_params)
recognized_params = check_resource_param_names(
raw_params: raw_params,
allowed_params: %i{username id access_key_id created_date},
allowed_scalar_name: :access_key_id,
allowed_scalar_type: String
)
recognized_params[:access_key_id] = recognized_params.delete(:id) if recognized_params.key?(:id)
if recognized_params[:access_key_id] &&
recognized_params[:access_key_id] !~ (/^AKIA[0-9A-Z]{16}$/)
raise "Incorrect format for Access Key ID - expected AKIA followed " \
"by 16 letters or numbers"
end
recognized_params
end
|