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
32
33
34
35
36
37
|
# File 'lib/resources/aws/aws_iam_access_keys.rb', line 32
def fetch_from_api
criteria = {}
criteria[:username] = @username if defined? @username
@table = BackendFactory.create(inspec_runner).fetch(criteria)
end
|
#to_s ⇒ Object
58
59
60
|
# File 'lib/resources/aws/aws_iam_access_keys.rb', line 58
def to_s
'IAM Access Keys'
end
|
#validate_params(raw_params) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/resources/aws/aws_iam_access_keys.rb', line 13
def validate_params(raw_params)
recognized_params = check_resource_param_names(
raw_params: raw_params,
allowed_params: [: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] and
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
|