Module: InspecPlugins::Compliance::API::Login
Defined Under Namespace
Modules: Automate2Server
Classes: CannotDetermineServerType
Constant Summary
Inspec::Dist::AUTOMATE_PRODUCT_NAME, Inspec::Dist::COMPLIANCE_PRODUCT_NAME, Inspec::Dist::EXEC_NAME, Inspec::Dist::PRODUCT_NAME, Inspec::Dist::SERVER_PRODUCT_NAME
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.authenticate_login(options) ⇒ Object
.configuration_stored_message(config) ⇒ Object
70
71
72
|
# File 'lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb', line 70
def self.configuration_stored_message(config)
"Stored configuration for Chef #{config["server_type"].capitalize}: #{config["server"]}' with user: '#{config["user"]}'"
end
|
Instance Method Details
#login(options) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb', line 11
def login(options)
raise ArgumentError, "Please specify a server using `#{EXEC_NAME} automate login https://SERVER` or `#{EXEC_NAME} compliance login https://SERVER`" unless options["server"]
options["server_type"] = "automate2"
options["server"] = URI("https://#{options["server"]}").to_s if URI(options["server"]).scheme.nil?
Login::Automate2Server.login(options)
end
|