Class: Compliance::Fetcher
Constant Summary
Fetchers::Url::MIME_TYPES
Instance Attribute Summary
#archive, #files
Class Method Summary
collapse
Instance Method Summary
collapse
download_archive, #initialize, transform
Constructor Details
This class inherits a constructor from Fetchers::Url
Class Method Details
.resolve(target, opts = {}) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/bundles/inspec-compliance/target.rb', line 17
def self.resolve(target, opts = {})
uri = URI(target)
return nil unless URI(uri).scheme == 'compliance'
config = Compliance::Configuration.new
return nil if config['token'].nil?
profile = uri.host + uri.path
Compliance::API.exist?(profile)
opts['user'] = config['token']
super(target_url(config, profile), opts)
rescue URI::Error => _e
nil
end
|
.target_url(config, profile) ⇒ Object
36
37
38
39
|
# File 'lib/bundles/inspec-compliance/target.rb', line 36
def self.target_url(config, profile)
owner, id = profile.split('/')
"#{config['server']}/owners/#{owner}/compliance/#{id}/tar"
end
|
Instance Method Details
#to_s ⇒ Object
41
42
43
|
# File 'lib/bundles/inspec-compliance/target.rb', line 41
def to_s
'Chef Compliance Profile Loader'
end
|